Skip to content

NTU: approximate contraction of a finite part of iPEPS #188

Open

Description

@Yue-Zhengyuan

In neighborhood tensor update (NTU), the environment of a bond can be a finite patch around the bond. For example, if we contain two more layers around a bond, the environment is (the bra is contracted with ket)

    (-2 -2)═(-2 -1)═(-2 +0)══(-2 +1)═(-2 +2)═(-2 +3)
       ║       ║       ║        ║        ║        ║
    (-1 -2)═(-1 -1)═(-1 +0)══(-1 +1)═(-1 +2)═(-1 +3)
       ║       ║       ║        ║        ║        ║
    (+0 -2)═(+0 -1)════Q0══   ══Q1═══(+0 +2)═(+0 +3)
       ║       ║       ║        ║        ║        ║
    (+1 -2)═(+1 -1)═(+1 +0)══(+1 +1)═(+1 +2)═(+1 +3)
       ║       ║       ║        ║        ║        ║
    (+2 -2)═(+2 -1)═(+2 +0)══(+2 +1)═(+2 +2)═(+2 +3)

This is called EnvApproximate of type 65 in YASTN documentation. May I ask @leburgel if MPSKit already have boundary MPS method to contract such a finite network? Alternatively, @pbrehmer how can I use CTMRG to contract it? (In my mind CTMRG is for infinite size, so it's not quite clear to me how to apply it to a finite system).

Activity

  1. leburgel commented on May 1, 2025

    @leburgel
    Member

    Using MPSKit, you could contract the patch from the top to towards the open bond by using the approximate algorithm to sequentially approximately contract a finite MPO slice of the patch into the top boundary MPS and return another MPS, until you've contracted everything above the open bond. You could then do the same starting from the bottom (where you would have to be a bit careful with how you pass the MPS and MPO slices to the algorithm, since the algorithm always assumes an MPO to be contracted into an MPS from below, where here you contract it from above). After this you have just the MPO-like slice with the open bond, and a top and bottom finite boundary MPS, at which point you can contract everything manually.

    So this is not really a plug-and-play built-in routine, but it can definitely be done using MPSKit.approximate.

  2. pbrehmer commented on May 1, 2025

    @pbrehmer
    Collaborator

    ... how can I use CTMRG to contract it? (In my mind CTMRG is for infinite size, so it's not quite clear to me how to apply it to a finite system)

    From what I've head, in principle one can also use CTMRG for contracting finite environments with reasonable accuracy but I have no experience with this. I would be skeptical if that would be a viable approach for small-ish finite environments like the one you're trying to contract. In any case, the current CTMRG implementation only works for infinite lattices. The boundary MPS technique Lander suggested seems to be the way to go, I think.

  3. Yue-Zhengyuan commented on May 1, 2025

    @Yue-Zhengyuan
    MemberAuthor

    Indeed in YASTN they use the boundary MPS approach. I'll try to implement this feature in near future as an option to NTU (#144).

  4. Yue-Zhengyuan commented on May 6, 2025

    @Yue-Zhengyuan
    MemberAuthor

    @leburgel Looking at the method signature of approximate:

    approximate(ψ₀, (O, ψ), algorithm, [environments]; kwargs...) -> (ψ, environments)

    I wonder what's a good way to obtain the initial guess ψ₀? Do you just use local SVD truncation on each bond? Actually I have one method based on some sort of "projectors" (it's exact for truncation of one bond on an OBC-MPS), but maybe you have a better approach.

  5. Yue-Zhengyuan commented on May 6, 2025

    @Yue-Zhengyuan
    MemberAuthor

    In addition, do we already have a function to construct an InfinitePartitionFunction from $\langle \psi | \psi \rangle$ so I don't need to write again? To use the MPSKit functions it is easier to first merge the virtual legs of the bra network and the ket network.

  6. lkdvos commented on May 6, 2025

    @lkdvos
    Member

    I think I added a mpotensor function recently in PEPSKit that takes a sandwich and spits out the correct MPOTensor, which you can then use in MPSKit. In principle the goal would be to be able to work with the double-layer objects directly as well, but there are definitely some parts missing there so it can be a good short-term solution to map to a single-layer network first.

  7. Yue-Zhengyuan commented on May 6, 2025

    @Yue-Zhengyuan
    MemberAuthor

    Suppose that for convenience, I merge the virtual indices in such a way that the two-layer cluster is converted to a single-layer network with the following choice of arrows:

        C ← E ← E --←-- E ← E ← C
        ↓   ↓   ↓       ↓   ↓   ↓
        E ← T ← T --←-- T ← T ← E
        ↓   ↓   ↓       ↓   ↓   ↓
        E ← T ← X ←   ← Y ← T ← E
        ↓   ↓   ↓       ↓   ↓   ↓
        E ← T ← T --←-- T ← T ← E
        ↓   ↓   ↓       ↓   ↓   ↓
        C ← E ← E ← E ← E ← E ← C
    

    and I compress the cluster horizontally starting from the left and right boundary. The right boundary is a very standard ket MPS, and the column transfer MPO acts on its left. However, the left boundary is a bra MPS, and the column transfer MPO acts on its right.

    It seems that adjoint is not defined for a FiniteMPS in MPSKit (although it is for FiniteMPO). @leburgel @lkdvos Can MPSKit actually handle a bra MPS? If not, can you suggest a workaround?

  8. lkdvos commented on May 8, 2025

    @lkdvos
    Member

    @leburgel do you happen to have an example laying around of doing the required mapping to go from ket to bra?

  9. leburgel commented on May 8, 2025

    @leburgel
    Member

    I've definitely done this a few times, let me see if I can dig up an example when I find some time.

  10. Yue-Zhengyuan commented on Jul 16, 2026

    @Yue-Zhengyuan
    MemberAuthor

    @leburgel Do you have some time recently for this example of conjugating an MPS? I may start working on long-range expectation values (#396) based on it.

  11. leburgel commented on Jul 30, 2026

    @leburgel
    Member

    @leburgel Do you have some time recently for this example of conjugating an MPS? I may start working on long-range expectation values (#396) based on it.

    I did some digging and found a local script where I do something like this from a while back, for contracting partition functions of finite statistical mechanics models. Let me dust that off and I'll post a link to a corresponding gist soon.

    However, if I did this again now I just wouldn't treat the last row/column as a FiniteMPS instance. To do this you have to conjugate it, just because MPSKit then conjugates it again in things like dot(::FiniteMPS, ::FiniteMPS). We can just use a sequential edge_transfer_left to contract in this last line, without having to conjugate anything.

  12. leburgel commented on Jul 31, 2026

    @leburgel
    Member

    I bundled everything I already had on contracting finite patches as well as a few new aspects into a single script here. Sorry about the delay, but hopefully this helps @Yue-Zhengyuan. In particular, this should do exactly do what you mentioned in your comment above.

    The details are entirely up for debate, but I definitely prefer the approach of contract_network_via_edge from the gist, circumventing the need to conjugate a FiniteMPS at any point.

  13. leburgel commented on Jul 31, 2026

    @leburgel
    Member

    After a bit of struggling I also managed to get the example running directly using the double-layer structure of the PEPS overlap network. This required quite a bit of hacky patches of MPSKit internals to work with MPSKit.FiniteMPO and MPSKit.FiniteMPS where the number of legs of the MPS and MPO tensors is not the same on all sites. I'll try to clean this up and add the example next week, but for now the above should also work by squashing the local PEPS sandwiches down to rank-4 tensors using PEPSKit.mpotensor.

    Linking the draft example using the double-layer structure here already, just in case I lose track of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions