Creating an MPS from a state vector#
The Schmidt decomposition can be used sequentially, to split a multilegged tensor representing a quantum state, such as \(\psi_{ijk}\), or \(\psi_{i_1i_2i_3\cdots i_N}\) into a collection of three-legged tensors (See matrix-product state objects).
The rationale starts by understanding that Schmidt decomposition of the bipartite system as the separation of a two-legged tensor tensor into two smaller tensors. For instance, we can write
identifying the matrices from the SVD form
The k index that bonds both tensors is called the “virtual dimension”, as opposed to the original indices i and j, which we associated to physical subsystems.
This procedure can be extended to larger tensors wiht more legs. Let us take an N-dimensional quantum system, whose state is represented by an N-leg tensor and reinterpret it as a bipartite system with N-1 and 1 component, respectively.
Here, the index \(I\) groups all the possible configurations from the previous (N-1) indices and has a potentially large dimension, \(d_1\cdots d_{N-1}\). But let us ignore this fact and use the Schmidt decomposition to write
We can repeat this process iteratively, now separating
If repeated N times, the outcome is a decomposition of the whole tensor into a contraction of 3-legged tensors:
In SeeMPS, this iterative procedure is performed in very different parts of the
code. For the user, this algorithm is offered through the class methods
from_tensor()
, which transforms an N-legged tensor
into a matrix-product state with N components.
Take for instance the following example, which creates an unnormalized random state of 8 qubits, and then uses this decomposition to create a matrix-product state:
>>> from seemps import MPS
>>> import numpy as np
>>> state = np.random.randn(2,2,2,2,2,2,2,2)
>>> mps = MPS.from_vector(state)
Alternatively, the same effect can be obtained from the wavefunction of a composite quantum system represented as a vector. Naturally, because we are inputting a vector, this function takes as an argument a list with the dimensions of the quantum subsystems.
>>> from seemps import MPS
>>> import numpy as np
>>> state = np.random.randn(2**8)
>>> mps = MPS.from_vector(state, [2]*8)