Hello.
I am studying the spin-polarized system(J<0 Heisenberg Chain) by iDMRG.
When I calculate two-site correlator, I met error:

terminate called after throwing an instance of 'std::bad_alloc'


The MPS I'd like to contruct is,

psi.A(2) =
/--------------IQTensor--------------
r=3 div=QN(0) log(scale)=0

IQIndex("S=1/2 2",2,Site|143) <Out>
("Up 2",1,Site|4) QN(1)
("Dn 2",1,Site|62) QN(-1)

\------------------------------------


and my code is,

Print(psi.A(2));
Print(prime(dag(psi.A(2))));
Print(psi.A(2) * prime(dag(psi.A(2)), Link)); // <- cause error!


. m>=400 always cause this error, but I checked m=200 goes well.
My server has 512GB RAM.
I think that the large QN due to the spin-polarization and the large maxm might cause this problem.
"to_MPS" function does not resolve this issue.

Can I fix this problem? Should I do something like "reset QN"?

Hello, I solved this problem.
This problem is due to my little knowledge of the efficient MPS contraction.

The Tensor

  psi.A(2) * prime(dag(psi.A(2))


has a very big index dimension, but what I'd like to do is calculate a correlation function.
So I should do:

lcorr *= psi.A(2);