Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mingruyang opened this issue Dec 29, 2020 · 1 comment
Open

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

mingruyang opened this issue Dec 29, 2020 · 1 comment

Comments

@mingruyang
Copy link
Contributor

mingruyang commented Dec 29, 2020

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.

@mtfishman
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants