Hello,

I'm having trouble trying to reflect an MPS psi around the center of a 1D lattice-

psi(x) ---> psi(-x)

I expected changing the order of the tensors to be enough, i.e. change the tensor at site 1 to be the tensor originally at site N, change site 2 to the tensor at site N-1 etc.

This is the code implementation:

for(int i = 1; i <= N; ++i)

{phi.setA( i, psi.A(N+1-i));}

However, trying to perform a DMRG sweep on the resulting wavefunction phi, I get the error:

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

Also this error pops up when making calculations on phi using .cplx() :

Wrong number of IndexVals passed to real/cplx (expected 4, got 0)

Swapping just one pair of tensors inside the MPS produced the same error.

Note I'm using IQTensors.

Would appreciate any help.

Thanks,

Oren