Correlator for purified iPEPO and right-to-left contraction#399
Correlator for purified iPEPO and right-to-left contraction#399Yue-Zhengyuan wants to merge 13 commits into
Conversation
| c = i # current column being handled | ||
| Vn, Vo = start_correlator_left(c, bra, O[1], ket, env) | ||
| j_last = last(js) | ||
| return map(enumerate(js)) do (_, j) |
There was a problem hiding this comment.
When I try just writing map(js) do j, the test test/utility/correlator.jl starts to use lots of memory and becomes slow. Would like some guide from @lkdvos in understanding what's going on...
There was a problem hiding this comment.
I realized that this may be due to things inside map modifying c, Vn, Vo that are defined outside. I've restored the old approach to first pre-allocate the correlator vector.
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
It turns out that none of edge_transfer_right is used in PEPSKit. Instead of commenting them out, I prefer to just remove them, keeping things minimal.
There was a problem hiding this comment.
I agree removing them is the cleanest thing to do, but can you add a corresponding entry in the "Removed" section of the changelog with a link to this PR? That way we can find them in the git history easily, since this will be impossible to spot just from the PR title alone.
There was a problem hiding this comment.
@leburgel Since you helped introduce
EdgeTransferMatrixback in #274, can you have a look and see if you actually wanted to useedge_transfer_rightsomewhere else?
I am using them somewhere in a project that depends on PEPSKit, but I can just pin that to a version that still has them. I don't have a use case within PEPSKit itself yet, so it's indeed best to just remove them for now.
There was a problem hiding this comment.
Actually I wanted to implement correlators for j on the left of i. In this case, if we don't want to rotate the state by 180 degrees, we need to contract from right to left, and use edge_transfer_right. This way we can test and save them in the package.
| function end_correlator_numerator( | ||
| j::CartesianIndex{2}, V::CTMRGEdgeTensor{T, S, 3}, | ||
| function end_correlator_right_numerator( | ||
| j::CartesianIndex{2}, V::AbstractTensorMap{T, S, 3, 1}, |
There was a problem hiding this comment.
Since the V tensors (partially contracted correlator network) are not actually CTMRG edge tensors, I prefer just annotate their type using AbstractTensorMap.
This PR improves the
correlatorfunction by adding support for purified iPEPO and removing some constraints on sitesjs, with some under-the-hood deduplications.expectation_value.jsmay contain targets on either side ofi.jsno longer need to be sorted.jscan contain sites on both sides ofi.vec(js).j == iis rejected withArgumentError.edge_transfer_rightpaths forjson the left ofi.Implementation Notes
The shared correlator implementation now dispatches through private context types:
_PEPSCorrelator_PEPOPurifiedCorrelator_PEPOTraceCorrelatorThe horizontal sweep partitions
jsinto right and left sites internally:Low-level tensor contractions remain separate where the tensor ranks genuinely differ.