Dear Kwant users and developers, I have a question about plotting wavefunction. This question is based on http://kwant-project.org/doc/1.0/tutorial/tutorial6. If I want to print the amplitude of wavefunction at the A site / B site only at the edge, I suppose I have to get the index of the A/B atom at the edge first. Is there anyway by which we can get the index of them? Thank you very much. Best, Johnny
Hi, you can get the indices of all the sites in the finialized system by using the `sites` property of finalized systems. After that , it's just a case of writing a function that can filter this list based on whether a site is on the `edge` or not. You would have to define this filtering yourself. For graphene I would imagine that such a filter would involve querying the number of neighbours of a particular site. Happy Kwanting, Joe
Hi Johnny, Just to add something, if your lattice is simple enough and all the atoms in the bulk have the same number of neighbors, then you can figure out which atoms are on the edge for example like this: [i for i in range(len(syst.graph.num_nodes)) if len(syst.graph.out_neighbors(i)) < 3]. Note: 3 in the expression is the number of neighbors in the bulk. Cheers, Anton On Thu, Apr 14, 2016 at 12:16 PM, Joseph Weston <joseph.weston08@gmail.com> wrote:
Hi,
you can get the indices of all the sites in the finialized system by using the `sites` property of finalized systems. After that , it's just a case of writing a function that can filter this list based on whether a site is on the `edge` or not. You would have to define this filtering yourself. For graphene I would imagine that such a filter would involve querying the number of neighbours of a particular site.
Happy Kwanting,
Joe
Thanks all for your helpful advice! Best, Johnny On 14 April 2016 at 19:06, Anton Akhmerov <anton.akhmerov@gmail.com> wrote:
Hi Johnny,
Just to add something, if your lattice is simple enough and all the atoms in the bulk have the same number of neighbors, then you can figure out which atoms are on the edge for example like this: [i for i in range(len(syst.graph.num_nodes)) if len(syst.graph.out_neighbors(i)) < 3]. Note: 3 in the expression is the number of neighbors in the bulk.
Cheers, Anton
On Thu, Apr 14, 2016 at 12:16 PM, Joseph Weston <joseph.weston08@gmail.com> wrote:
Hi,
you can get the indices of all the sites in the finialized system by using the `sites` property of finalized systems. After that , it's just a case of writing a function that can filter this list based on whether a site is on the `edge` or not. You would have to define this filtering yourself. For graphene I would imagine that such a filter would involve querying the number of neighbours of a particular site.
Happy Kwanting,
Joe
participants (3)
-
Anton Akhmerov
-
Johnny Wu
-
Joseph Weston