seemps.operators.MPOList#
- class seemps.operators.MPOList#
Bases:
objectSequence 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:
- mpos
list[MPO] Operators in this sequence, to be applied from mpos[0] to mpos[-1]. Must contain at least one operator.
- strategy
Strategy,optional Truncation and simplification strategy, defaults to DEFAULT_STRATEGY
- mpos
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.
- 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:
- state
MPS|MPSSum Transformed state.
- strategy
Strategy,optional Truncation strategy, defaults to DEFAULT_STRATEGY
- simplifybool,
optional Whether to simplify the state after the contraction. Defaults to strategy.get_simplify_flag()
- state
- Returns:
CanonicalMPSThe result of the contraction.
- 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\).
- 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
- join(strategy: TypeAliasForwardRef('~seemps.state.Strategy') | None = None) MPO[source]#
Create an MPO by combining all tensors from all MPOs.
- Returns:
MPOQuantum operator implementing the product of tensors.
- physical_dimensions() list[int][source]#
Return the physical dimensions of the MPOList (Deprecated, see
dimensions()).
- 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()).