diff --git a/kwant/qsymm.py b/kwant/qsymm.py index 728dd2b738373eff85099e073e75b5fb5bb9c802..fef2fd6438bd7028ad7dd22f3eaecf65dc2f300d 100644 --- a/kwant/qsymm.py +++ b/kwant/qsymm.py @@ -68,8 +68,8 @@ def builder_to_model(syst, momenta=None, real_space=True, is used in finalized kwant systems. """ def term_to_model(d, par, matrix): - if np.allclose(matrix, 0): - result = BlochModel({}) + if allclose(matrix, 0): + result = BlochModel({}, shape=matrix.shape, format=np.ndarray) else: result = BlochModel({BlochCoeff(d, qsymm.sympify(par)): matrix}, momenta=momenta)