Skip to content
Snippets Groups Projects
Commit 9b205b5a authored by Joseph Weston's avatar Joseph Weston
Browse files

add test that defines failure modes of HoppingKinds

parent 4faf0584
No related branches found
No related tags found
No related merge requests found
...@@ -1021,6 +1021,21 @@ def test_HoppingKind(): ...@@ -1021,6 +1021,21 @@ def test_HoppingKind():
assert len({hk: 0, hk2:1, hk3: 2}) == 2 assert len({hk: 0, hk2:1, hk3: 2}) == 2
def test_invalid_HoppingKind():
g = kwant.lattice.general(ta.identity(3))
h = kwant.lattice.general(np.identity(3)[:-1]) # 2D lattice in 3D
delta = (1, 0, 0)
# families have incompatible tags
with raises(ValueError):
builder.HoppingKind(delta, g, h)
# delta is incompatible with tags
with raises(ValueError):
builder.HoppingKind(delta, h)
def test_ModesLead_and_SelfEnergyLead(): def test_ModesLead_and_SelfEnergyLead():
lat = builder.SimpleSiteFamily() lat = builder.SimpleSiteFamily()
hoppings = [builder.HoppingKind((1, 0), lat), hoppings = [builder.HoppingKind((1, 0), lat),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment