Compress 2-layer InfinitePEPO with local truncation#311
Conversation
Codecov Report❌ Patch coverage is
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
|
Cool! What you could do in the PEPS-PEPO case is to construct the PEPO as $$ exp(-d\tau H) $$, and see whether many applications of this PEPO on a random initial PEPS make it converge to the ground state. That is what I have as one of the tests in my ClusterExpansions code, which you can find here. This PEPO could be made using the Trotter decomposition, or via Simple Update, like you did in the previous tests. This should also allow for a fermionic test case. |
|
@sanderdemeyer I don't know if you knew it before, but recently someone mentioned to me that we can optimize the HOTRG projectors (in your terminology, the "oblique projectors" in "no-environment truncation") with automatic differentiation, which is equivalent to second RG (see this paper). If you haven't tried it before, maybe I can help test this idea (also as an exercise to learn AD for me), which is also a great extension to this PR to actually make it appealing. |
|
From the experience of 2508.05406 and 2602.22113, this simple truncation method can already yield some decent results. So we may just merge this after settling on some technical details like the interface. |
|
@lkdvos Do you have time to take a look? I have changed from overloading |
lkdvos
left a comment
There was a problem hiding this comment.
I'm still not entirely convinced by trying to fit it in changebonds, but I don't think it matters all that much to be honest. I think I would lean in the direction of just giving it a separate name, but if you prefer to keep it like this that definitely also works for me!
I left some other comments through the code that are mostly minor, otherwise I think this is probably fine!
|
I like the rename to If there's no need for a more-layer version in the foreseeable future I would be fine with it as is, just wanted to bring it up. |
|
I now think that Some immediate generalizations are We never compress more than 2 layers at once. Only the cost function may have more layers. So I guess even tuples are not necessary. @Adwait-Naravane if we ever want to write this, how should we pass the additional layers to the function? Maybe inside the truncation algorithm struct? I remember testing the layer-wise QR approach myself, and found that it wasn't minimizing the cost function. But anyway, if it can reduce cost, I can also provide an option to use it. BTW, QuantumKitHub/TNRKit.jl#172, which is doing essentially the same thing, took only one month to get merged. We spend too much time arguing about the interface. |
Sounds fair, I like the tuple option anyway.
Even if you only compress two layers at a time, you can still pass all the layers in 1 tuple and then just apply the 2-layer compression method recursively adding one extra layer in every time. So maybe I'm misunderstanding, but I don't think there's a need to pass the additional layers elsewhere or add them to the truncation algorithm struct. If we ever want to do multi-layer compression we just add 1 additional method with the same interface, which dispatches to the
We already have the tendency to break things quite often, to the dismay of quite a few users, so I wouldn't say we necessarily spend too much time discussing interfaces. However, it is true that we're just too slow. Having to wait days or even weeks for a review is just not nice. Being annoying about interface choices while also not making time to quickly follow up on reviews is a bad combination. I will try to improve on the speed at least and try to make some more time, that I can definitely get behind. |
|
I'm currently testing the layerwise-QR approach and see whether it really minimizes the cost. Let's aim for merging in this week. |
leburgel
left a comment
There was a problem hiding this comment.
Final comments, but otherwise looks good to me now.
|
Just checked more carefully on the layerwise-QR approach currently used in TNRKit. It indeed minimizes the local cost function, so I was wrong in this aspect. However, the computational cost is higher for layerwise-QR (if we trust the analysis done by Codex, attached below). So let's only keep the current HOTRG-like implementation. @Adwait-Naravane @VictorVanthilt You may want to revisit the two-layer QR in Details
This forms the two-layer Gram matrix With a good contraction order, each Gram construction costs roughly then So one left/right orthogonalization costs and the full
Each single-layer QR treats a PEPO tensor as a matrix of size approximately so each QR costs After two such QRs, the intermediate and QR of that costs So one left/right orthogonalization costs and the whole up to the common final Bottom line Cost-wise, For fixed small |
This PR introduces the most naive algorithm to compress two 1-layer iPEPOs into a new 1-layer one with smaller virtual bond dimension:
It is a polished version of @sanderdemeyer's work in ClusterExpansions.jl, with the extra support for arbitrary unit cell sizes (ClusterExpansions.jl focused on the trivial unit cell case). At least it can serve as initialization for other advanced approximation methods.
The algorithm minimizes the local cost function at each virtual bond, which is the norm of
The projectors are found following steps described in Appendix A, 1905.02351 (Boundary Tensor Renormalization Group). To handle fermions, the virtual arrows are required to follow the leftwards/downwards directions.
In addition, as suggested by @leburgel, I introduced lazy multiplication of two iPEPOs
ρ1 * ρ2by stacking layers ofρ1belowρ2without doing any contraction. Since we restrict all codomain physical spaces to be non-dual, we don't need to worry about fermionic twists here.An immediate generalization is truncating the product of an InfinitePEPO and an InfinitePEPS, but currently I don't have concrete test cases.