Implement TensorKit's tsvd! reverse-rule for :fixed differentiation mode#150
Implement TensorKit's tsvd! reverse-rule for :fixed differentiation mode#150
tsvd! reverse-rule for :fixed differentiation mode#150Conversation
Codecov ReportAttention: Patch coverage is
🚀 New features to boost your workflow:
|
|
This is still in a rough shape but I think once I figure out how to gauge-fix the full U, S and V, I hope this works! (The gauge transformation only really acts on the truncated singular vectors, so perhaps an identity on the rest is fine?) |
|
I'll hopefully finish this up tomorrow! |
I have a naive question regarding gauge fixing in the |
It is true that the gauge fixing sets the relative (and global) phases of all environment tensors. The point is that two consecutive CTMRG iterations have to be comparable in the sense that the element-wise differences of all environment tensors should be zero at the fixed point. That's also how the gauge fixing works here: based on a given environment, we perform a CTMRG iteration and fix the Us, Ss and Vs of that iteration relative to the given environment. In order to achieve element-wise convergence, we also need to supply the correct, gauge-fixed environment that fits the gauge-fixed SVD. In case you want to have a look at the code implementing this, see the For further details on the implemented gauge fixing algorithm itself, you can take a look at Appendix A here. |
|
I think this should work now but there are some things where I could use some input @lkdvos @leburgel:
|
|
I'll try to have a proper look later today. As for the gauge dependency warnings tolerance, maybe it's good to let it depend on the magnitude of the smallest singular value that is retained (e.g. divide this by a factor 100 or something to set the tol)? |
lkdvos
left a comment
There was a problem hiding this comment.
Overall looks quite good to me. Left a couple small remarks
I understand why we need gauge-fixed U, S, and V when the environment are given, but my question is even more naive. After one CTMRG step, we have U, S, and V—and consequently the projectors. We keep them (no gauge fixing), and then perform CTMRG iterations. Does this process produce element-wise convergence environments? The current strategy is to find out the gauge for given environment. How about under certain gauge (once U, S, V is given, the gauge is implicitly fixed), find out the environment? In other words, in current implementation for gauge fixing, the environment is given first, and we then find the corresponding compatible U, S, and V and then fix it. My question is: since we already have U, S, and V fixed, how exactly do we determine the compatible environment? Is one CTMRG step sufficient for this adjustment, or are multiple iterations required? In some sense, this is related to the symmetry in PEPS. When starting from a generic PEPS, it can be challenging to determine whether the state is symmetric because one must first identify the correct gauge to reveal its symmetry—even if the state is known to be symmetric in principle. In contrast, if one begins with a symmetric PEPS and maintains its symmetry during the gauge-fixing process, the gauge is essentially fixed. Furthermore, if one does not require the sparse structure, any gauge choice is acceptable. In other words, keep-track of gauge is easier. |
Co-authored-by: Lukas Devos <ldevos98@gmail.com>
|
I added an adaptive pullback gauge sensitivity tolerance similar to #155 but perhaps by adapting it directly to the minimal singular value the tolerance is too high now - at least it gets rid of the warnings in the (hopefully) unproblematic cases. Let me know whether we should keep it or not and then we can merge! |
This will not work, since
The compatible environment is determined by first gauge fixing the environment obtained by an extra CTMRG step (see the Conceptually, two steps are required for proper gauge-fixing since two consecutive environments have to live in the same gauge. It is important to remember that the entire fixed-point differentiation is based on the equation I hope this makes it somewhat clearer! I don't find it very easy to explain the details, so in case you need further context, feel free to check out the reference and the code itself. But of course I'm happy to answer any questions. |
|
Should I first tag the other version by the way? |
You mean 0.4.2? Sure, can't hurt. |
|
Sure, then let's tag v0.4.2 first and then I'll merge |
Here we adapt
tsvd!andFixedSVDsuch that the:fixeddifferentiation mode can also use TensorKit's SVD adjoint. For context, theTensorKit.tsvd!reverse-rule requires the full, untruncated SVD which is currently not passed along the CTMRG algorithm. To change this,tsvd!needs to return the untruncated decomposition as well. Hopefully, TensorKit's reverse-rule will eliminate some of the instabilities of KrylovKit's SVD reverse-rule.