seemps.operators.MPOList#

class seemps.operators.MPOList#

Bases: object

Sequence of matrix-product operators.

This implements a list of MPOs that are applied sequentially. It can impose its own truncation or simplification strategy on top of the one provided by the individual operators.

Parameters:
mposlist[MPO]

Operators in this sequence, to be applied from mpos[0] to mpos[-1]. Must contain at least one operator.

strategyStrategy, optional

Truncation and simplification strategy, defaults to DEFAULT_STRATEGY

Attributes

mpos

(list[MPO]) Operators in this sequence, to be applied from mpos[0] to mpos[-1]. Must contain at least one operator.

strategy

(Strategy) Truncation and simplification strategy.

size

(int) Number of quantum subsystems in each MPO. Computed from the supplied MPOs. Not checked for consistency.

property T: MPOList#

Return the transpose of this operator.

apply(state: MPS, strategy: Strategy | None = None, simplify: bool | None = None) MPS[source]#
apply(state: MPSSum, strategy: Strategy | None = None, simplify: bool | None = None) MPS | MPSSum

Implement multiplication A @ state between a matrix-product operator A and a matrix-product state state.

Parameters:
stateMPS | MPSSum

Transformed state.

strategyStrategy, optional

Truncation strategy, defaults to DEFAULT_STRATEGY

simplifybool, optional

Whether to simplify the state after the contraction. Defaults to strategy.get_simplify_flag()

Returns:
CanonicalMPS

The result of the contraction.

conj() MPOList[source]#

Return the complex conjugate of this operator.

copy() MPOList[source]#

Shallow copy of the MPOList, without copying the MPOs themselves.

dimensions() list[int][source]#

Return the physical dimensions (Deprecated, see dimensions()).

expectation(bra: MPS, ket: TypeAliasForwardRef('~seemps.state.MPS') | None = None) Weight[source]#

Expectation value of MPOList on one or two MPS states.

If one state is given, this state is interpreted as \(\psi\) and this function computes \(\langle{\psi|O\psi}\rangle\) If two states are given, the first one is the bra \(\psi\), the second one is the ket \(\phi\), and this computes \(\langle\psi|O|\phi\rangle\).

Parameters:
braMPS

The state \(\psi\) on which the expectation value is computed.

ketMPS | None

The ket component of the expectation value. Defaults to bra.

Returns:
float | complex

\(\langle\psi\vert{O}\vert\phi\rangle\) where O is the matrix-product operator.

extend(L: int, sites: list[int] | None = None, dimensions: int | list[int] = 2) MPOList[source]#

Enlarge an MPOList so that it acts on a larger Hilbert space with ‘L’ sites.

See also

MPO.extend()
join(strategy: TypeAliasForwardRef('~seemps.state.Strategy') | None = None) MPO[source]#

Create an MPO by combining all tensors from all MPOs.

Returns:
MPO

Quantum operator implementing the product of tensors.

physical_dimensions() list[int][source]#

Return the physical dimensions of the MPOList (Deprecated, see dimensions()).

reverse() MPOList[source]#

Reverse the sites (see reverse()).

set_strategy(strategy: Strategy, strategy_components: TypeAliasForwardRef('~seemps.state.Strategy') | None = None) MPOList[source]#

Return MPOList with the given strategy.

to_matrix() DenseOperator[source]#

Convert this MPO to a dense or sparse matrix.

tomatrix() DenseOperator[source]#

Convert this MPO to a dense or sparse matrix (Deprecated, see to_matrix()).