Nearest neighbor Hamiltonian elements (Current density maps)

Hi All, I am currently trying to implement the advice given by Joseph in https://www.mail-archive.com/kwant-discuss@kwant-project.org/msg00075.html? to write a code which generates the current density going into each site in my graphene system. My issue is with returning the nearest neighbor hopping elements in graphene. In the example Joseph posted for a square lattice, there is an obvious coordinate for the nearest neighbor sites. It seems to me that in graphene (or any honeycomb lattice), this is not so obvious. I have been looking for a function built into Kwant that would give me what I need, but haven't had much luck. I've figured out lots of ways (for example, using sys_leads_sites on my finalized system) to generate the number assigned to each site and the corresponding position, but not a good way to determine which are nearest neighbors. I'm guessing the answer is very simple using some of the machinery built into Kwant, I'm just not seeing it. Does anyone have any tips they would be willing to give me? I am not looking for a complete current density code, just a nudge in the right direction. ? Thanks very much! Sam

Hi, Kwant finalized systems have a graph which can be efficiently queried to get the "neighbours" of a site (neighbours here means that they are joined by a hopping) you can do: ... lat = kwant.lattice.honeycomb() sys = make_system(lat) fsys = sys.finalized() i = fsys.sites.index(lat(5, 6)) # get sequence of integers -- sites connected to i by a hopping all_the_neighbors = fsys.graph.out_neighbors(i) depending on what you want to do afterwards you can map the integers in "all_the_neighbors" back to bona-fide sites using "fsys.sites", which you know about already, or you can calculate currents etc. There is documentation on the graph ( http://kwant-project.org/doc/1.0/reference/generated/kwant.graph.CGraph#kwan... ) but this is kind of advanced kwant usage and there's no explicit examples in the tutorial. Hope that helps, Joe P.S. I'm actually looking to implement better support for manipulating quantities which are defined over sites/hoppings, and am talking with Christoph about having this in kwant 2.0. On 28 July 2015 at 21:50, LaGasse, Samuel <SLaGasse@sunypoly.edu> wrote:
Hi All,
I am currently trying to implement the advice given by Joseph in https://www.mail-archive.com/kwant-discuss@kwant-project.org/msg00075.html to write a code which generates the current density going into each site in my graphene system.
My issue is with returning the nearest neighbor hopping elements in graphene. In the example Joseph posted for a square lattice, there is an obvious coordinate for the nearest neighbor sites. It seems to me that in graphene (or any honeycomb lattice), this is not so obvious.
I have been looking for a function built into Kwant that would give me what I need, but haven't had much luck. I've figured out lots of ways (for example, using sys_leads_sites on my finalized system) to generate the number assigned to each site and the corresponding position, but not a good way to determine which are nearest neighbors. I'm guessing the answer is very simple using some of the machinery built into Kwant, I'm just not seeing it.
Does anyone have any tips they would be willing to give me? I am not looking for a complete current density code, just a nudge in the right direction.
Thanks very much!
Sam

Hi Joe, Thanks for your help! Your advice was what I needed to get my code working. I had a feeling what I needed was somewhere in the documentation- I was just looking in the wrong places. I've included an ipython notebook for anyone who might want to check it out (hopefully it works): http://nbviewer.ipython.org/github/samlagasse/LaGasse_QT/blob/master/QHE_cur... I haven't yet implemented any Fermi-Dirac functions so this is only for a very idealized case... The code is pretty messy but it might help anyone who runs into similar problems to mine. I modified one of the examples posted in the Kwant paper for it. I think it is pretty interesting to compare the probability density and current density maps- I expected them to give the same information but in my testing, it goes case by case. In this example its pretty similar (I just think it looks really cool), but in another I did looking a focusing effects in graphene, you really need the current density map. It also shows my way of plotting log-scale colormaps of data from Kwant. It probably exists, but I didn't see a native way of doing it with the existing codes. I'm hoping to add some more examples to this notebook over time- this is just kind of a first draft of the code- it doesn't have many comments. I'm also not convinced it doesn't have mistakes yet. Thanks again! Sam ________________________________ From: Joseph Weston <joseph.weston08@gmail.com> Sent: Wednesday, July 29, 2015 1:42 AM To: LaGasse, Samuel Cc: kwant-discuss@kwant-project.org Subject: Re: [Kwant] Nearest neighbor Hamiltonian elements (Current density maps) Hi, Kwant finalized systems have a graph which can be efficiently queried to get the "neighbours" of a site (neighbours here means that they are joined by a hopping) you can do: ... lat = kwant.lattice.honeycomb() sys = make_system(lat) fsys = sys.finalized() i = fsys.sites.index(lat(5, 6)) # get sequence of integers -- sites connected to i by a hopping all_the_neighbors = fsys.graph.out_neighbors(i) depending on what you want to do afterwards you can map the integers in "all_the_neighbors" back to bona-fide sites using "fsys.sites", which you know about already, or you can calculate currents etc. There is documentation on the graph (http://kwant-project.org/doc/1.0/reference/generated/kwant.graph.CGraph#kwan...) but this is kind of advanced kwant usage and there's no explicit examples in the tutorial. Hope that helps, Joe P.S. I'm actually looking to implement better support for manipulating quantities which are defined over sites/hoppings, and am talking with Christoph about having this in kwant 2.0. On 28 July 2015 at 21:50, LaGasse, Samuel <SLaGasse@sunypoly.edu<mailto:SLaGasse@sunypoly.edu>> wrote: Hi All, I am currently trying to implement the advice given by Joseph in https://www.mail-archive.com/kwant-discuss@kwant-project.org/msg00075.html to write a code which generates the current density going into each site in my graphene system. My issue is with returning the nearest neighbor hopping elements in graphene. In the example Joseph posted for a square lattice, there is an obvious coordinate for the nearest neighbor sites. It seems to me that in graphene (or any honeycomb lattice), this is not so obvious. I have been looking for a function built into Kwant that would give me what I need, but haven't had much luck. I've figured out lots of ways (for example, using sys_leads_sites on my finalized system) to generate the number assigned to each site and the corresponding position, but not a good way to determine which are nearest neighbors. I'm guessing the answer is very simple using some of the machinery built into Kwant, I'm just not seeing it. Does anyone have any tips they would be willing to give me? I am not looking for a complete current density code, just a nudge in the right direction. Thanks very much! Sam

Hi Sam,
I've included an ipython notebook for anyone who might want to check it out (hopefully it works): http://nbviewer.ipython.org/github/samlagasse/LaGasse_QT/blob/master/QHE_cur...
Neat! Thanks for sharing, it's really good to have some publicly available examples of Kwant usage which weren't written by the main developers. I think it would be really cool to have a publicly available set of interesting notebooks that use Kwant; it could even be linked to from the main Kwant website. This would be a good way to augment the tutorials, and would mean that the examples are not limited to the immediate research interest of the Kwant developers.
In this example its pretty similar (I just think it looks really cool), but in another I did looking a focusing effects in graphene, you really need the current density map.
There has actually been an intern here in Grenoble working on implementing good current density maps in Kwant. Your example looks awesome, but it's missing the direction information. Getting a good-looking continuous vector field from the discrete underlying lattice required a bit of thinking, but now we have something that looks really neat. This will probably be included as part of Kwant 2.0. Happy Kwanting, Joe
participants (2)
-
Joseph Weston
-
LaGasse, Samuel