Hi Joseph and Anton,
Thank you for the advice with getting the 2d graph up and running, its now producing results that look good. Sorry that I haven't replied in over 2 weeks, uni has gotten into full swing. I wasn't sure if I needed to start a new topic for this (if I need to let me know) but I am now trying to remove lattice points randomly from my sample. I have created a function that can remove random lattice points (it is rather messy) however I have noticed that when I try to delete sites for layers other than at z=0 and z=5.3 I get the following error.: KeyError: Site(kwant.lattice.Monatomic([[4.3763, 0.0, 0.0], [0.0, 3.3136, 0.0], [0.0, 0.0, 5.3]], [0.0, 0.0, 0.0], '0', 1), array([50, 50, 10])) This error seems to pop up when I try to delete a site that doesn't exist at the specified coordinates however when I use: Positions=[syst.sites[i].pos for i in range(len(syst.sites))] I see that sites definitely exist for z=10 (should be 10.6 but the error output seems to round). I was therefore wondering if there is something I am missing when it comes to deleting sites and if there is an easy way to delete random sites from a 3d sample. Thank You, Mitchell Greenberg ________________________________ From: Joseph Weston <[email protected]> Sent: Wednesday, August 30, 2017 8:33:01 PM To: Mitchell Greenberg; [email protected] Subject: Re: [Kwant] 2D Current Density Streamplot of 3D System Hi Mitchell, > Sorry again for the reply, I've had a look at the documentation and it > seems that relwidth and abswidth control the size of the arrays. What > I'm stuck on though is that my system has L = 80, W = 450 and H =52, > I was expecting field to return something of the form (80,450,52,3), I > must apologise again, I'm pretty new to all things python so my > knowledge in the more complex areas is lacking. The input to 'interpolate_current' is a current defined on the hoppings of your system. The output is a current defined over a realspace grid. First the current defined on the hoppings is convoluted with a bump function to smooth it out, then the resulting continuous vector field is sampled on a regular grid. The docstring explains how this is done. The interpolation grid does not in general coincide with the "grid" of sites that form your system. Typically there will be several interpolation points between neighboring sites. The 'box' returned by 'interpolate_current' allows you to calculate the realspace position of the interpolation points. Also the modifications to 'interpolate_current' so that it functions correctly for 3D systems just landed on the most recent development version of kwant [1]. Happy Kwanting, Joe [1]: https://gitlab.kwant-project.org/kwant/kwant/commit/be364e7c64c316caf86869df397446399bcef1af
