# Different index structure after applying MPO to MPS

I am making the transition to v3 and have come across something I don't understand. After applying an MPO to an MPS using applyMPO, I try to add the new MPS to another, unmodified MPS. My code fails at the plusEq operation on these two MPS, with the following message.

L = ITensor ord=2: (3|id=780|n=1,Site)' (2|id=376|l=1,Link)'1254313
{norm=0.00 (Dense Real)}

R = ITensor ord=2: (3|id=780|n=1,Site) (2|id=376|l=1,Link)'1254313
{norm=1.00 (Dense Real)}

From line 1006, file itensor.cc

ITensoITensor::operator+=: different index structure

ITensoITensor::operator+=: different index structure


I see the problem in the output -- there's a prime on the L tensor that doesn't match the same site on the R tensor. But I don't understand why it should be there, since I haven't primed anything in my code. Any help appreciated!

+1 vote
selected by

auto Hpsi = applyMPO(H,psi);

This was a change made to the applyMPO function in V3. In V2, applyMPO automatically unprimed the output MPS. However, this was making an assumption that the MPO had indices of the form (s1,s1',s2,s2',...). This is however not always the case, for example in other tensor network algorithms where the indices on either side of the MPO are completely different (but the algorithm for applying an MPO to an MPS works essentially the same). Basically, it was a tradeoff between making the algorithm much more general but a bit more inconvenient for certain use cases.