I’ve found a bug in add_site_family(), the input for other_vectors should be a list, but I used a tulpe, the error message I got is not correct.
Code:
lat = kwant.lattice.general([(1, 0), (sin_30, cos_30)],
[(0, 0), (0, 1 / sqrt(3))])
a, b = lat.sublattices
sym_lead = kwant.TranslationalSymmetry(lat.vec((1, 0)))
sym_lead.add_site_family(a, other_vectors=(1, -2))
Error message:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-73-c9cfa5f61ce2> in <module>()
4 sym_lead = kwant.TranslationalSymmetry(lat.vec((1, 0)))
5
----> 6 sym_lead.add_site_family(a, other_vectors=(1, -2))
/usr/local/lib/python2.7/site-packages/kwant/lattice.pyc in add_site_family(self, fam, other_vectors)
572
573 if np.linalg.matrix_rank(m) < num_vec:
--> 574 raise ValueError('other_vectors and symmetry periods are not '
575 'linearly independent.')
576
ValueError: other_vectors and symmetry periods are not linearly independent.