get_numpy_Hamiltonian

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

Get the Hamiltonian as a matrix (2D numpy array).

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

  • from_mpo (bool) – If we should prioritize using the MPO over H_bond to build the Hamiltonian.

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

Returns:

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

Return type:

2D array