`kwant.operator` produces cryptic error messages when `norbs` is supplied incorrectly
It raises a ValueError
and complains about some truth comparisons not being valid for array types (use np.all or np.any
and all that).
There are checks in operator
for this error condition, as far as I remember, but clearly they are not reached before this error.
This is a simple fix -- just check the length of any input vectors against the declared number of orbitals (obtained from syst.site_ranges
)