# Tensor product together MPS

**URL:** <https://itensor.discourse.group/t/tensor-product-together-mps/824>\
**Category:** ITensor Julia Questions\
**Created:** [April 28, 2023, 9:21pm UTC](https://itensor.discourse.group/t/tensor-product-together-mps/824 "2023-04-28T21:21:53Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![miles](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/miles/32/6_2.png) [@miles](https://itensor.discourse.group/u/miles)\
**Post date:** [April 28, 2023, 9:35pm UTC](https://itensor.discourse.group/t/tensor-product-together-mps/824/2 "2023-04-28T21:35:51Z")

</div>

A good way to do this in ITensor would be to make a new MPS with n qubits and then assign the MPS tensors of \ket{r} to the sites j=2,3,4,...,n of this MPS and then set the first MPS tensor to the \ket{0} state. I’d do it in the following way:

1. make the set of qubit indices `s = siteinds("Qubit",n)`
2. make \ket{r} by calling `r = randomMPS(s[2:n]; linkdims=chi)`
3. make an MPS `psi = MPS(s,"0")` of qubits all in the \ket{0} state
4. finally, write a for loop that just assigns the tensors of the MPS \ket{r} to the appropriate tensors of `psi`

---

_[View the full topic](https://itensor.discourse.group/t/tensor-product-together-mps/824)._
