get_scipy_sparse_Hamiltonian

tenpy.algorithms.exact_diag.get_scipy_sparse_Hamiltonian(model, undo_sort_charge: bool = True)[source]

Get the Hamiltonian as a sparse scipy matrix.

Parameters:
  • model – The model that defines the Hamiltonian. The lattice should be finite.

  • undo_sort_charge (bool) – If we should undo the basis permutation induced by sort_charge().

Returns:

H – The Hamiltonian as a scipy CSR sparse matrix. Basis order is like for a Kronecker product numpy.kron() of the local basis order, see undo_sort_charge.

Return type:

CSR matrix