Add PEPS initialization based on fidelity maximization#257
Add PEPS initialization based on fidelity maximization#257
Conversation
Codecov Report❌ Patch coverage is
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
|
@leburgel, @lkdvos I tried to recreate what you explained on Tuesday but I'm still a bit unsure about some things here:
I'll figure this out over the next days, but I'm happy about any hints/comments. |
lkdvos
left a comment
There was a problem hiding this comment.
I'll try and go over this in a bit more detail later, just wanted to leave these small comments before I forget
|
I think it will be straightforward to do this for mixed states (PEPOs) as well? One particular application is first obtaining exp(-βH) from simple/full update, tracing out the physical axes, and putting it on a periodic lattice and contracting using TNR (when we want to extract CFT information). For TNR, afaik it is often cumbersome to work with non-trivial unit cells. Anyway, there are other ways to directly obtain the exp(-βH) PEPO with trivial unit cell (e.g. HOTRG, cluster expansion) and we don't need to do this right now. |
|
The new tests should pass once a new TensorKit version is released since we need |
|
@pbrehmer, how would you feel about splitting off and adding the |
I agree, the crude fidelity |
|
I removed the single-site initialization and fixed the test. Of course one could add more test cases but I think this is also fine as is. Would be good to go for me. |
| env₀, = leading_boundary(CTMRGEnv(peps_init, envspace), peps_init, alg.boundary_alg) | ||
| peps_init /= sqrt(abs(_local_norm(peps_init, peps_init, env₀))) # normalize to ensure that fidelity is bounded by 1 |
There was a problem hiding this comment.
In Julia, doing ψ /= nrm is exactly equivalent to ψ = ψ / nrm (@lkdvos correct me if I'm wrong, or the behavior is defined differently for PEPS/TensorMaps). After this assignment (rebinding), any changes to ψ does not affect the input variable. Then the function is not mutating, and we can avoid introducing new names like peps_init, peps.
Also, env₀ being the environment for ψ, and env being the environment for ψ₀ looks off to me.
There was a problem hiding this comment.
I introduced new names on purpose since I felt that was a bit cleaner and made it easier to read to iterative process. Note that env₀ is the environment of peps₀ (see updated name) and env of peps, i.e. the ₀ index refers to the zeroth iteration step of the approximate routine, not the initial guess. Instead, the first iteration step is determined by the initial guess ψ₀ since a perfect initial guess would immediately terminate the iteration. This is all slightly confusing so I wanted to work with different names.
Yue-Zhengyuan
left a comment
There was a problem hiding this comment.
Some more nitpicky comments
| ) | ||
| ) | ||
|
|
||
| @test peps_approx1 ≈ peps_approx2 |
There was a problem hiding this comment.
As a less trivial test, can we do two approximations with two different seeds (leading to different CTMRGEnv during the run), and finally check if the fidelity of the two results is close enough to 1?
There was a problem hiding this comment.
Yes, I'll add that to the existing test set.
There was a problem hiding this comment.
On my Mac this new test fails miserably...
There was a problem hiding this comment.
How miserably does it fail? In general I think we can't expect the fidelities to approach 1 very closely since the algorithm is rather crude but I thought that being within 10% should be possible. Does is get better for other seeds?
There was a problem hiding this comment.
Okay, trying around with different seeds this test will always fail. Maybe the tolerance is too strict: If one evaluates the fidelity of two random PEPS, it will in general be very small. So perhaps it is enough if the fidelity is already of the order of
There was a problem hiding this comment.
For me the fidelity between two runs with different seeds can be ad low as 0.3. If random states are hard, how about using SU to get a physical state and try to approximate it?
There was a problem hiding this comment.
I don't think the problem is the initial state, it's rather the algorithm itself which will only bring two states in the same ballpark. One can already see in the convergence itself that it is hard to converge the fidelity below an error of
|
If I take a random PEPS |
I don't think it will evaluate to 1 due to the way CTMRG (without spatial symmetries) is not gauge-invariant if you insert a gauge transformation on the virtual bonds since the north and east edge will absorb Edit: If that is true, then that also kind of answers why the fidelity test won't approach 1, since two different initializations won't end up in the same gauge. |
|
Then I suggest we also explain in docstring how the fidelity is crudely approximated so that users can have the right expectations. |
|
Just remembered this discussion #316 that is very relevant. |
|
|
|
Oh, can we maybe use BP gauging fixing during the iteration to improve the robustness? |
This PR adds tools to initialize a PEPS based on maximizing the fidelity with respect to another PEPS. As we discussed on Tuesday, this would be useful e.g. to extract a single-site approximation of a SU evolved PEPS on a$2\times2$ unit cell. This would be great to have since SU/FU evolved initial PEPS can then be used for single-site variational optimization.
Note that I use TensorKit's embed branch in order to use the
embed!function: