Skip to content
Snippets Groups Projects
Commit f728597c authored by Christoph Groth's avatar Christoph Groth
Browse files

add (failing) test for zero-valued selfenergy leads

That test fails because the result of the selfenergy callback is used as a
numpy array without a call to asarray.
parent b7dc344c
No related branches found
No related tags found
No related merge requests found
......@@ -1085,6 +1085,15 @@ def test_ModesLead_and_SelfEnergyLead():
ts2 = [kwant.greens_function(fsyst, e).transmission(1, 0) for e in energies]
assert_almost_equal(ts2, ts)
# Append a virtual (=zero self energy) lead. This should have no effect.
# Also verifies that the selfenergy callback function can return exotic
# arraylikes.
syst.leads.append(builder.SelfEnergyLead(
lambda *args: list(ta.zeros((L, L))), interface))
fsyst = syst.finalized()
ts2 = [kwant.greens_function(fsyst, e).transmission(1, 0) for e in energies]
assert_almost_equal(ts2, ts)
def test_site_pickle():
site = kwant.lattice.square()(0, 0)
......
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