Finding the position of a site in the system
Dear all, I am trying to write the current density in a file. In order to write the current in an external file, I have to know the coordinates associated with the current as well. In Kwant < 1.3, I used *sys**.site(i).pos* to know the position of a given tag *i*. In the current version, this is not available anymore. How can I do this now? That is, given *current = J(psi)* (As in the example on the website), how can I know the position associated with *i* in *current[i]*? Best Regards, Luan
Hi Luan,
I am trying to write the current density in a file. In order to write the current in an external file, I have to know the coordinates associated with the current as well. In Kwant < 1.3, I used /sys//.site(i).pos/ to know the position of a given tag /i/. In the current version, this is not available anymore. How can I do this now? That is, given /current = J(psi)/ (As in the example on the website), how can I know the position associated with /i/ in /current[i]/?
It seems the documentation is less than satisfactory in this regard; I have added an issue [1]. The current is ordered in the same way as the graph of the system. You could do something like the following: current = J(psi) to_save = [(syst.pos(i), syst.pos(j), k) for (i, j), k in zip(syst.graph, current)] Happy Kwanting, Joe [1]: https://gitlab.kwant-project.org/kwant/kwant/issues/172
participants (2)
-
Joseph Weston
-
Luan Vieira de Castro