-
Notifications
You must be signed in to change notification settings - Fork 12
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
Implement simultaneous CTMRG scheme and CTMRG gradients without gauge-fix differentiation #53
Conversation
…dd small test script
…ion differentiable
… SVD adjoint script to test
…te svdwrap wrapper and instead directly use tsvd, add KrylovKit compat entry
…update tests, implement FixedSpaceTruncation
… SVD test, add docs
…en TensorKit.SVD and IterSVD, add safeguard
I tried to fix the issue we were talking about earlier, where For now, I have added a safeguard in the constructor of Once the tests turn green (I might need to stabilize them first), I would be fine with merging. What do you think? @lkdvos EDIT: I'll fix the tests tomorrow ;-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some small comments, mostly the accessing type parameters I find important. Otherwise, there still seems to be some problems with the tests, so this might still require some stabilizing.
For the rest, I think I am happy with merging once these things are resolved!
src/algorithms/ctmrg_gauge_fix.jl
Outdated
ρfinal = transfermatrix_fixedpoint(Tsfinal, M, ρinit) | ||
|
||
# Decompose and multiply | ||
Qprev, = leftorth(ρprev) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there a problem with the in-place versions? In principle, this should still be compatible with AD, because of how we structured our rrules for functions that destroy their inputs.
This should hopefully stabilize and speed up the test suite a bit. I decided to cut the p-wave superconductor from the However, I modified the Let me know if the modifications to the tests are fine, but I think these should run relatively stable and hopefully faster now! |
I have to say that I am not super happy with cutting the pwave tests, as there now is no full test for a fermionic model. In particular, this is very much not ideal, as this is definitely one of those things where we need to continuously check if we didn't mess up any of the twists by making changes, sometimes requiring multiplication and sometimes contraction, which would now not show up at all for example in the expectation_values etc. |
I can totally see that; let me check if I can get it to run properly again... |
I would be completely fine with actually loading a pre-computed near-groundstate from disk if that solves the problem |
That would be a good idea in the future, but currently I'm struggling to get converging gradients for the I can't really tell yet why there is such a difference between the |
@lkdvos Do you have an idea where these Otherwise the test should finally run through ! |
I am not sure if we really want to include the gradpart tests. Quinten added these to debug on a bit finer level, but there is really no reason to check if the individual steps are compatible with finite differencing if a full gradient also works. (Also, they really are hacked together a bit...) In particular, while I didn't investigate in detail, the |
Hmm I guess you got a point, that it is a bit hacked together and that the full gradient is already tested elsewhere. I will then disable the test but it might be useful to leave it in the tests folder if needed in the future? |
Codecov ReportAttention: Patch coverage is
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess all of the requested changes are now in place :-)
Here I will implement the CTMRG scheme where all projector are computed simultaneously and applied from both sides to the corners at the same time. In combination with a gauge-fixed SVD, it makes it possible to differentiate a CTMRG iteration without also differentiating the
gauge_fix
function itself. This speeds up and stabilizes the fixed-point gradient computation.Things still to do:
gauge_fix
)@autoopt
SVDAdjoint
algorithm)