ITensor icon indicating copy to clipboard operation
ITensor copied to clipboard

.position() of MPS does not preserve the link index of the MPS

Open mingruyang opened this issue 4 years ago • 1 comments

Hi Matt and Miles,

The .position() function to move the orthogonality center does not preserve the link index of the MPS. This will cause some problems as explained below.

I want to do measurement after each DMRG sweep. If I don't use the DMRGObserver class, but do measurements in the following way:

LocalMPO PH(H,{"NumCenter",2});
DMRGWorker(psi0,PH,sweeps,"Quiet");
psi0.position(5);
\\ Do some measurement at site 5 here
DMRGWorker(psi0,PH,sweeps,"Quiet");

then in line 5, I will get an error like the following:

inds() = 
(dim=9|id=44|"l=2,Link") <In>
  1: 1 QN({"Sz",4})
  2: 2 QN({"Sz",2})
  3: 3 QN({"Sz",0})
  4: 2 QN({"Sz",-2})
  5: 1 QN({"Sz",-4})
(dim=9|id=44|"l=2,Link") <Out>
  1: 1 QN({"Sz",4})
  2: 2 QN({"Sz",2})
  3: 3 QN({"Sz",0})
  4: 2 QN({"Sz",-2})
  5: 1 QN({"Sz",-4})

From line 88, file itensor.cc
Wrong number of IndexVals passed to elt/eltC (expected 0, got 2)
Wrong number of IndexVals passed to elt/eltC (expected 0, got 2)

Make a copy of the MPS to do measurement can solve the problem, but I don't want to increase the memory usage especially when the bond dimension of the MPS is large.

mingruyang avatar Dec 29 '20 04:12 mingruyang

Hi Mingru,

We can't make .position preserve the link indices, since it performs a gauge transformation that can change the structure of the QNs. Can't you still perform the measurement without changing the gauge (i.e. without calling .position)? You may not be able to take advantage of a special gauge center, but in general measurements can still be done efficiently.

-Matt

mtfishman avatar Jan 04 '21 14:01 mtfishman