Some simple and general questions
Dear All,
I am really liking this Kwant program and I find it very intuitive. However my python is a bit rusty.
1) I would like to know what is the simplest way the number of sites, the positions, and the tuples of these sites. I would like to print them all out.
2) In this graphene flake example (http://kwantproject.org/doc/latest/tutorial/tutorial4 http://kwantproject.org/doc/latest/tutorial/tutorial4) if i wanted to make a hall bar setup, how would I exactly attach the leads purely in the xaxis and purely only the yaxis. (more of an aesthetic question).
3) in terms of the hopping, when one has sys[lat.neighbors(1)] =t sys[lat.neighbors(2)] =t is the hopping mediated by the distance i.e. t_1=t/a_1 and t_2=t/a_2.
4) I have calculated the energy DOS for a lead and this looks correct, what I’m more unsure of is this the same as the DOS of the propagating modes. And I see how to find the velocity and things from the documentation, but is there a way to find the energy. Sorry if this is a stupid question I could not find anything on the forum
5) similar to question 1) how do I find things like the number of propagating modes.
6) what is the best way to go about writing observables, sorry this is quite a general question and most likely up to the user, but for instance the pauli matrices are quite simple. However the position operator, or velocity operator changes with the way the Hamiltonian is described, is there something simple general method to calculate these?
Thanks very much, and sorry if I did not see these answers in the mailing list
Regards, Jacob
JGIU INSPIRE GROUP  Prof. Sinova FB 08  Institut für Physik Staudinger Weg 7 55128 Mainz ____________________________ room 01523 (1. OG) phone +49 (0) 1517/ 3927424 fax +49 (0) 6131/ 3926267 email jgayles@unimainz.de mailto:sinovagroup@unimainz.de
Hi Jacob,
I will start to answer some of your questions:
Gayles, Jacob Davis wrote:
 I would like to know what is the simplest way the number of
sites, the positions, and the tuples of these sites. I would like to print them all out.
For a builder or for a finalized builder?
 In this graphene flake example
(http://kwantproject.org/doc/latest/tutorial/tutorial4 http://kwantproject.org/doc/latest/tutorial/tutorial4) if i wanted to make a hall bar setup, how would I exactly attach the leads purely in the xaxis and purely only the yaxis. (more of an aesthetic question).
Kwant chooses the unit cells of leads according to a rule that does not always lead (pun intended) to aesthetically pleasing results and also sometimes degrades performance by adding sites to the scattering region without a real need. You can, however, choose the direction in which leads are “sliced” yourself by using “add_site_family” method of your symmetry and its “other_vectors” parameter before you start adding sites to your lead. See here for an example:
http://article.gmane.org/gmane.comp.science.kwant.user/177/match=other_vecto...
 in terms of the hopping, when one has sys[lat.neighbors(1)]
=t sys[lat.neighbors(2)] =t is the hopping mediated by the distance i.e. t_1=t/a_1 and t_2=t/a_2.
The bits of the Hamiltonian (includling the hoppings) are what you set them to. The lattice constant is only used for plotting.
So long, Christoph
Thanks very much for the quick reply,
1) I would like to do both. but more so for the finalized builder.
2) Ok I saw this post, but I am still a little unsure how this is set up. Do I start with some sym0 = kwant.TranslationalSymmetry(graphene.vec((1, 0))). And then add_site_family? And is the other vectors a general direction, or the lattice direction?
3) Thanks very much, it is what I suspected but I was unsure.
Cheers, Jacob
On Apr 21, 2016, at 12:52 PM, Christoph Groth christoph.groth@cea.fr wrote:
Hi Jacob,
I will start to answer some of your questions:
Gayles, Jacob Davis wrote:
 I would like to know what is the simplest way the number of sites, the positions, and the tuples of these sites. I would like to print them all out.
For a builder or for a finalized builder?
 In this graphene flake example (http://kwantproject.org/doc/latest/tutorial/tutorial4 http://kwantproject.org/doc/latest/tutorial/tutorial4) if i wanted to make a hall bar setup, how would I exactly attach the leads purely in the xaxis and purely only the yaxis. (more of an aesthetic question).
Kwant chooses the unit cells of leads according to a rule that does not always lead (pun intended) to aesthetically pleasing results and also sometimes degrades performance by adding sites to the scattering region without a real need. You can, however, choose the direction in which leads are “sliced” yourself by using “add_site_family” method of your symmetry and its “other_vectors” parameter before you start adding sites to your lead. See here for an example:
http://article.gmane.org/gmane.comp.science.kwant.user/177/match=other_vecto...
 in terms of the hopping, when one has sys[lat.neighbors(1)] =t sys[lat.neighbors(2)] =t is the hopping mediated by the distance i.e. t_1=t/a_1 and t_2=t/a_2.
The bits of the Hamiltonian (includling the hoppings) are what you set them to. The lattice constant is only used for plotting.
So long, Christoph
Hi,
 I would like to do both. but more so for the finalized builder.
`FinalizedBuilder`s have a `sites` attribute that is a list of sites, ordered in the same way as the wavefunction/ldos etc.
 Ok I saw this post, but I am still a little unsure how this is set up.
Do I start with
some sym0 = kwant.TranslationalSymmetry(graphene.vec((1, 0))). And then add_site_family? And is the other vectors a general direction, or the
lattice direction?
yes that's it. The docs say that you have to give lattice vectors:
http://kwantproject.org/doc/1.0/reference/generated/kwant.lattice.Translati...
i.e. the vectors that you give are in the basis of the lattice vectors, so like:
sym0.add_site_family(graphene, [(1, 1)])
 I have calculated the energy DOS for a lead and this looks correct,
what I’m more
unsure of is this the same as the DOS of the propagating modes. And I see
how to find
the velocity and things from the documentation, but is there a way to
find the energy.
Sorry if this is a stupid question I could not find anything on the forum
Not sure what you mean by this; the energy is an _input_ for calculating the DOS, although by default a value of 0 is used (see the docs).
 similar to question 1) how do I find things like the number of
propagating modes.
`InfiniteSystem`s have a method called `modes` that will calculate you this:
http://kwantproject.org/doc/1.0/reference/generated/kwant.system.InfiniteSy...
 what is the best way to go about writing observables, sorry this is
quite a general
question and most likely up to the user, but for instance the pauli
matrices are quite
simple.
Yeah so support for this in kind of weak in Kwant at the moment. It will, unfortunately probably be a case of creating the operator matrix yourself. We want to add support or easily defining generic charge/current operators (e.g. spin along some magnetization axis that changes through the system), but this is more do do with dealing with multiple "orbitals" than things like the position operator.
However the position operator, or velocity operator changes with the way
the
Hamiltonian is described, is there something simple general method to
calculate these?
This will obviously depend on your model; Kwant doesn't know anything about what basis your Hamiltonian is written in. In the general case you would need to calculate the matrix elements of the observable in your chosen basis. For specific cases this may not be as daunting as it sounds. e.g. for a continuum Hamiltonian discretised on a lattice the position operator is diagonal and each entry is just the position of the corresponding site.
As a return question I'd like to ask whether the documentation could be improved or if navigation and discoverability could be improved. We seem to get quite a few questions on here that are covered in the documentation, but people seem to have trouble finding it; what do you think we could do better in this regard?
Happy Kwanting,
Joe
participants (4)

Christoph Groth

Gayles, Jacob Davis

Jacob Gayles

Joseph Weston