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

remove erroneous lead from test system

The lead does not have connected unit cells and serves no purpose.
We also remove the check for the number of 'collections' in the
resulting plots, as now both 'syst_2d' and 'syst_3d' produce
systems with 2 leads.
parent 533442e1
No related branches found
No related tags found
No related merge requests found
......@@ -71,13 +71,10 @@ def syst_2d(W=3, r1=3, r2=8):
syst[lat.neighbors()] = -t
sym_lead0 = kwant.TranslationalSymmetry(lat.vec((-1, 0)))
lead0 = kwant.Builder(sym_lead0)
lead2 = kwant.Builder(sym_lead0)
lead_shape = lambda pos: (-W / 2 < pos[1] < W / 2)
lead0[lat.shape(lead_shape, (0, 0))] = 4 * t
lead2[lat.shape(lead_shape, (0, 0))] = 4 * t
syst.attach_lead(lead2)
lead0[lat.neighbors()] = - t
lead1 = lead0.reversed()
syst.attach_lead(lead0)
......@@ -123,8 +120,7 @@ def test_plot():
if (color != 'k' and
isinstance(color(next(iter(syst2d.sites()))), float)):
assert fig.axes[0].collections[0].get_array() is not None
assert len(fig.axes[0].collections) == (8 if syst is syst2d else
6)
assert len(fig.axes[0].collections) == 6
color_opts = ['k', (lambda site, site2: site.tag[0]),
lambda site, site2: (abs(site.tag[0] / 100),
abs(site.tag[1] / 100), 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