commutative momentum operators are ignored by discretizer
If hamiltonian
is provided in form of sympy
expression and momentum operator is defined as commutative it is ignored.
Compare
H = sympy.Symbol('k_x', commutative=False)**2
kwant.continuum.discretize(H, discrete_coordinates='xy', verbose=True)
with
H = sympy.Symbol('k_x', commutative=True)**2
kwant.continuum.discretize(H, discrete_coordinates='xy', verbose=True)