Commit 14e2cf6c authored by Pablo Piskunow's avatar Pablo Piskunow

test for special and general cases

parent 909f1a60
......@@ -863,18 +863,20 @@ def test_dangling():
sorted(site.tag for site in syst1.sites()))
def test_dangling_with_symmetry():
length = 3
symm = kwant.TranslationalSymmetry((length, 0))
lat = kwant.lattice.square(norbs=1)
syst = kwant.Builder(symmetry=symm)
for x in range(length):
syst[lat(x, 0)] = 0
syst[lat(x, 1)] = 0
syst[lat.neighbors()] = -1
# remove neighbors of site at (lenght-1, 0), dangling across symm
del syst[lat(length - 2, 0)]
del syst[lat(length - 1, 1)]
syst.eradicate_dangling()
# lenght = 3 is the special case that gives all dangling bonds
# lenght = 4 is the standard case of dangling bonds across the symmetry
for length in [3, 4]:
symm = kwant.TranslationalSymmetry((length, 0))
lat = kwant.lattice.square(norbs=1)
syst = kwant.Builder(symmetry=symm)
for x in range(length):
syst[lat(x, 0)] = 0
syst[lat(x, 1)] = 0
syst[lat.neighbors()] = -1
# remove neighbors of site at (lenght-1, 0), dangling across symm
del syst[lat(length - 2, 0)]
del syst[lat(length - 1, 1)]
syst.eradicate_dangling()
def test_builder_with_symmetry():
g = kwant.lattice.general(ta.identity(3), norbs=1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment