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

make tests nicer

parent 1470558c
Branches
Tags
No related merge requests found
......@@ -74,10 +74,8 @@ def test_error_minus_9(r=10):
sys = Builder()
sys[graphene.shape(circle, (0,0))] = -0.0001
for kind in (HoppingKind((0, 0), b, a),
HoppingKind((0, 1), b, a),
HoppingKind((-1, 1), b, a)):
sys[kind] = - 1
for kind in [((0, 0), b, a), ((0, 1), b, a), ((-1, 1), b, a)]:
sys[HoppingKind(*kind)] = - 1
ham = sys.finalized().hamiltonian_submatrix(sparse=True)
......
......@@ -49,9 +49,8 @@ def sys_2d(W=3, r1=3, r2=8):
def sys_3d(W=3, r1=2, r2=4, a=1, t=1.0):
lat = kwant.lattice.general(((a, 0, 0), (0, a, 0), (0, 0, a)))
lat.nearest = [kwant.builder.HoppingKind((1, 0, 0), lat),
kwant.builder.HoppingKind((0, 1, 0), lat),
kwant.builder.HoppingKind((0, 0, 1), lat)]
lat.nearest = [kwant.builder.HoppingKind(*kind) for kind in
[((1, 0, 0), lat), ((0, 1, 0), lat), ((0, 0, 1), lat)]]
sys = kwant.Builder()
def ring(pos):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment