Matrix-product states (MPS)#

The matrix-product state is an efficient representation of composite quantum systems that reconstructs the total wavefunction from the contraction of three-legged tensors.

If \(\Psi\) is a quantum state with N components, a MPS representation would look as follows

\[|\Psi\rangle = \sum_{\vec{i},\vec{\alpha}} \prod_{n=1}^N A_{\alpha_n, i_n, \alpha_{n+1}} |i_1,i_2,\ldots, i_N\rangle\]
_images/mps-state.drawio.svg

Here, the \(i_n\) are indices labelling the quantum states of the respective subsystems, while the \(\alpha_n\) are integer indices connecting (correlating) neigboring quantum systems. The former are usually labeled the “physical” indices, while the latter are declared “virtual” indices.

_images/mps-tensor.drawio.svg

In SeeMPS, matrix-product states are represented by the class MPS. The instances of this class keep a sequence (list) of these three-legged tensors, as well as other information, such as accumulated errors in this representation. Such matrix-product states can be mutated, they can be added, rescaled, renormalized, or they can be subject to quantum operations, such as gates or the computation of observables.

Creation#

Matrix product states can be created by supplying the tensors that form the state, and in the case of small wavefunctions, they can be reconstructed directly from the state vector of the composite quantum state. In addition to this, we offer some functions to create convenience states

MPS(data[, error])

MPS (Matrix Product State) class.

from_vector(ψ, dimensions[, strategy, ...])

Create a matrix-product state from a state vector.

from_tensor(state[, strategy, normalize])

Create a matrix-product state from a tensor that represents a composite quantum system.

AKLT(n)

Create an MPS for the AKLT spin-1 state with n sites.

GHZ(n)

MPS representing a GHZ state with n qubits.

product_state(vectors[, length])

Create a product state MPS.

random_uniform_mps(d, N[, D, truncate, ...])

Create a random state with N elements of dimension d and bond dimension D.

W(n)

MPS representing a W-state with n qubits.

Simple operations#

Matrix product states can be combined with each other and transformed:

  • An MPS a can be rescaled by a number n * a

  • An MPS can be conjugated a.conj()

  • Two MPS a and b can be added, producing an MPSSum (see MPS combination (MPSSum)).

  • The wavefunctions of two states can be multiplied element-wise a * b in an unphysical transformation.

Observables#

The interest of MPS lays in its simple algebraic structure, which not only involves a subexponential number of parameters, but also enables some operations with a polynomial cost. One such operation is the computation of expected values of local operators such as

\[\langle\psi|O_1 O_2 \cdots O_N|\psi\rangle\]

As sketched below, the expectation value is recovered from the contraction of a quasi-1D structure, with a contraction cost \(O(N D^4)\) that is linear in the number of components, and polynomial on the bond dimension D and the physical dimension d of each tensor.

_images/mps-expectation.drawio.svg

The following functions provide access to single- and two-body expectation values in a convenient way.

scprod

Compute the scalar product between matrix product states \(\langle\xi|\psi\rangle\).

norm()

Norm-2 \(\Vert{\psi}\Vert^2\) of this MPS.

norm_squared()

Norm-2 squared \(\Vert{\psi}\Vert^2\) of this MPS.

expectation1(state, O, i)

Compute the expectation value \(\langle\psi|O_i|\psi\rangle\) of an operator O acting on the i-th site

expectation2(state, O, Q, i[, j])

Compute the expectation value \(\langle\psi|O_i Q_j|\psi\rangle\) of two operators O and Q acting on the i-th and j-th subsystems.

all_expectation1(state, O)

Vector of expectation values \(v_i = \langle\psi|O_i|\psi\rangle\) of local operators acting on individual sites of the MPS.