quimb
quimb copied to clipboard
Feature/sweep bounds
A possibility to limit bounds of sweeps in DMRG1,2. Not tested for loop networks.
Codecov Report
:exclamation: No coverage uploaded for pull request base (
develop@f22ea7c
). Click here to learn what that means. The diff coverage is90.9%
.
@@ 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.
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?
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?
So there are some subtle complexities that require a bit more work here.
- 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.
- The addition of
sites
toexpand_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.