2026 Volume 35 Issue 2
Article Contents

Yantao Wu, Zhehao Dai. Algorithms for variational Monte Carlo calculations of fermion projected entangled pair states in the swap gates formulation and the detailed balance of tensor network sequential sampling[J]. Chinese Physics B, 2026, 35(2): 020502. doi: 10.1088/1674-1056/ae2673
Citation: Yantao Wu, Zhehao Dai. Algorithms for variational Monte Carlo calculations of fermion projected entangled pair states in the swap gates formulation and the detailed balance of tensor network sequential sampling[J]. Chinese Physics B, 2026, 35(2): 020502. doi: 10.1088/1674-1056/ae2673

Algorithms for variational Monte Carlo calculations of fermion projected entangled pair states in the swap gates formulation and the detailed balance of tensor network sequential sampling

  • Received Date: 20/09/2025
    Accepted Date: 27/11/2025
    Available Online: 01/02/2026
通讯作者: 陈斌, bchen63@163.com
  • 1. 

    沈阳化工大学材料科学与工程学院 沈阳 110142

  1. 本站搜索
  2. 百度学术搜索
  3. 万方数据库搜索
  4. CNKI搜索

Figures(4)  /  Tables(2)

Article Metrics

Article views(182) PDF downloads(1) Cited by(0)

Access History

Algorithms for variational Monte Carlo calculations of fermion projected entangled pair states in the swap gates formulation and the detailed balance of tensor network sequential sampling

Abstract: In recent years, variational Monte Carlo (VMC) calculations of projected entangled pair states (PEPS) have emerged as a competitive method for computing the ground states of many-body quantum systems. This approach is particularly important for fermionic systems, where sign problems are prevalent. We derive and explain the algorithms for VMC calculations of fermionic PEPS within the swap-gates formulation. As a separate key result, we prove the detailed balance for sequential sampling of tensor networks.

1.   Introduction
  • Numerical computation of ground states of two-dimensional many-body fermion systems is a fundamental problem in condensed matter physics. Due to fermion exchange, sign problems are prevalent in quantum Monte Carlo simulations[1] for fermions, making the method challenging for a broad range of signful systems. Based on the variational principle of energy, variational calculations using a wavefunction ansatz can potentially provide a better alternative for signful systems, if challenges in representation and optimization are overcome. In one dimension, a fermion system can be mapped to a system of hard-core bosons via the Jordan–Wigner (JW) transformation,[2] which can then be variationally solved using matrix product states (MPS) as the wavefunction ansatz, optimized via the density matrix renormalization group algorithm.[3]

    In two dimensions, the JW transformation introduces non-locality; an alternative wavefunction ansatz that preserves locality in fermion systems is more suitable for representing ground states of local Hamiltonians. Fermion projected entangled pair states (fPEPS)[4–7] are designed for this purpose: given an fPEPS state, if a local operator supported in region R acts on the state, only the tensors within R are affected. The initial formulation of fPEPS is based on virtual fermions living on the virtual bonds of the PEPS. Later, equivalent formulations based on swap gates[8,9] or Grassmann numbers[10,11] have also been adopted to study fPEPS.

    Optimizing a PEPS for the ground states of strongly correlated systems[12,13] remains a long-standing challenge in the field. Recently, variational Monte Carlo (VMC) optimization has emerged as the method yielding the lowest computed ground state energies for several challenging systems.[14–19] In particular, it has achieved the state-of-the-art result for the fermion Hubbard model at 18 hole doping,[11] a particularly challenging and important regime. In the appendix of Ref. [11], the VMC algorithm is explained for fPEPS in the Grassmann formulation. However, the Grassmann formulation requires subtle reimplementations of tensor network operations, and it is not entirely clear how to adapt it to fPEPS implementations written in the swap gates formulation, one of the simplest formulations used in the field. Here, we derive and demonstrate the VMC algorithm in the swap gates formulation, and explicitly spell out the implementation of fermion sign in each step of the algorithm.

    Crucially, as we explain the sampling algorithm, we also prove the detailed balance of sequential sampling of PEPS,[20] which has remained unclear and unproved until now.

    This paper is organized as follows. In Section 2, we explain fPEPS in the swap gates formulation. In Section 3, we explain the VMC algorithm of fPEPS and prove the detailed balance of sequential sampling. In Section 4, we demonstrate the VMC results for certain representative fermion systems. In Section 5, we provide discussion and conclusions.

2.   fPEPS in the swap gates formulation
  • The tensor product structure of the many-body fermion Hilbert space can be established by mapping it to a (hard-core) boson Hilbert space via prescribing an order to the fermion modes, equivalent to using a JW string. On a square lattice, in the swap gates formulation, the ordering of the fermion modes is shown in Fig. 1. One first extends the physical legs of all tensors towards the bottom-left and terminates them outside the network, then orders the fermion modes starting from the top-left tensor, counter-clockwise, until reaching the bottom-right tensor. This defines the computational basis of the many-fermion Hilbert space

    where si = 0 or 1 specifies whether the i-th fermion mode is occupied or not. N is the total number of complex fermion modes, and |vac⟩ is their common vacuum.

    An fPEPS is composed of ℤ2-symmetric tensors, where each virtual leg, indexed by k = 1, 2,…, D, carries a parity charge Pk = 0 or 1. At every site i, the five-leg fPEPS tensor is required to have even parity

    where l, r, d, u denote the indices for the left, right, down, and up virtual legs of A at site i. The physical leg s is extended towards the bottom-left, and each time it crosses another leg with index k, a swap gate is inserted

    An fPEPS state |Ψ⟩ is defined via its amplitude in the basis |s⟩: ⟨s|Ψ⟩ equals the contraction of the 2D swap-gates-decorated tensor network, with physical indices projected to s.

    The fPEPS defined above has two key features.

    (i) Well-definedness: as a physical leg is extended, there are multiple ways by which virtual bonds are crossed. These different ways are equivalent due to the gauge constraint Eq. (2).

    (ii) Locality: when acted upon by a fermion operator in a local region, even if separated by a long JW string, e.g., c5†c9 in Fig. 1, only the tensors within that local region are affected.

    See the appendix of Ref. [21] for a detailed explanation. In our algorithm, we adopt the configuration drawn in Fig. 1, where physical legs are bent flat enough so that they only cross vertical virtual legs and do not cross each other.

    Computing the amplitude ⟨s|Ψ⟨ is the core of the VMC algorithm, as explained in the next section.

  • For spinful fermions, the local physical dimension is 4: si = (si↑, si↓), and the fermion modes in |s⟩ are ordered as s1↑, s1↓, s2↑, s2↓, …. One can encode |00⟩, |↑ 0 ⟩, |↑↓⟩, |0↓⟩ as s = 0,1,2,3, so that the parity Ps = s mod 2.

  • In the sampling framework, a definite particle number M can be imposed by sampling only over product states s with particle number equal to M. This approach is equivalent to computing the properties of PM|Ψ⟩ instead of |Ψ⟩, where PM is the projector onto the total number sector M. Implementing the projector via sampling instead of tensors increases the representability of the variational ansatz over the bare fPEPS. We adopt number conservation in this way in Section 4.

3.   VMC of fPEPS
  • In VMC, the expectation value of an operator K is calculated as

    which is obtained by sampling s from the probability distribution p(s)=|〈s|Ψ〉|2〈Ψ|Ψ〉, and averaging over the estimator Kloc(s)=〈s|K|Ψ〉〈s|Ψ〉.

    To obtain |Ψ⟩ as an approximate ground state of a Hamiltonian H, one performs optimization to minimize 〈Ψ|H|Ψ〉〈Ψ|Ψ〉s|Ψ based on the gradients of ⟨H| with respect to the complex conjugate[22] (denoted by an overhead bar) of the parameters θα in the wavefunction ansatz

    where [·] denotes statistical averaging with respect to p(s). Oα(s) is the log-derivative of ⟨s|Ψ⟩ with respect to θα

    Four subroutines are required in a VMC calculation:

    (i) Computing the amplitude ⟨s|Ψ⟩.

    (ii) Computing the log-derivative ∂〈s|Ψ〉/∂θα〈s|Ψ〉.

    (iii) Computing the local energy 〈s|H|Ψ〉〈s|Ψ〉.

    (iv) A Monte Carlo update to sample s from p(s).

    We now detail the above in the context of fPEPS. We consider an fPEPS of size Lx × Ly and bond dimension D.

  • For any given sample s, the index of each physical leg at site i is fixed to si. The 5-leg tensor A[i]lrdus then becomes a 4-leg tensor A˜[i]lrdu=A[i]lrdusi, with total ℤ2 charge equal to Psi

    Pictorially, the tensor after sampling is represented by changing the physical legs to dashed lines. A dashed line is no longer an index of the tensor, but a fixed number used to keep track of its ℤ2 charge. We draw it only when needed for swap gates.

    Correspondingly, for a given s, the swap gate reduces to a gate in the Hilbert space of the virtual leg

  • The amplitude ⟨s|Ψ⟩ can be evaluated using boundary MPS (bMPS) contraction. This needs the bMPS left environments (LE) or right environments (RE). Both LE and RE are a list of bMPS with maximal bond dimension D′ > D. LE[0] is taken as the trivial MPS, and LE[x] is then iteratively computed for x = 1 to Lx as

    where sx,y is the value of the sample at the coordinate (x,y).

    Similarly, RE[Lx+1] is the trivial MPS, and RE[x] is iteratively computed for x = Lx to 1 as

    where s˜x,y≡(∑x′≥xsx,y)mod2 is the sample assoicated with RE[x][y]. It can be updated as s˜x,y=(sx,y+s˜x+1,y)mod2.

    Equations (9) and (10) are both implemented via MPO-MPS variational compression with complexity O(D′3D2 + D′2D4).[20] The amplitude is then computed as

  • The variational parameters of an fPEPS are the ℤ2 symmetric tensors A[i]lrdupi with i labeling the sites. Given sample s, the log-derivative of ⟨s|Ψ⟩ with respect to A[i] is 0 for pi ≠ si. For pi = si, the log-derivative is computed as the contraction of the 2D network with a hole at site i

    This can be contracted exactly with complexity O(D′3D2 + D′2D4).

  • Consider a short-range Hamiltonian with fermion hopping and an interaction diagonal in the basis s. For diagonal terms O in the Hamiltonian, the local energy is simply its diagonal element: 〈s|O|Ψ〉〈s|Ψ〉=Os,s. Thus, it suffices to compute the local energy for the hopping terms.

    To compute 〈s|ci†cj|Ψ〉s|Ψ, one acts the hopping operator on ⟨s| and properly accounts for the JW sign: 〈s|ci†cj=(−1)#ij〈s′|, where #ij is the number of fermions in s between (excluding) sites i and j along the JW string

    Here, s′ and s differ only locally, and ⟨s|Ψ⟩ and ⟨s′|Ψ⟩ should be computed using the same LE and RE.

  • The locality of an fPEPS allows extensive reuse of LE and RE. For any neighboring sites i and j, one can perform a 2-site local update: if a particle occupies exactly one of the two sites, swap the occupation and propose the post-swap configuration s′, and accept s′ with probability

    otherwise, do nothing and keep the current s.

    One MC sweep is defined as performing one 2-site local update for every nearest-neighbor vertical and horizontal bond on the lattice. The updates are performed sequentially: starting from the site (x,y) = (1,1), then moving to (1,2), and continuing up to (1,Ly); next, moving to the column at (2,1), and so on until reaching the top-right corner of the lattice. This procedure is called sequential sampling, first proposed in Ref. [20]. Its main advantage is the ability to reuse LE and RE during the MC sweep. The computational complexity of one MC sweep is O(LxLyD′2D4).

    It is, however, not immediately obvious that sequential sampling is reversible, i.e., satisfies detailed balance, due to the apparent ordering in the updates. This issue has remained unclear until now. In the next section, we prove that sequential sampling satisfies detailed balance, guaranteeing convergence to a unique stationary distribution p(s), provided that the MC update is also irreducible and aperiodic.

  • Consider a system of N spins or fermion modes. Let the sample space Ω be the product of N local sample spaces Ωi. Let s = (s1, s2,…, sN) ∈ Ω, where si ∈ Ωi. Given the target probability distribution π(s), the sequential sampling procedure is defined as follow: Sequential sampling.

    fori ← 1 toNdo
           Denote the spin configuration as s
           Fix all spins excluding spin i: s≠=i
           Sample new spin si′ with transition
               probability pi(si→si′|s=i) that satisfies
               the conditional detailed balance,
               restricted to spin i:
                   pi(si→si′|s≠i)π(s1:i−1,si,si+1:N)
                   =pi(si′→si|s=i)π(s1:i−1,si′,si+1:N)
    where sa:b ≡ (sa, sa + 1,…, sb).

    Theorem 1 Algorithm 1 (sequential sampling) satisfies detailed balance with π(s) as the stationary distribution.

    Proof We take N = 3 for notational simplicity. It is straightforward to see that the proof generalizes to arbitrary N. Consider s = (s1, s2, s3) and s′=(s1′,s2′,s3′) before and after one step of sequential sampling. By conditional detailed balance:

    Multiplying the three equations yields the detailed balance condition for sequential sampling:

    where p(s → s′) denotes the transition probability from s to s′ in one step of sequential sampling.

    This proof naturally generalizes to the case where conditional sampling is performed over multiple sites in a local region instead of a single site.

  • To obtain the ground state in the context of VMC, one often employs the method of stochastic reconfiguration (SR), which we also adopt in Section 4. SR is extensively discussed in the literature [23], and its application to fPEPS is no different. We summarize the details here for completeness.

    Let θ be a complex vector containing all variational parameters in an fPEPS. Instead of performing steepest descent: θα′=θα−δ⋅∂〈H〉∂θα¯, where δ is the step size (also called learning rate), one descends along a direction X, i.e., θ′ = θ − δ · X, where X solves

    Here, Sαβ is the quantum metric,[24] the unique metric on the variational manifold under which the geodesic distance between two points is proportional to the 2-norm distance between the corresponding quantum states in Hilbert space. It can be estimated via sampling

    The quantum metric matrix S is typically ill-conditioned. In practice, X is obtained by solving (S + ε) X = g, where ε is a small regularization term.

4.   Examples
  • We consider several paradigmatic free fermion examples to benchmark the VMC algorithm for fPEPS: the sublattice band insulator (Insulator), Dirac semimetal (Dirac), the ϕ = 2π/3 Hofstadter model with Chern number 1 (Chern), and a system with a Fermi surface (Fermi)

    where |tij| = 1 in all systems. For the Chern model, the phases of tij set the flux. For the Dirac model, vertical hoppings are 1 (−1) along even (odd) columns, while horizontal hoppings are all 1. For the Insulator and Fermi models, all tij = 1. We set μi = ±1 for the two sublattices in the Insulator; μi = 0 for other models. For the Insulator, Dirac, and Fermi models, we fix the particle number at half-filling. For the Chern model, we fix the particle number at 2/3 filling.

    The hyperparameters of the VMC algorithm are listed in Table 1. Excessive fine-tuning is not required for these parameters.

    As shown in Fig. 2, the fPEPS VMC performs very well for the 10 × 10 insulator and Dirac models, as well as the 12 × 12 Chern model, achieving energy density errors on the order of 10−5. For the Fermi model, the calculation is more challenging, as expected, due to its large entanglement and high density of states near the ground state.

    An interesting comparison is with boson PEPS representing the ground state of the fermion systems. Given a fixed computational basis, one may choose to represent the wavefunction amplitudes of the fermion system as a boson PEPS, without employing swap gates. To obtain the ground state, one needs to perform a JW transformation to construct a bosonic Hamiltonian and then run the bosonic algorithms. In the VMC algorithm, the long-rangeness of the JW string does not introduce any algorithmic difficulty in computing the energy gradient, since it is diagonal in the sampling basis. This contrasts with traditional PEPS methods, such as the simple or full update.[25–27] For the VMC algorithm, the difference between boson PEPS and fPEPS arises solely from the representational power of the ansatz. Because the fPEPS ansatz maintains locality under local gate actions, it is expected to provide a better approximation for the ground states of local fermion Hamiltonians, which is indeed observed in Fig. 3. In fact, the performance of boson PEPS is so poor that we could not even converge the calculation for a 10 × 10 system on the first attempts, so we illustrate results using 4 × 4 (and 6 × 6 for Chern) systems. We expect this difference to become even more pronounced for larger system sizes.

  • We also include a benchmark on the 4 × 4 Hubbard model with U = 8 at half-filling. Its Hamiltonian is

    where ci,σ denotes the fermion annihilation operator on site i with spin σ = ↑ or ↓. We work at half-filling, i.e., ∑ini,↑=∑ini,↓=8.

    The VMC results are shown in Fig. 4. As seen, the energy error is significantly larger than in the free fermion models, indicating substantial entanglement. For comparison, a recent fPEPS study using exact gradient optimization and double-layer contraction reports an energy density error of 4 × 10−3 with SU(2) symmetry at D = 6, and 2 × 10−2 with U(1) symmetry at D = 7.[28]

    Another application of the current algorithm to the 8 × 8 Hubbard model with next-nearest-neighbor hopping at 1/8 hole doping is reported in Ref. [29], with bond dimension D = 10, showing comparable accuracy to state-of-the-art neural quantum state ansatz.[29]

5.   Conclusion
  • In this paper, we derived and explained the VMC algorithm for fermion PEPS in the swap gate formulation, highlighting its algorithmic simplicity and elegance. We also presented results demonstrating the effectiveness of the algorithm. In addition, we proved the detailed balance for sequential sampling, which has remained unclear in the field until now.

    The main future direction of this work is the application of this algorithm to challenging interacting fermion systems, such as chiral spin liquids and superconductivity in the Hubbard model. Beyond applications, an important open question is to develop a framework where systems with a Fermi surface can be reliably simulated. This may require non-trivial modifications of the PEPS structure but should be possible within the flexible VMC framework.

Figure (4)  Table (2) Reference (32)

Catalog

    /

    DownLoad:  Full-Size Img  PowerPoint
    Return
    Return