I am not very clear about the final point in your answer, which is :
Finally, update all of the physical indices of the MPS so that they are distinct, rather than repeating with a 2-site periodicity. You can do this by using a delta tensor:
psi.ref(n) *= delta(s,sites(n));
Neither, I don't see this line of code or something similar in https://github.com/emstoudenmire/finiteTMPS/blob/master/mpo_ancilla.cc
I think the corresponding part in mpo_ancilla.cc should be:
auto psi = MPST(sites);
for(int n = 1; n <= 2*N; n += 2)
auto s1 = sites(n);
auto s2 = sites(n+1);
auto wf = TensorT(s1,s2);
psi.Aref(n) = TensorT(s1);
psi.Aref(n+1) = TensorT(s2);
psi.Aref(n) *= D;
Can you please explain the reason why I should do this? I also get some confusions of the comments below the answers.
Besides, I am also concerned about the normalization. After doing the first two steps, the ITensors are not normalized to 1.