seemps.hamiltonians.NNHamiltonian#

class seemps.hamiltonians.NNHamiltonian#

Bases: ABC

Abstract 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() and interaction_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.

Parameters:
iint

Index into the range [0, self.size-1)

tfloat

Time at which this interaction matrix is computed

Returns:
Operator

Some type of matrix in tensor or sparse-matrix form.

to_matrix(t: float = 0.0) csr_matrix | bsr_matrix | coo_matrix[source]#

Compute the sparse matrix for this Hamiltonian at time t.

Parameters:
tfloat, default = 0.0

Time at which the matrix is computed

Returns:
Operator

Matrix 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:
tfloat, default = 0.0

Time at which the Hamiltonian is evaluated.

strategyStrategy

Truncation strategy for MPO tensors (defaults to DEFAULT_STRATEGY)

Returns:
MPO

Matrix-product operator.

tomatrix(t: float = 0.0) Operator[source]#

Convert a Hamiltonian to matrix form (Deprecated, see to_matrix())