seemps.hamiltonians.InteractionGraph#

class seemps.hamiltonians.InteractionGraph#

Bases: object

Proxy object to help in the construction of MPOs from local terms and arbitrary interactions.

This class allows the user to keep track of all interactions in a complex Hamiltonian, adding local terms

\[\sum_i h_i O_i\]

nearest-neighbor interactions

\[\sum_i J_i O_i O_{i+1}\]

or arbitrary long-range terms

\[\sum_{ij} J_{ij} O_i O_j\]
Parameters:
dimensionslist[int]

List of dimensions of the quantum objects involved

Attributes

size

(int) Number of quantum objects

dimensions

(list[int]) List of dimensions

dimension: int

Total dimension of the Hilbert space (if it can be computed).

add_identical_local_terms(O: Operator) None[source]#

Add a sum of local terms \(\sum_i O\).

add_interaction_term(i: int, Oi: Operator, j: int, Oj: Operator) None[source]#

Add a pair-wise interaction between sites i and j with respective operators Oi and Oj.

add_local_term(i: int, O: Operator) None[source]#

Add a single local term O acting on the i-th component.

add_long_range_interaction(J: Operator, A: Operator, B: TypeAliasForwardRef('~seemps.typing.Operator') | None = None, keep_diagonals: bool = False) None[source]#

Add a nearest-neighbor interaction sum \(\sum_{i} J_{ij} A_i B_{i+1}\).

Parameters:
JOperator

The list of weights, or a common weight \(w_i=w\) for all. Defaults to \(w_i=1\).

A, BOperator

These are the operators \(A\) and \(B\).

keep_diagonalsbool

If False, the terms \(A_iB_i\) are not included (defaults to False).

add_nearest_neighbor_interaction(A: Operator, B: Operator, weights: int | float | ndarray[tuple[int], dtype[floating]] = 1.0) None[source]#

Add a nearest-neighbor interaction sum \(\sum_{i} w_{i} A_i B_{i+1}\).

Parameters:
A, BOperator

These are the operators \(A\) and \(B\).

weightsint | float | FloatVector

The list of weights, or a common weight \(w_i=w\) for all. Defaults to \(w_i=1\).

to_matrix() csr_matrix | bsr_matrix | coo_matrix[source]#

Construct the sparse matrix associated to these interactions.

to_mpo(strategy: Strategy = DEFAULT_STRATEGY, simplify: bool = True, simplification_strategy: Strategy = DEFAULT_STRATEGY) MPO[source]#

Construct the MPO associated to these interactions.