quimb icon indicating copy to clipboard operation
quimb copied to clipboard

Feature/sweep bounds

Open pulkin opened this issue 5 years ago • 4 comments

A possibility to limit bounds of sweeps in DMRG1,2. Not tested for loop networks.

pulkin avatar Jun 20 '19 15:06 pulkin

Codecov Report

:exclamation: No coverage uploaded for pull request base (develop@f22ea7c). Click here to learn what that means. The diff coverage is 90.9%.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop      #26   +/-   ##
==========================================
  Coverage           ?   87.96%           
==========================================
  Files              ?       31           
  Lines              ?     7720           
  Branches           ?        0           
==========================================
  Hits               ?     6791           
  Misses             ?      929           
  Partials           ?        0
Impacted Files Coverage Δ
quimb/tensor/tensor_1d.py 93.08% <100%> (ø)
quimb/tensor/tensor_dmrg.py 91.15% <89.28%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f22ea7c...9d27ee7. Read the comment docs.

codecov[bot] avatar Jun 20 '19 15:06 codecov[bot]

Just to clarify: given bounds=(s, e), what do you expect in the case sweep_sequence='LR' and sweep_sequence='RL'? Which bound is included at which stage?

pulkin avatar Jun 20 '19 17:06 pulkin

So, my feeling is that the sweep should just be:

range(s, e - bsz + 1)  # for direction 'R', or
reversed(range(s, e - bsz + 1))  # for direction 'L'

So if you wanted to keep a single site held, in either DMRG1 or DMRG2 it would be

dmrg.solve(bounds=(0, mysite))
dmrg.solve(bounds=(mysite + 1, n))
...

What do you think?

jcmgray avatar Jun 21 '19 10:06 jcmgray

So there are some subtle complexities that require a bit more work here.

  1. The test should use a fixed site state that is not the lowest energy state - otherwise it's not testing anything. If you try this you'll see that the limited sweeping is not being restricted correctly at the moment.
  2. The addition of sites to expand_bond_dimension will currently only increase the index size of one tensor across some bonds, resulting in an invalid tensor network. This probably needs a separate test.

It might be easier for me to address these just as I know the code better, but also happy for you to try! Let me know, I'd need commit permission on this PR.

jcmgray avatar Jun 21 '19 12:06 jcmgray