Implement rotation for InfiniteWeightPEPS#182
Implement rotation for InfiniteWeightPEPS#182Yue-Zhengyuan merged 19 commits intoQuantumKitHub:masterfrom
InfiniteWeightPEPS#182Conversation
|
The major problem is the following: suppose we start from an InfiniteWeightPEPS with the "standard" arrow directions and axis order: After Do you have suggestions on this? @sanderdemeyer Could you also please think about it? You may be the one who uses |
|
The problem lies indeed in the added twists, but this does not necessarily have to be a problem. For example, an This is also what happens here in the tests. Even though This is a choice we have to make. I could get behind wanting a different implementation such that the tests run. If we do decide to keep the current implementation, we could add checks on the expectation values, rather than the PEPS tensors themselves. |
|
I'm aware that the physical state is indeed the same. I just wonder if there is a way that can keep the |
|
If this turns out to be too cumbersome for |
|
I'm not entirely sure that asking for elementwise equality is necessary (or even always possible). In some sense, I'm slightly confused that twists appear here at all, and I would guess that you could simply permute all tensors, and the state would still be unchanged (I didn't check this). After this, you could use the In any case, as @sanderdemeyer said, I think checking that expectation values of random operators are left unchanged is more meaningful than trying to make the tensors be exactly equal. |
|
@lkdvos The twists is because I want to keep the direction (axis order) of the weight matrices. For example, after I need to permute the new weights back to About the flip, indeed one approach is we restore the internal arrow directions after rotation, so I don't need to further modify |
|
@sanderdemeyer I'll try implementing the rotation that does not rotate the arrows together with the state this week, and add the constraint that virtual arrows in |
|
@Yue-Zhengyuan This is perfect for me. It feels like the safest choice to always impose that an |
Codecov ReportAttention: Patch coverage is
🚀 New features to boost your workflow:
|
| peps = InfinitePEPS(psi) | ||
| @test compose_n(rotl90, 2)(psi) ≈ compose_n(rotr90, 2)(psi) | ||
| @test compose_n(rotr90, 2)(psi) ≈ rot180(psi) | ||
| # flipping twice results in a twist |
There was a problem hiding this comment.
I notice a related PR on TensorKit (QuantumKitHub/TensorKit.jl#241), and in v0.14.6 it is stated that flip ∘ flip is not identity. Here for fermions I find that it is equal to a twist. Is this also true for more general tensors, i.e. for anyons?
There was a problem hiding this comment.
Even though I'm still of the opinion that we do not need to do this, we might be able to retrieve the same tensors (i.e. without twists) by choosing appropriately between forward and inverse flips. This might be safer for the anyonic case as well. I do not know enough about the anyonic case to be sure about this, so I'll ask the people who have more experience with this.
There was a problem hiding this comment.
I think the answer here is definitely no for anyons. Really, the flip function is probably only well-defined for symmetric braiding rules anyways, and even there it is not a unique choice, it's just a canonical choice of isomorphism between the space and the dual, implemented in such a way that it does not alter subsequent contractions through @tensor (which would not work for anyons anyways).
There was a problem hiding this comment.
Then should I change the test to use Edit: I have done it to prevent spreading misinformation. But this test still relies on the special case that each weight matrix are invariant under flips on both indices (for FermionParity).flip only? i.e. replace the twists below with two inverse flips.
|
@sanderdemeyer Could you please take a look and see if there are further improvements you want? BTW, after this is merged, I'll use rotation instead of mirroring to swap x/y directions in SU. I find this leads to a more stable result in some of my use cases. Then |
|
I had hoped that we could recover the same state (without the twists) if we would properly distinguish between In conclusion, I think we can merge this. |
I did consider adding a kwarg to the rotation functions to specify whether |
| peps = InfinitePEPS(psi) | ||
| @test compose_n(rotl90, 2)(psi) ≈ compose_n(rotr90, 2)(psi) | ||
| @test compose_n(rotr90, 2)(psi) ≈ rot180(psi) | ||
| # flipping twice results in a twist |
There was a problem hiding this comment.
I think the answer here is definitely no for anyons. Really, the flip function is probably only well-defined for symmetric braiding rules anyways, and even there it is not a unique choice, it's just a canonical choice of isomorphism between the space and the dual, implemented in such a way that it does not alter subsequent contractions through @tensor (which would not work for anyons anyways).
Co-authored-by: Lukas Devos <ldevos98@gmail.com>
|
@lkdvos Should we update the format check with JuliaFormatter v2 (currently v1 is being used)? They give different result for a few files. |
|
I am holding off on that for now since it indeed gives different results for a few files. function myfunction(args..., ::Type{T}=Float64, ...)
endinto this: function myfunction(args..., (::Type{T}=Float64), ...)which I think is just silly. I'm happy to rediscuss formatters, but this really has to be in a separate single PR so the formatting changes don't get mixed up with actual coding changes |
|
I've undone the v2 formatting changes. |
Co-authored-by: Lukas Devos <ldevos98@gmail.com>
This PR implements rotations
rotl90,rotr90androt180forInfiniteWeightPEPSandSUWeight. In addition, we now restrict the virtual arrow directions in anInfiniteWeightPEPSto be either downward or leftward for easier operations in simple update algorithms. As a result, the arrow directions in anInfiniteWeightPEPSwill not rotate together with the state.