[WIP] Boundary-MPS approximate contraction of an iPEPO window with CTMRG environment - #415
[WIP] Boundary-MPS approximate contraction of an iPEPO window with CTMRG environment#415Yue-Zhengyuan wants to merge 11 commits into
Conversation
|
Fermion support is now here, but the way to achieve it is not ideal. I first put the virtual arrow directions in the iPEPO in the standard direction. But the on the right boundary, the "physical space" is dual, as required by the CTMRGEnv constructor (see C₂ below): Thus I still need to use many planar operations (some of which I still don't fully understand) when constructing the left and right ends of each row, and the south boundary. (Edit: now I also flip the east envspace to standardize all arrows. Things then make more sense.) Otherwise, if I dispatch away from planar operations, it seems that I need to overload lots of things in MPSKit (not only in |
|
I was going to take some time to go over this, but it seems this PR is rather large and I completely misjudged the time I allocated. I'll try to go over the details as soon as I can, but maybe I can start with a few general remarks already before I submit a full review: As far as I can tell, the newly introduced For the finite window contraction, would it be possible to directly pass an algorithm for this? I can imagine wanting to just use Regarding fusing the MPO path, instead of fusing everything into the virtual spaces, we could (at some point) try to keep the virtual MPO legs around explicitly as auxiliary legs for MPS tensors when they are encountered. The problem is then to contract two "matching" auxiliary legs corresponding to the same virtual MPO bond when they encounter each other in two tensors being contracted. This is a lot more tedious to do in our framework, since we don't have "labeled" tensor indices that recognize each other automatically. Here we can just pass around explicit labels for all of the auxilary legs that come from a virtual MPO bond, and keep track of them. Not sure how feasible this is, and definitely not sure if this is something we want to do here, but just wanted to bring it up already. Regarding fermion support, I'm not sure if I'm entirely following the discussion. I think the MPSKit routines should just be able to handle physical spaces with a "non-standard" duality. Using planar operations where possible should ensure this just works, in the way that is consistent with MPSKit conventions. Therefore, I don't really see the need to consider dispatching away from planar operations. The only reason for this as far as I'm concerned would be to ensure differentiability, which is not a goal at all for now I think. So even flipping this east env space shouldn't be necessary, I think. The only reason to not use planar operations should be if we simply can't, e.g. for multi-layer networks. There, we have to overload the core contractions used in MPSKit anyway, but we additionally have to put additional twists to ensure the result is what is expected by MPSKit conventions. For the MPSKit contractions already overloaded in PEPSKit, this should have been done in a way that they can also handle arbitrary arrow directions. For multiplying in the bottom boundary, I would really like to avoid (doubly) conjugating edge tensors, this always leads to issues sooner or later in my experience. The question then becomes if we need to twist anything on the resulting top MPS (after all of the MPO applications) to ensure we can just contract in south edges in the usual way and actually get what we want. I'm not entire sure about that. |
|
In principle I should split this PR in two: first focusing only on
I agree that needing an additional
It is already there, called Currently this struct is not exported. Instead, we provide kwargs WindowApprox(Zipup(; trunc), _approx_dmrg(maxiter))
I want to postpone this. Currently
Changing arrow directions in MPSKit is like planar contraction with flippers without twists. But this is not the case in PEPSKit, where we should use
In the cache |
(This PR requires QuantumKitHub/MPSKit.jl#470 which has not been released yet. @lkdvos)
Summary
This PR adds approximate expectation-value contractions using boundary MPS method for finite windows of a single-layer
InfinitePEPO:MPOObservablerepresents a physical OBC-MPO acting on a path of the 2D network.expectation_value_approxmeasures the expectation value ofMPOObservable.correlator_approxspecializes on 2-site correlators on many bonds, with a caching mechanism to reuse intermediate contraction results.The implementation converts CTMRG boundaries to finite MPSs, applies PEPO rows as finite MPOs with MPSKit's zip-up contraction, optionally refines each MPO-MPS product with one-site DMRG, and closes the window against the opposite CTMRG boundary.
Design
Note
This is definitely not finalized, and up to further improvements.
Path-based MPO observables
MPOObservablestores three aligned pieces of information:sites: lattice sites on which physical MPO tensors act;mpo: the corresponding OBC-MPO tensors, withmpo[k]acting onsites[k];path: a non-self-intersecting nearest-neighbor path containingsitesin MPO order and any intermediate sites needed to route the virtual string.The purpose of
pathis to avoid materializing aBraidingTensorat each of the routing sites.An
MPOObservablecan be built from explicit MPO tensors, from an manually routed path, or from a denseAbstractTensorMap. The dense constructor will first order the sites to be acted, decompose the operator to an MPO, and automatically choose a path to connect the sites.Note
Currently the automatic
pathrouting does not work for allsites.Fusing an MPO path into a PEPO
The functions
mpo_path_first,mpo_path_middle,mpo_path_last, andmpo_path_stringapplies the physical MPO on the iPEPO, and then trace out the physical legs. The virtual strings of the MPO are fused with the iPEPO tensor virtual legs. It is assumed that each site can only be passed by the MPO once, hence the requirement that the MPO path is not self-intersecting.Note
Fusing the MPO strings with the iPEPO virtual legs is not the optimal way to contract, especially for the routing sites.
Finite-window contraction
For row-by-row contraction of a rectangular window in the iPEPO from north to south,
expectation_value_approxproceeds in the following steps.FiniteMPSfrom CTMRG corners and north edges;FiniteMPOrow from the west/east CTMRG edges and traced or observable-modified PEPO tensors;approximate((W, psi), Zipup(...));DMRG;dot.The south tensors are conjugated and permuted when the boundary MPS is built, in order to cancel the conjugation applied to the first argument of
dot.Column sweeps reuse the same backend by rotating the PEPO, CTMRG environment, coordinates, and observable. With
direction = :auto, wide windows use row sweeps and tall or square windows use rotated column sweeps.WindowApproxis an internal, unexported wrapper for the zip-up and optional DMRG algorithms. Public callers only choosetrunc,maxiter, anddirection. By default,truncistruncrank(chi), wherechiis the largest CTMRG corner-space dimension;maxiter = 0disables DMRG refinement.Two-site correlators with caching mechanism
correlator_approxis specialized to measure the same two-site operatoropon many bonds (using one window that covers all bonds, even if some bonds can be covered with a smaller window) with a caching mechanism to reduce repeated contractions. The cache stores:bondsshould not contain duplicates. First, each bond is ordered geometrically. After ordering, the first and the second site is referred to as the "source" and the "target", respectively.A
swappedflag records if the bond is reversed by the ordering.Bonds with the same source and
swappedflag are put in one evaluation group to share common contractions. For row-by-row contraction,correlator_approxproceeds as follows:correlator.Thus rows before the source and after the target are reused through north/south caches, the vertical string is propagated once per source, and horizontal segments are shared between ordered targets.
TODO
The most important task is adding the support for fermions.
EdgeTransferMatrixto avoid double conjugation of the south boundary and easier generalization to the case of iPEPS and purified iPEPO.