# ITensor to MPS/MPO in C++

**URL:** <https://itensor.discourse.group/t/itensor-to-mps-mpo-in-c/1294>\
**Category:** ITensor C++ Questions\
**Created:** [November 19, 2023, 11:04am UTC](https://itensor.discourse.group/t/itensor-to-mps-mpo-in-c/1294 "2023-11-19T11:04:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![TrudySun](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/trudysun/32/380_2.png) [@TrudySun](https://itensor.discourse.group/u/TrudySun)\
**Post date:** [November 19, 2023, 11:04am UTC](https://itensor.discourse.group/t/itensor-to-mps-mpo-in-c/1294/1 "2023-11-19T11:04:14Z")

</div>

Dear ITensor,

I’m considering construct TT-approximation in C++. I notice in Julia version, there is a “MPS” function that can construct the MPS from an ITensor, e.g.

```julia
using ITensors

cutoff = 1E-8
maxdim = 10
T = randomITensor(i,j,k,l,m)
M = MPS(T,(i,j,k,l,m);cutoff=cutoff,maxdim=maxdim)

```

However, i have not find such a MPS usage in C++ version. May I ask is there any simple package in ITensor C++ to do this, or i need to write a program of a sequence SVDs of unfolding matrices instead. Thank you.

Best,

Trudy

---

<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:** [November 24, 2023, 12:41pm UTC](https://itensor.discourse.group/t/itensor-to-mps-mpo-in-c/1294/2 "2023-11-24T12:41:45Z")

</div>

Unfortunately I don’t think we have this in the C++ version, so you’d have to code a sequence of SVDs. If you’d like help with any step, please let us know. Also if you are interested in turning your code into a contribution to the library and want to open a pull request, we could add this as a new constructor for the MPS class.
