Dear all,
I am having a problem defining a system which matches what I want.
I start by defining a rectangular graphene lattice of size 0<=x<L in the x direction and 0<=x<W in the y direction. (By "rectangular" I mean in the real space coordinates, not the crystallographic coordinates.)
I want to attach a lead to the lefthad end of this rectangle, going to minus infinity. Therefore, I define a lead with translational symmetry (1,0) and the appropriate hopping. I attach the lead and plot the system.
When I plot the system, I find that the lead has been attached along the (0,1) crystallographic direction (so, that is along the (1/2, sqrt(3)/3) real space vector). A triangle of extra sites have been added for x<0 (real space) so that the total shape of the scattering region is now not rectangular.
If I attach another lead with lead.reversed(), a similar thing happens on the right of the sample so that my scattering region is now a parallelogram.
As I understand it, this should not affect the physics in any way, since the lead is semiinfinite. But, if I want to draw pictures, plot functions over the scattering region, and gain physical understanding, it is a bit of a pain. So, my question is whether there is any way to make the lead attach along the (0,1) real space direction (which is the same as the (1,2) crystallographic direction) and yet maintain the (1,0) translational symmetry?
If you require a sample program which reproduces this behavior then I can easily provide that, but I thought I should not extend an already long post unnecessarily.
Thanks in advance.
David
Dear David,
Currently a Kwant symmetry stores the extra directions that describe how it handle various lattices. If you don't do anything, the choice of the extra directions happens automatically, and a Bravais lattice vector is chosen. However you can manually override this by using the add_site_family method of the TranslationalSymmetry (see http://kwantproject.org/doc/1.0/reference/generated/kwant.lattice.Translati... for details). I know several people have used this to solve exactly the problem that you currently encounter.
Best, Anton
On Thu, Oct 23, 2014 at 4:40 PM, David Abergel david.abergel@nordita.org wrote:
Dear all,
I am having a problem defining a system which matches what I want.
I start by defining a rectangular graphene lattice of size 0<=x<L in the x direction and 0<=x<W in the y direction. (By "rectangular" I mean in the real space coordinates, not the crystallographic coordinates.)
I want to attach a lead to the lefthad end of this rectangle, going to minus infinity. Therefore, I define a lead with translational symmetry (1,0) and the appropriate hopping. I attach the lead and plot the system.
When I plot the system, I find that the lead has been attached along the (0,1) crystallographic direction (so, that is along the (1/2, sqrt(3)/3) real space vector). A triangle of extra sites have been added for x<0 (real space) so that the total shape of the scattering region is now not rectangular.
If I attach another lead with lead.reversed(), a similar thing happens on the right of the sample so that my scattering region is now a parallelogram.
As I understand it, this should not affect the physics in any way, since the lead is semiinfinite. But, if I want to draw pictures, plot functions over the scattering region, and gain physical understanding, it is a bit of a pain. So, my question is whether there is any way to make the lead attach along the (0,1) real space direction (which is the same as the (1,2) crystallographic direction) and yet maintain the (1,0) translational symmetry?
If you require a sample program which reproduces this behavior then I can easily provide that, but I thought I should not extend an already long post unnecessarily.
Thanks in advance.
David
Dear Anton,
thanks very much for your answer to my question.
I actually found a slightly different solution, which I shall document here in case it helps anyone else in the future.
My idea is to define a different unit cell for the graphene lattice which allows lattice vectors to be defined in the x and y real space directions. So, instead of using the standard graphene unit cell (which I shall denote with a symbol  which is supposed to indicate the bond joining the two carbon atoms) I used a unit cell that looks like _/ which joins four carbon atoms in a short chain. Repeating this unit cell will generate a graphene flake with armchair edges along the horizontal direction, and zigzag edges along the vertical direction.
If a is the length of the lattice vector of the original (twoatom) unit cell, then the lattice vectors of the new unit cell are: (sqrt(3)*a,0), and (0,a).
The positions of the four atoms within the unit cell are: (0,a/2), (a/(2*sqrt(3), 0), (sqrt(3)*a/2, 0), and (2*a/sqrt(3),a/2).
This can be easily defined using the kwant.lattice.general() method as shown in the examples in the documentation. When leads are attached to the left and right ends (with translational symmetry (±sqrt(3)*a,0)) of a rectangular scattering region formed in this way, they do so in the vertical direction, as desired.
Hope that helps.
David
On 23/10/14 19:47, Anton Akhmerov wrote:
Dear David,
Currently a Kwant symmetry stores the extra directions that describe how it handle various lattices. If you don't do anything, the choice of the extra directions happens automatically, and a Bravais lattice vector is chosen. However you can manually override this by using the add_site_family method of the TranslationalSymmetry (see http://kwantproject.org/doc/1.0/reference/generated/kwant.lattice.Translati... for details). I know several people have used this to solve exactly the problem that you currently encounter.
Best, Anton
On Thu, Oct 23, 2014 at 4:40 PM, David Abergel david.abergel@nordita.org wrote:
Dear all,
I am having a problem defining a system which matches what I want.
I start by defining a rectangular graphene lattice of size 0<=x<L in the x direction and 0<=x<W in the y direction. (By "rectangular" I mean in the real space coordinates, not the crystallographic coordinates.)
I want to attach a lead to the lefthad end of this rectangle, going to minus infinity. Therefore, I define a lead with translational symmetry (1,0) and the appropriate hopping. I attach the lead and plot the system.
When I plot the system, I find that the lead has been attached along the (0,1) crystallographic direction (so, that is along the (1/2, sqrt(3)/3) real space vector). A triangle of extra sites have been added for x<0 (real space) so that the total shape of the scattering region is now not rectangular.
If I attach another lead with lead.reversed(), a similar thing happens on the right of the sample so that my scattering region is now a parallelogram.
As I understand it, this should not affect the physics in any way, since the lead is semiinfinite. But, if I want to draw pictures, plot functions over the scattering region, and gain physical understanding, it is a bit of a pain. So, my question is whether there is any way to make the lead attach along the (0,1) real space direction (which is the same as the (1,2) crystallographic direction) and yet maintain the (1,0) translational symmetry?
If you require a sample program which reproduces this behavior then I can easily provide that, but I thought I should not extend an already long post unnecessarily.
Thanks in advance.
David
Hi, I would like to seek clarification regarding a few things about your proposed solution:
My idea is to define a different unit cell for the graphene lattice which allows lattice vectors to be defined in the x and y real space directions. So, instead of using the standard graphene unit cell (which I shall denote with a symbol  which is supposed to indicate the bond joining the two carbon atoms) I used a unit cell that looks like _/ which joins four carbon atoms in a short chain. Repeating this unit cell will generate a graphene flake with armchair edges along the horizontal direction, and zigzag edges along the vertical direction.
If I have understood correctly you have essentially rotated the lattice by a right angle. If this is the case, and if you have attached leads on the left and right as you say then you are no longer simulating the same system as before, surely? Before, the horizontal edges were zigzag and now they are armchair.
As I understand it the transport properties of graphene nanoribbons with armchair or zigzag edges are fundamentally different, so will this not affect any quantities calculated?
I would be interested to see a concrete example using the technique that Anton proposed.
Joseph
On 10/25/14 08:15, David Abergel wrote:
Dear Anton,
thanks very much for your answer to my question.
I actually found a slightly different solution, which I shall document here in case it helps anyone else in the future.
My idea is to define a different unit cell for the graphene lattice which allows lattice vectors to be defined in the x and y real space directions. So, instead of using the standard graphene unit cell (which I shall denote with a symbol  which is supposed to indicate the bond joining the two carbon atoms) I used a unit cell that looks like _/ which joins four carbon atoms in a short chain. Repeating this unit cell will generate a graphene flake with armchair edges along the horizontal direction, and zigzag edges along the vertical direction.
If a is the length of the lattice vector of the original (twoatom) unit cell, then the lattice vectors of the new unit cell are: (sqrt(3)*a,0), and (0,a).
The positions of the four atoms within the unit cell are: (0,a/2), (a/(2*sqrt(3), 0), (sqrt(3)*a/2, 0), and (2*a/sqrt(3),a/2).
This can be easily defined using the kwant.lattice.general() method as shown in the examples in the documentation. When leads are attached to the left and right ends (with translational symmetry (±sqrt(3)*a,0)) of a rectangular scattering region formed in this way, they do so in the vertical direction, as desired.
Hope that helps.
David
On 23/10/14 19:47, Anton Akhmerov wrote:
Dear David,
Currently a Kwant symmetry stores the extra directions that describe how it handle various lattices. If you don't do anything, the choice of the extra directions happens automatically, and a Bravais lattice vector is chosen. However you can manually override this by using the add_site_family method of the TranslationalSymmetry (see http://kwantproject.org/doc/1.0/reference/generated/kwant.lattice.Translati...
for details). I know several people have used this to solve exactly the problem that you currently encounter.
Best, Anton
On Thu, Oct 23, 2014 at 4:40 PM, David Abergel david.abergel@nordita.org wrote:
Dear all,
I am having a problem defining a system which matches what I want.
I start by defining a rectangular graphene lattice of size 0<=x<L in the x direction and 0<=x<W in the y direction. (By "rectangular" I mean in the real space coordinates, not the crystallographic coordinates.)
I want to attach a lead to the lefthad end of this rectangle, going to minus infinity. Therefore, I define a lead with translational symmetry (1,0) and the appropriate hopping. I attach the lead and plot the system.
When I plot the system, I find that the lead has been attached along the (0,1) crystallographic direction (so, that is along the (1/2, sqrt(3)/3) real space vector). A triangle of extra sites have been added for x<0 (real space) so that the total shape of the scattering region is now not rectangular.
If I attach another lead with lead.reversed(), a similar thing happens on the right of the sample so that my scattering region is now a parallelogram.
As I understand it, this should not affect the physics in any way, since the lead is semiinfinite. But, if I want to draw pictures, plot functions over the scattering region, and gain physical understanding, it is a bit of a pain. So, my question is whether there is any way to make the lead attach along the (0,1) real space direction (which is the same as the (1,2) crystallographic direction) and yet maintain the (1,0) translational symmetry?
If you require a sample program which reproduces this behavior then I can easily provide that, but I thought I should not extend an already long post unnecessarily.
Thanks in advance.
David
 David Abergel Nordita david.abergel@nordita.org @David_Abergel
Hi,
two things:  My understanding is that the previous poster indeed seems to have rotated the lattice, but this is not the essential part of his solution. The essential part was that he doubled the unit cell, so that graphene effectively got a rectangular lattice (with 4 basis atoms). This works for leads in x and ydirection well.  A more general solution is to do what Anton proposed. I include a sample script below.
Best,
Michael
import kwant import matplotlib.pyplot as plt
lat = kwant.lattice.honeycomb() sys = kwant.Builder()
def rectangle(pos): x, y = pos return 0 < x < 20 and 0 < y < 30
sys[lat.shape(rectangle, (1, 1))] = 0 sys[lat.neighbors()] = 1
sym = kwant.TranslationalSymmetry((1, 0))
# We specify a specific fundamental domain/unit cell for the # translational symmetry: with other_vecs we add a second # (linear independent) lattice vector that complements the # translational vector above. Both vectors then form a basis. # # Note:  other_vecs must be lattice vectors, i.e. integer vectors. # Also, it only holds for the one (sub)lattice specified in # add_site_family. #  in contrast, kwant.TranslationalSymmetry takes a # realspace vector. This is because it could hold for different # lattices (which have different basis vectors). This realspace # vector is converted internally to a lattice vector for each # lattice. sym.add_site_family(lat.sublattices[0], other_vectors=[(1, 2)]) sym.add_site_family(lat.sublattices[1], other_vectors=[(1, 2)])
lead = kwant.Builder(sym)
def lead_shape(pos): x, y = pos return 0 < y < 30
lead[lat.shape(lead_shape, (1,1))] = 0 lead[lat.neighbors()] = 1
sys.attach_lead(lead) sys.attach_lead(lead.reversed())
kwant.plot(sys);
On 25.10.2014 21:51, Joseph Weston wrote:
Hi, I would like to seek clarification regarding a few things about your proposed solution:
My idea is to define a different unit cell for the graphene lattice which allows lattice vectors to be defined in the x and y real space directions. So, instead of using the standard graphene unit cell (which I shall denote with a symbol  which is supposed to indicate the bond joining the two carbon atoms) I used a unit cell that looks like _/ which joins four carbon atoms in a short chain. Repeating this unit cell will generate a graphene flake with armchair edges along the horizontal direction, and zigzag edges along the vertical direction.
If I have understood correctly you have essentially rotated the lattice by a right angle. If this is the case, and if you have attached leads on the left and right as you say then you are no longer simulating the same system as before, surely? Before, the horizontal edges were zigzag and now they are armchair.
As I understand it the transport properties of graphene nanoribbons with armchair or zigzag edges are fundamentally different, so will this not affect any quantities calculated?
I would be interested to see a concrete example using the technique that Anton proposed.
Joseph
On 10/25/14 08:15, David Abergel wrote:
Dear Anton,
thanks very much for your answer to my question.
I actually found a slightly different solution, which I shall document here in case it helps anyone else in the future.
My idea is to define a different unit cell for the graphene lattice which allows lattice vectors to be defined in the x and y real space directions. So, instead of using the standard graphene unit cell (which I shall denote with a symbol  which is supposed to indicate the bond joining the two carbon atoms) I used a unit cell that looks like _/ which joins four carbon atoms in a short chain. Repeating this unit cell will generate a graphene flake with armchair edges along the horizontal direction, and zigzag edges along the vertical direction.
If a is the length of the lattice vector of the original (twoatom) unit cell, then the lattice vectors of the new unit cell are: (sqrt(3)*a,0), and (0,a).
The positions of the four atoms within the unit cell are: (0,a/2), (a/(2*sqrt(3), 0), (sqrt(3)*a/2, 0), and (2*a/sqrt(3),a/2).
This can be easily defined using the kwant.lattice.general() method as shown in the examples in the documentation. When leads are attached to the left and right ends (with translational symmetry (±sqrt(3)*a,0)) of a rectangular scattering region formed in this way, they do so in the vertical direction, as desired.
Hope that helps.
David
On 23/10/14 19:47, Anton Akhmerov wrote:
Dear David,
Currently a Kwant symmetry stores the extra directions that describe how it handle various lattices. If you don't do anything, the choice of the extra directions happens automatically, and a Bravais lattice vector is chosen. However you can manually override this by using the add_site_family method of the TranslationalSymmetry (see http://kwantproject.org/doc/1.0/reference/generated/kwant.lattice.Translati...
for details). I know several people have used this to solve exactly the problem that you currently encounter.
Best, Anton
On Thu, Oct 23, 2014 at 4:40 PM, David Abergel david.abergel@nordita.org wrote:
Dear all,
I am having a problem defining a system which matches what I want.
I start by defining a rectangular graphene lattice of size 0<=x<L in the x direction and 0<=x<W in the y direction. (By "rectangular" I mean in the real space coordinates, not the crystallographic coordinates.)
I want to attach a lead to the lefthad end of this rectangle, going to minus infinity. Therefore, I define a lead with translational symmetry (1,0) and the appropriate hopping. I attach the lead and plot the system.
When I plot the system, I find that the lead has been attached along the (0,1) crystallographic direction (so, that is along the (1/2, sqrt(3)/3) real space vector). A triangle of extra sites have been added for x<0 (real space) so that the total shape of the scattering region is now not rectangular.
If I attach another lead with lead.reversed(), a similar thing happens on the right of the sample so that my scattering region is now a parallelogram.
As I understand it, this should not affect the physics in any way, since the lead is semiinfinite. But, if I want to draw pictures, plot functions over the scattering region, and gain physical understanding, it is a bit of a pain. So, my question is whether there is any way to make the lead attach along the (0,1) real space direction (which is the same as the (1,2) crystallographic direction) and yet maintain the (1,0) translational symmetry?
If you require a sample program which reproduces this behavior then I can easily provide that, but I thought I should not extend an already long post unnecessarily.
Thanks in advance.
David
 David Abergel Nordita david.abergel@nordita.org @David_Abergel
Hi again,
 A more general solution is to do what Anton proposed. I include a sample script below.
sym.add_site_family(lat.sublattices[0], other_vectors=[(1, 2)]) sym.add_site_family(lat.sublattices[1], other_vectors=[(1, 2)])
Thanks for this. I had tried do do the following:
sym.add_site_family(lat, other_vectors=[(1, 2)])
instead of calling `add_site_family` for each sublattice, and it did not work. I therefore thought that my understanding was flawed, but it seems that for a polyatomic lattice one has to manually add each sublattice. Maybe a word in the documentation would be useful to prevent this potential pitfall
Joe
Joseph Weston wrote:
 A more general solution is to do what Anton proposed. I
include a sample script below.
sym.add_site_family(lat.sublattices[0], other_vectors=[(1, 2)]) sym.add_site_family(lat.sublattices[1], other_vectors=[(1, 2)])
Thanks for this. I had tried do do the following:
sym.add_site_family(lat, other_vectors=[(1, 2)])
instead of calling `add_site_family` for each sublattice, and it did not work. I therefore thought that my understanding was flawed, but it seems that for a polyatomic lattice one has to manually add each sublattice. Maybe a word in the documentation would be useful to prevent this potential pitfall
Thanks for brining up this issue, this is certainly one aspect of Kwant that could (and will) be improved in the future.
Even though add_site_family is part of the public API, it is something of a secondclass citizen. It was not meant to be used commonly. Only after publishing Kwant 1.0 we realized that add_site_family can be actually useful for choosing the orientation of lead unit cells.
In fact, “add_site_family” should be have been named “add_lattice”, as it does not work for general site families but only for instances of kwant.lattice.Monatomic. It could also accept kwant.lattice.Polyatomic instances as you suggest.
Fixing all this in a backwardscompatible way would be messy and confusing. I’ve made a note about this issue for the next major version of Kwant. For now, I recommend using what has been suggested above, i.e.:
for sl in lat.sublattices: sym.add_site_family(sl, other_vectors=[(1, 2)])
Christoph
Joseph Weston <joseph.weston08 <at> gmail.com> writes:
If I have understood correctly you have essentially rotated the lattice by a right angle. If this is the case, and if you have attached leads on the left and right as you say then you are no longer simulating the same system as before, surely? Before, the horizontal edges were zigzag and now they are armchair.
As I understand it the transport properties of graphene nanoribbons with armchair or zigzag edges are fundamentally different, so will this not affect any quantities calculated?
Joseph, of course you are quite correct. In my reply I denoted the expanded unit cell by _/ simply because it would fit on one line whereas the other orientation \  / would not. You are absolutely right about the changes in transport if the leads are attached on the zigzag edges instead of the armchair ones.
And thank you Michael for posting the example using add_site_family(). That is most helpful.
All the best.
David
participants (6)

Anton Akhmerov

christoph.groth＠cea.fr

David Abergel

Joseph Weston

Joseph Weston

Michael Wimmer