seemps.operators.MPOSum#

class seemps.operators.MPOSum#

Bases: object

Object representing a linear combination of matrix-product opeators.

Parameters:
mposlist[MPO | MPOList]

The operators to combine

weightsVectorLike | None

An optional sequence of weights to apply

strategyStrategy

Truncation strategy when applying the MPO’s.

property T: MPOSum#

Return the transpose of this operator.

apply(state: TypeAliasForwardRef('~seemps.state.MPS') | TypeAliasForwardRef('~seemps.state.MPSSum'), strategy: TypeAliasForwardRef('~seemps.state.Strategy') | None = None, simplify: bool | None = None)[source]#

Implement multiplication A @ state between an MPOSum ‘A’ and a Matrix Product State ‘state’.

conj() MPOSum[source]#

Return the complex conjugate of this operator.

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) MPOSum[source]#

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

Parameters:
Lint

The new size for all MPOs.

dimensionsint | list[int]

If it is an integer, it is the dimension of the new sites. If it is a list, it is the dimension of all sites.

siteslist[int]

Where to place the tensors of the original MPO.

Returns:
MPOSum

The extended operator.

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

Create an MPO by combining all tensors from all states in the linear combination.

Returns:
MPS | CanonicalMPS

Quantum state approximating this sum.

physical_dimensions() list[int][source]#

Return the physical dimensions of the MPO.

reverse() MPOSum[source]#

Reverse the sites (see reverse()).

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

Return MPOSum with the given strategy.

to_matrix() DenseOperator[source]#

Return the matrix representation of this MPO.

tomatrix() DenseOperator[source]#

Return the matrix representation of this MPO (Deprecated, see to_matrix()).