Making 3D leads in a monoatomic lattice
Good day I am trying to make a simple 3D geometry; a cylinder. Now, the only tutorial available for 3D is https://kwant-project.org/doc/1.0/tutorial/tutorial6#d-example-zincblende-st... so there is a chance my problems come from that. The thing is that I cannot seem to attach any leads. The scattering region code works just fine, but when I try to attach the leads I get the error Site family <unnamed Monatomic lattice, vectors [0.0 1.0 1.0], [1.0 0.0 1.0], [1.0 1.0 0.0], origin [0.0 0.0 0.0]> does not have commensurate periods with symmetry <kwant.lattice.TranslationalSymmetry object at 0x00000000093B17F0>. The error is not completely opague of course; something seems to be problematic about the lattice vectors and the proposed symmetry. For that it is perhaps good to include the full code: def make_system(a=1, t=1.0, W=10, L=5, r2=20): lat = kwant.lattice.general([(0, a, a), (a, 0, a), (a, a, 0)]) sys = kwant.Builder() def ring(pos): (x, y,z) = pos rsq = x ** 2 + y ** 2 return rsq < r2 ** 2 and 0 <= z < L sys[lat.shape(ring, (1, 1,1))] = 4 * t sys[lat.neighbors()] = -t sym_lead = kwant.TranslationalSymmetry((0, 0,-a)) lead = kwant.Builder(sym_lead) def lead_shape(pos): (x, y,z) = pos rsq = x ** 2 + y ** 2 return rsq < r2 ** 2 lead[lat.shape(lead_shape, (0, 0,0))] = 4 * t lead[lat.neighbors()] = -t sys.attach_lead(lead) sys.attach_lead(lead.reversed()) return sys I personally do not see what is wrong with this, especially as the scattering region looks fine without the leads. According to the error there is something wrong with the lattice vectors themselves? Should I change them in some way? I don't care about any particular structure here really, I am just looking for the 3D equivalent of the square lattice and according to the source code that is defined as def square(a=1, name=''): """Make a square lattice.""" return Monatomic(((a, 0), (0, a)), name=name) so I figured my definition should work for 3D. Could someone point out the obvious mistake I am making?
Dear John, I believe the error message is quite accurate here: (0, 0, a) is not a lattice vector, and therefore your lattice may not have such a translational symmetry. If you double the period of the lead symmetry, the lead creation should work. Best, Anton On Thu, Apr 13, 2017, 16:57 John Eaves <johneaves02@gmail.com> wrote:
Good day
I am trying to make a simple 3D geometry; a cylinder. Now, the only tutorial available for 3D is https://kwant-project.org/doc/1.0/tutorial/tutorial6#d-example-zincblende-st... so there is a chance my problems come from that.
The thing is that I cannot seem to attach any leads. The scattering region code works just fine, but when I try to attach the leads I get the error
Site family <unnamed Monatomic lattice, vectors [0.0 1.0 1.0], [1.0 0.0 1.0], [1.0 1.0 0.0], origin [0.0 0.0 0.0]> does not have commensurate periods with symmetry <kwant.lattice.TranslationalSymmetry object at 0x00000000093B17F0>. The error is not completely opague of course; something seems to be problematic about the lattice vectors and the proposed symmetry. For that it is perhaps good to include the full code:
def make_system(a=1, t=1.0, W=10, L=5, r2=20): lat = kwant.lattice.general([(0, a, a), (a, 0, a), (a, a, 0)]) sys = kwant.Builder()
def ring(pos): (x, y,z) = pos rsq = x ** 2 + y ** 2 return rsq < r2 ** 2 and 0 <= z < L
sys[lat.shape(ring, (1, 1,1))] = 4 * t sys[lat.neighbors()] = -t
sym_lead = kwant.TranslationalSymmetry((0, 0,-a)) lead = kwant.Builder(sym_lead)
def lead_shape(pos): (x, y,z) = pos rsq = x ** 2 + y ** 2 return rsq < r2 ** 2
lead[lat.shape(lead_shape, (0, 0,0))] = 4 * t lead[lat.neighbors()] = -t
sys.attach_lead(lead) sys.attach_lead(lead.reversed())
return sys
I personally do not see what is wrong with this, especially as the scattering region looks fine without the leads. According to the error there is something wrong with the lattice vectors themselves? Should I change them in some way? I don't care about any particular structure here really, I am just looking for the 3D equivalent of the square lattice and according to the source code that is defined as
def square(a=1, name=''): """Make a square lattice.""" return Monatomic(((a, 0), (0, a)), name=name)
so I figured my definition should work for 3D.
Could someone point out the obvious mistake I am making?
Hi,
The error is not completely opague of course; something seems to be problematic about the lattice vectors and the proposed symmetry.
Indeed, the lattice and the symmetry you defined are not compatible:
lat = kwant.lattice.general([(0, a, a), (a, 0, a), (a, a, 0)]) ... sym_lead = kwant.TranslationalSymmetry((0, 0, -a))
Your lattice vectors are each of length 'a * sqrt(2)' and are pointing at 45 degree angles to the coordinate axes. The translational symmetry you declare is in the -z direction with period 'a'. These are not commensurate because the symmetry vector cannot be expressed as a linear combination of the lattice vectors with integer coefficients. In order to correct this you will need to declare a symmetry in the z direction with period '2*a', as this is a linear combination of the lattice vectors with integer coefficients (explicitly v1 + v2 - v3).
I don't care about any particular structure here really, I am just looking for the 3D equivalent of the square lattice.
By "3D equivalent of a square lattice" do you perhaps mean a cubic lattice? If so then the lattice vectors should all be orthogonal. A reasonable choice would be to have the lattice vectors pointing along the x, y, and z directions: lat = kwant.lattice.general([(a, 0, 0), (0, a, 0), (0, 0, a)]) In this case the symmetry definition you have will work because the symmetry vector is an integer linear combination of lattice vectors (it's just -v3). Happy Kwanting, Joe
participants (3)
-
Anton Akhmerov
-
John Eaves
-
Joseph Weston