Commit 404dad92 authored by Joseph Weston's avatar Joseph Weston
Browse files

remove an unecessary source of randomness from one of the tests

parent 2a9a4ffb
...@@ -366,8 +366,8 @@ def test_consistency_kwant(): ...@@ -366,8 +366,8 @@ def test_consistency_kwant():
np.exp(1j*k)*model_kwant_hop.T.conj()) # As in kwant.Bands np.exp(1j*k)*model_kwant_hop.T.conj()) # As in kwant.Bands
h_model = Ham.lambdify() h_model = Ham.lambdify()
wsyst = kwant.wraparound.wraparound(model_syst).finalized() wsyst = kwant.wraparound.wraparound(model_syst).finalized()
for _ in range(20): ks = np.linspace(-np.pi, np.pi, 21)
k = (np.random.rand() - 0.5)*2*np.pi for k in ks:
assert allclose(h_model_kwant(k), h_model(coeffs[0], coeffs[1], k)) assert allclose(h_model_kwant(k), h_model(coeffs[0], coeffs[1], k))
params['k_x'] = k params['k_x'] = k
h_wrap = wsyst.hamiltonian_submatrix(params=params) h_wrap = wsyst.hamiltonian_submatrix(params=params)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment