-
Notifications
You must be signed in to change notification settings - Fork 22
[WIP] Belief propagation gauge fixing #223
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
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
🚀 New features to boost your workflow:
|
I remember that BP is equivalent to simple update (PhysRevResearch.3.023073), although I haven't looked at the details (such as whether the bond messages are guaranteed to be real diagonal, and thus already represented by BTW, YASTN people are also working on BP, and with NNN Hamiltonian support (in one of the branches) as well. |
I looked into trying to reuse some of that functionality, and at least for the I do agree that it would be nice to join the simple update part, but for now I was actually mostly interested in affecting the gauge of a PEPS, and we can look into extending this to actually do updates in the future. It's nice to hear that YASTN also are finding this helpful! I don't think adding NNN support would be too hard, the contractions with these rank 1 environments are a lot more manageable in general. |
Thanks for getting this started! I'd be happy to join in on this since I was recently talking to Bram about PEPS optimization, how well it might perform and how that might be related to gauge freedoms. Specifically, I was looking at optimization runs that get stuck in linesearching at some point - e.g. when choosing a CTMRG environment dimension that is too low. Around these iterations where the optimizer gets stuck I computed cuts through the energy landscape along the current gradient directions and I was getting all sorts of weird curves with cusps or discontinuities (inspired by Appendix B of the periodic PEPS paper: https://arxiv.org/pdf/2411.12731). For example, a Heisenberg model at At In these cases you can really see that a low environment dimension will first get you smooth convex functions that become more closely centered around I seemed that gauging by symmetrizing the PEPS spatially did improve the energy landscapes but I haven't properly investigated that. In any case, I would be quite interested to see how BP gauging could improve optimization convergence and perhaps stabilize more complicated optimization runs. |
I also have wanted to try it out for quite a while, and see how it can systemically improve over SU. To suggest some tests for the current PR, we can first check that if the bond weights produced by SU (with identity gates) are consistent with the BP message tensors. |
@pbrehmer these are some really cool plots! This was indeed one of the primary use-cases I had in mind, so it would be cool to see how this alters these gradient plots. As a side note, at such low bond dimensions I would also be slightly cautious about picking bond dimensions that necessarily break the symmetry, for example in a U1 case with charge conjugation I would expect that you might need to check for each D whether or not it gives a valid combination. This is motivated by similar problems for MPS simulations, where certain bond dimensions don't work because they have to cut inbetween multiplets. |
@pbrehmer Indeed, we have seen this a lot for periodic PEPS, and pushing |
Yes I have also noticed that recently in some cases! Good to know that that seems to be consistent with your findings :) |
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.
Since adding BP may need some revisions for SU and InfiniteWeightPEPS, I want to ask a few things to get more familiar with it.
@@ -0,0 +1,98 @@ | |||
struct BPEnv{T} | |||
"4 x rows x cols array of message tensors, where the first dimension specifies the spatial direction" |
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.
Could you please add a unicode diagram illustrating the convention?
sqrtmsgs = map(env.messages) do M | ||
U, S, Vᴴ = tsvd!(M) | ||
sqrtM = U * sdiag_pow(S, 1 / 2) * Vᴴ | ||
isqrtM = U * sdiag_pow(S, -1 / 2) * Vᴴ | ||
return sqrtM, isqrtM | ||
end |
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.
In the original BP gauging paper, the message tensors are chosen to be positive definite, and their square root is calculated with eigen-decomposition. Here I see you changes it to SVD, and the BPEnv
are initialized simply with randn
without enforcing positiveness. I'm curious whether this is valid.
This is an initial implementation for gauge fixing a PEPS based on the algorithm described here
From what I can tell it is mostly functional, although it requires some tests etc to actually see how well it performs in practice.
The idea would be to attempt to stabilize some gradient methods by re-gauging the state every N steps.