seemps.hamiltonians.NNHamiltonian#
- class seemps.hamiltonians.NNHamiltonian#
Bases:
ABCAbstract class representing a Hamiltonian for a 1D system with nearest-neighbor interactions.
The Hamiltonian is assumed to have the structure
\[H = \sum_{i=0}^{N-2} h_{i,i+1}\]where each \(h_{i,i+1}\) is a matrix acting on two quantum subsystems. Descendents from this class must implement both the
dimension()andinteraction_term()methods.- abstractmethod dimension(i: int) int[source]#
Return the physical dimension of the i-th quantum system.
- interaction_term(i: int, t: float = 0.0) Operator[source]#
Return the Operator acting on sites i and i+1.
- to_matrix(t: float = 0.0) csr_matrix | bsr_matrix | coo_matrix[source]#
Compute the sparse matrix for this Hamiltonian at time t.
- Parameters:
- t
float,default= 0.0 Time at which the matrix is computed
- t
- Returns:
OperatorMatrix in either dense or sparse representation.
- to_mpo(t: float = 0.0, strategy: Strategy = DEFAULT_STRATEGY) MPO[source]#
Compute the matrix-product operator for this Hamiltonian at time t.
- Parameters:
- t
float,default= 0.0 Time at which the Hamiltonian is evaluated.
- strategy
Strategy Truncation strategy for MPO tensors (defaults to DEFAULT_STRATEGY)
- t
- Returns:
MPOMatrix-product operator.
- tomatrix(t: float = 0.0) Operator[source]#
Convert a Hamiltonian to matrix form (Deprecated, see
to_matrix())