Is there a way to initialize an MPS by the statevector.

As an example, considering the GHZ state N qubits:

\ket{GHZ} = \frac{1}{\sqrt{2}} \ket{00...0} + \ket{11...1}

with state vector with 2^N elements

\frac{1}{\sqrt{2}} [1 0 0 ... 1]

How do I initialize the MPS?

(surely this is an easy example, but I would like to do it with any initial state vector)

miles
2
Hi Emilio,

Does this code example answer your question?

https://itensor.github.io/ITensors.jl/stable/examples/MPSandMPO.html#Creating-an-MPS-from-a-Tensor

Here the tensor `T`

would be your state vector, reshaped as a tensor with N dimensions (N indices).

My problem is actually how to initialize an Itensor from a State Vector.

So how to initialize T if all I have is a vector of 2^N elements

Oops sorry, you can do it straightforward as said in ITensor · ITensors.jl

It was not working for other reasons related to my inexperience.

Thank you