Browse code

update test that vectorization requires norbs to test infinite systems

Joseph Weston authored on 22/11/2019 10:54:17
Showing 1 changed files
... ...
@@ -740,15 +740,19 @@ def test_vectorized_hamiltonian_evaluation():
740 740
     )
741 741
 
742 742
 
743
-def test_vectorized_requires_norbs():
743
+@pytest.mark.parametrize("sym", [
744
+    builder.NoSymmetry(),
745
+    kwant.TranslationalSymmetry([-1]),
746
+])
747
+def test_vectorized_requires_norbs(sym):
744 748
 
745 749
     # Catch deprecation warning for lack of norbs
746 750
     with warnings.catch_warnings():
747 751
         warnings.simplefilter("ignore")
748
-        fam = builder.SimpleSiteFamily()
752
+        lat = kwant.lattice.chain()
749 753
 
750
-    syst = builder.Builder(vectorize=True)
751
-    syst[fam(0, 0)] = 1
754
+    syst = builder.Builder(sym, vectorize=True)
755
+    syst[lat(0)] = 1
752 756
 
753 757
     raises(ValueError, syst.finalized)
754 758