diff --git a/kwant/tests/test_builder.py b/kwant/tests/test_builder.py index fc9a052f1a586dcca6bc50d6397da0da9ef49316..46b3faeed6a81ff53ab3073da269959e40ad33d9 100644 --- a/kwant/tests/test_builder.py +++ b/kwant/tests/test_builder.py @@ -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)