Principle of learning sign rules by neural networks in qubit lattice
  models
A neural network is a powerful tool that can uncover hidden laws beyond human
intuition. However, it often appears as a black box due to its complicated
nonlinear structures. By drawing upon the Gutzwiller mean-field theory, we can
showcase a principle of sign rules for ordered states in qubit lattice models.
We introduce a shallow feed-forward neural network with a single hidden neuron
to present these sign rules. We conduct systematical benchmarks in various
models, including the generalized Ising, spin-$1/2$ XY, (frustrated) Heisenberg
rings, triangular XY antiferromagnet on a torus, and the Fermi-Hubbard ring at
an arbitrary filling. These benchmarks show that all the leading-order sign
rule characteristics can be visualized in classical forms, such as pitch
angles. Besides, quantum fluctuations can result in an imperfect accuracy rate
quantitatively.
Jin Cao, Shijie Hu, Zhiping Yin, Ke Xia
# The principle of learning sign rules by neural networks in qubit lattice models

###### Abstract

A neural network is a powerful tool for generalizing hidden laws beyond human intuition; however, it looks like a black box due to complicated nonlinear structures. Based on the Gutzwiller mean-field theory, we exhibit a principle of learning sign rules for the ordered states in qubit lattice models. Accordingly, we construct a shallow feed-forward neural network with a single hidden neuron and systematically make benchmarks in the generalized Ising, XY, frustrated Heisenberg chains, antiferromagnetic XY on the triangle lattice, and the Fermi-Hubbard chain at an arbitrary filling. All the leading-order or mean-field sign rule characters are visualized in classical forms, such as the gauge field gradient, pitch angles, etc. Besides, quantum fluctuations violate the sign rule and quantitatively yield an imperfect accuracy rate in the prediction.

Hidden information decoded in the wave function of the ground state benefits understanding properties of quantum closed systems at zero temperature, including orders, correlations, and even intricate entanglement features, etc [1; 2; 3; 4]. Especially for a real Hamiltonian, phases of elements in the wave function reduce to a _sign rule_ in a selected representation, e.g. Perron-Frobenius theorem for a class of Hamiltonian only having non-positive-definite off-diagonal elements [5; 6], Marshall-Peierls rule (MPR) for antiferromagnetic spin models on bipartite lattices [7; 8; 9]. In history, it has been recognized as an essential origin of the volume law for the Renyi entanglement entropies [10], which tightly links to various physical phenomena [11; 12; 13; 14].

Similar to the matrix product state (MPS) successfully applied to (quasi) one-dimensional (1D) lattice models [15; 16; 17; 18], the neural network quantum state (NNQS) and fast-developing machine learning (ML) techniques figure out a new way of multi-scale compression of the wave function, which has been vigorously promoted for 1D as well as higher-dimensional quantum many-body systems [19; 20; 21; 22]. With an appropriate choice of an empirical activation function _cosine_ in the hidden layer of NNQS, the complicated sign rules in qubit lattice models can be read out of the wave function [23], and relevant studies have drawn much attention in recent years [24; 25; 26; 27].

According to previous studies, the relatively higher complexity of the sign rule usually demands more hidden layers or neurons for a required representation precision [23; 24; 25; 26; 27]. On the one hand, it is beneficial in applications to improve sign rules by designing a new architecture or brutally enhancing the complexity of NNQS, benefitting from which quantum Monte Carlo (QMC) simulations are capable of reaching a higher numeric precision and the early proposal of avoiding the "negative sign problem" comes true [28; 29; 30]. On the other hand, recent concerns focus on interpreting the meaning of growing sophisticated neural networks [31; 32; 33] and preferably finding links to existing physical insights [34; 35; 36], which strongly motivates our work.

In this work, we establish a Gutzwiller mean-field (GWMF) principle in qubit lattice models, where the sign rules can be well learned by a single-hidden-neuron feed-forward neural network (shn-FNN). All findings, tested by various spin and fermion models, point that an existing leading-order sign rule has a vivid physical scenario tightly related to orders in spins or charges. The structure of the paper is organized as follows. In Sec. I, we unveil a GWMF picture of the sign rules for ordered ground states in qubit lattice models. In Sec. II, we introduce an shn-FNN in detail, which matches the GWMF picture and can easily be interpreted. In Sec. III, we adopt the shn-FNN to extract the GWMF sign rules in spin models and the Fermi-Hubbard model. Besides, we discuss the influence of frustration and global symmetries. At last, we summarize conclusions and make a brief discussion in Sec. IV.

## I I. Gutzwiller mean-field sign rules

A qubit denotes a quantum state \(|n\rangle\) widely in condensed matter physics, such as a spin-1/2 in quantum magnets [37], a single fermion state in ultra-cold atomic systems [38], a two-level atom in quantum cavities [39], and so on [40; 41; 42], where a binary value \(n=0/1\) denotes either an empty/occupied fermion level or a spin-1/2 polarizing \(\downarrow/\uparrow\) in the z-axis. For a lattice model, a state is depicted by a wave function \(|\psi\rangle=\sum_{\{\mathbf{n}\}}c_{\mathbf{n}}|\mathbf{n}\rangle\), where the real expansion coefficient \(c_{\mathbf{n}}=s_{\mathbf{n}}a_{\mathbf{n}}\) consists of the sign \(s_{\mathbf{n}}\) and amplitude \(a_{\mathbf{n}}\) in the representation of \(|\mathbf{n}\rangle=\otimes_{l=1}^{L}|n_{l}\rangle\) for \(L\) qubits or equivalent lattice sites. \(|n_{l}\rangle\) is the local basis at site-\(l\) with the quantum index
and forms a vector \({\bf n}=(n_{1},\,\ldots,\,n_{L})^{T}\).

Without loss of generality, we take a spin-\(1/2\) as an example. A spin \(\hat{\bf S}=(\hat{S}^{x},\,\hat{S}^{y},\,\hat{S}^{z})\) has three components in the \(x\), \(y\) and \(z\)-axes, respectively, as well as the spin-flipping-up and down operators \(\hat{S}^{\pm}\). In the \(\hat{S}^{z}\)-representation, only two free real variables are out of two complex coefficients in front of bases. They make up of a spin-coherent state \(|\Omega\rangle=c^{\dagger}\,|\uparrow\rangle+c^{\downarrow}\,|\downarrow\rangle\), where \(c^{\dagger}=\cos(\theta/2)e^{-i\phi}\) and \(c^{\downarrow}=\sin(\theta/2)\) are defined by a pair of angles \(\theta\) and \(\phi\) in a solid angle [43]. As convention, site-dependent \(\theta\in[0,\,\pi]\) and \(\phi\in[0,\,2\pi]\). In the case, a spin-\(1/2\)\({\bf S}=\langle\hat{\bf S}\rangle={\bf\Omega}/2\) behaves like half of the unit vector \({\bf\Omega}=(\sin\theta\cos\phi,\,\sin\theta\sin\phi,\,\cos\theta)\) in three dimensional Cartesian coordinates. So the sign for the basis with a non-vanishing amplitude only depends on \(\phi\) because both \(\cos(\theta/2)\) and \(\sin(\theta/2)\) are positive definite. Besides, an irrelevant free parameter \(h\) modulates the phase in front of the spin-coherent state, i.e. \(e^{ih}|\Omega\rangle\).

In the GWMF theory [44; 45], the wave function of a state is a product \(|\psi\rangle=\bigotimes_{l=1}^{L}|\Omega_{l}\rangle\) of bases for \(L\) spins. Therefore, after substituting the local spin-coherent state into the GWMF wave function, we can easily prove that a basis \(|{\bf s}\rangle\) with \({\bf s}=(s_{1},\,\cdots,\,s_{L})^{T}\) has a sign of \(s_{\bf n}={\rm Sgn}[\cos({\bf w}\cdot{\bf n}+\tilde{h})]\) and \({\bf n}=1/2+{\bf s}\), referencing from the all-spin-up basis (\(\uparrow,\,\ldots,\,\uparrow\))\({}^{T}\). The characteristic phase vector \({\bf w}=(\phi_{1},\,\cdots,\,\phi_{L})\) is clearly defined by a phase \(w_{l}=\phi_{l}\) at site-\(l\), which reflects the order of spins, called the leading-order or GWMF sign rule. The constant \(\tilde{h}=\sum_{l}h_{l}+h_{0}\) stems from dynamical phase factors \(h_{l}\) for all sites, while \(h_{0}\) or equivalently \(\tilde{h}\) is determined by other necessarily preserved global symmetries, e.g. translational and inversion symmetries.

In the case of a general magnetic order, referencing from a state \(|\Omega_{0}\rangle\), the local basis \(|\Omega_{l}\rangle=\prod_{p=1}^{N_{c}}\hat{R}_{l}({\bf\Omega}_{p},{\bf Q}_{p} \cdot{\bf r}_{l})|\Omega_{0}\rangle\) at site-\(l\) with the displacement \({\bf r}_{l}\) contains \(N_{c}\) spin-rotations \(\hat{R}_{l}({\bf\Omega},q)=\exp(iq\hat{\bf S}_{l}\cdot{\bf\Omega})\) by an angle \(q\) about the axis \({\bf\Omega}\)[46], where \({\bf\Omega}_{p}\) and \({\bf Q}_{p}\) are a characteristic solid angle and the corresponding momentum, respectively. The sign rule \(w_{l}\) is also hidden in \(|\Omega_{l}\rangle\) generated by the multi-\(Q\) rotations.

## II II. Single-hidden-neuron feed-forward neural network

Feed-forward neural network (FNN), considered a multi-layer nested function of variational parameters, is optimized according to the training sets and goal functions [47; 48; 49], which helps approximate any continuous functions [50; 51] and sort samples by discrete values of characters [49]. As FNN becomes deeper, the growing complexity prevents us from understanding the sign rule or making links to meaningful physics insights. We choose an shn-FNN analogous to previous shallow FNNs [32; 35], distinct from recently developed operations in a compact latent space [52; 53]. Let us briefly introduce how it works to learn the GWMF sign rules.

The double-valued sign \(s_{\bf n}\) of either positive or negative for arbitrary bases \(|{\bf n}\rangle\) can also be classified through a structure of FNN as shown in Fig. 1, constituted of an input layer, a hidden layer, and an output layer. We assign details of the configuration \({\bf n}\) to FNN without adornment, so simply the \(L\)-dimensional vector \({\bf y}_{I}={\bf n}\) in the input layer. \(N_{H}\) neurons in the hidden layer gives a vector \({\bf y}_{H}=(y_{H,1},\,\cdots,\,\,y_{H,N_{H}})^{T}\). Two neurons in the output layer form a one-hot vector \({\bf y}_{O}=(y_{O,1},\,y_{O,2})^{T}\). Three vectors are linked by two weight matrices \({\bf w}\) and \({\bf w}_{O}\), and corresponding activation functions. The activation function cosine is empirically chosen in the hidden layer so that \({\bf y}_{H}=\cos({\bf w}\cdot{\bf n})\), which performs excellently in the random search [23]. The function softmax defined in App. A executes normalization by an exponential function for gaining the meaning of probabilities before the classification of the sign. At last, the predicted sign \(y_{\rm sign}\) is determined by \({\bf y}_{O}={\rm softmax}({\bf w}_{O}\cdot{\bf y}_{H})\). In details, \(y_{\rm sign}\) is positive only if \(y_{O,1}>y_{O,2}\). For a configuration \({\bf n}\), we usually add a superscript \(({\bf n})\) to each variable, such as \({\bf y}_{O}^{({\bf n})}=(y_{O,1}^{({\bf n})},\,y_{O,2}^{({\bf n})})\) in the output layer.

Unless otherwise stated, we choose \(N_{H}=1\) and two unequal elements of \({\bf w}_{O}\), which gives the structure of shn-FNN exactly. So the shn-FNN representation for the sign rule reduces to a function

\[y_{\rm sign}={\rm Sgn}\left[\cos({\bf w}\cdot{\bf n})\right] \tag{1}\]

Figure 1: The feed-forward neural network (FNN) is designed to learn the sign rules for a quantum state of \(L\) qubits. There are \(L\), \(N_{H}\), and \(2\) neurons in the input (black squares), hidden (blue hexagons), and output (red circles) layers, respectively, which are linked by two weight matrices \({\bf w}\) (blue lines) and \({\bf w}_{O}\) (red lines). In particular, the hidden and output layers are activated separately by a cosine and a softmax functions. The sign suggested by FNN is positive if \(y_{O,1}>y_{O,2}\) and negative otherwise.
of the input configuration \(\mathbf{n}\), the signs are uniquely encoded into \(\mathbf{w}\), precisely equal to the GWMF sign rules mentioned above except for a constant \(\tilde{h}\). Later on, we will see that different constants related to global symmetries of the ground state can also be learned.

Besides, we make short statements about the choice of data sets and methods for training. We prepare the total data set \(\mathbf{T}\) after the ground state wave function is obtained by the exact diagonalization (ED) method. We sort samples in descending order of amplitude and discard ones that have \(a_{\mathbf{n}}<10^{-15}\) to avoid the artificial effects caused by the limited numeric precision of floating numbers. For a sample in \(\mathbf{T}\), the corresponding configuration \(\mathbf{n}\) gives a sign \(s_{\mathbf{n}}\) in a one-hot vector \(\mathbf{y}^{(\mathbf{n})}\) to make a quantitative comparison with the vector in the output layer easily. The vector \(\mathbf{y}^{(\mathbf{n})}=(y_{1}^{(\mathbf{n})},\,y_{2}^{(\mathbf{n})})\) only has two valid values: either (1, 0) for a positive \(s_{\mathbf{n}}\) or (0, 1) for a negative one. In practice, the adopted part of \(\mathbf{T}\) contains the first \(N_{s}\) samples, and the choice of \(N_{s}\) depends on the specific demand. Without a particular notification, these samples are randomly regrouped into two parts. Four out of five samples are used for training, while others give the testing set.

During training, the back-propagation (BP) [54] algorithm is used to optimize variables in \(\mathbf{w}\) and \(\mathbf{w}_{O}\) of FNN, associated with adaptively adjusting the learning rate by Adam algorithm [55]. The process is equivalent to the minimization of the cross entropy

\[\mathcal{S}_{\times}=-\sum_{\{\mathbf{n}\}}\left(y_{1}^{(\mathbf{n})}\ln y_{O,1}^{(\mathbf{n})}+y_{2}^{(\mathbf{n})}\ln y_{O,2}^{(\mathbf{n})}\right) \tag{2}\]

of two one-hot vectors by collecting contributions from all samples in the training set. To reduce the computational costs of training with a large data set, we usually use the so-called _mini-batch_[49, 56] method based on the stochastic gradient descent (SGD). In this work, 100 configurations are randomly selected from a training set to calculate the gradients of \(\mathbf{w}\) and \(\mathbf{w}_{O}\) according to Eq. (2) at each step. It performs very well on aspects of both accuracy and speeding up. In addition, the randomness of choice can also kill harmful effects induced by over-fitting. Moreover, we realize FNN and the Adam optimization based on the ML library "TensorFlow" [57].

To evaluate the performance of FNN or further trace the trajectory of the optimization process, we define the accuracy rate (AR) \(\text{AR}=\mathcal{N}_{s}^{c}/\mathcal{N}_{s}\) to suppose that \(\mathcal{N}_{s}^{c}\) out of \(\mathcal{N}_{s}\) configurations in a set are successfully classified. To correctly capture the GWMF sign rules through shn-FNN, we usually modulate \(N_{s}\) larger gradually until AR reaches its maximum.

## III III. Qubit Lattice Models

Next, we systematically analyze the GWMF sign rules learned by shn-FNN for various ordered states in qubit lattice models, including non-frustrated spin models in Sec. III A and frustrated ones in Sec. III B, and interacting fermions in Sec. III C.

## III III. Non-frustrated spin models

_Ising chains_. A generalized Ising chain has a Hamiltonian \(\hat{H}_{\text{Ising}}(J,\,\boldsymbol{\Omega})=J\sum_{l=1}^{L}(\hat{\mathbf{S }}_{l}\cdot\boldsymbol{\Omega})(\hat{\mathbf{S}}_{l+1}\cdot\boldsymbol{\Omega})\). For the case of a ferromagnetic coupling \(J<0\), the ground state favorites all spins aligned along the same axis, either \(\boldsymbol{\Omega}\) or \(-\boldsymbol{\Omega}\) exactly, which suggests uniform \(w_{l}=\phi\) or \(\pi+\phi\). In one of the double-folded degenerate manifolds as \(J>0\), spins at even sites are parallel to \(\boldsymbol{\Omega}\) with \(w_{l}=\phi\), while ones at odd sites are parallel to \(-\boldsymbol{\Omega}\) with \(w_{l}=\pi+\phi\). As \(J<0\) and \(\boldsymbol{\Omega}\) is along the x-axis \(\hat{x}\), a combination of \(\tilde{h}=0\) and \(w_{l}=0\) hits 100% AR as shown in Fig. 2(a).

_Spin-\(1/2\) XY chains_. For Spin-\(1/2\) XY chains, in the Hamiltonian \(\hat{H}_{\text{XY}}^{P}(J)=J\sum_{l=1}^{L}(\hat{S}_{l}^{x}\hat{S}_{l+1}^{x}+ \hat{S}_{l}^{y}\hat{S}_{l+1}^{y})=(1/2)(\sum_{l=1}^{L}J\hat{S}_{l}^{+}\hat{S}_ {l+1}^{-}+\text{h.c.})\), the spin couplings in the \(x\) and \(y\)-axes are equal. Once \(J<0\) with the periodic boundary condition (PBC), all spins in the GWMF ground state are aligned to the same polarization direction confined in the xy-plane with \(\theta_{l}=\pi/2\) and \(\phi_{l}=\varphi\). Infinite degenerate manifolds are connected by a two-dimensional rotation \(O(2)\) and imply a rotation-invariant combination \(|\psi\rangle=\int_{0}^{2\pi}(d\varphi/2\pi)\exp(im\varphi)[\bigotimes_{l}| \Omega_{l}\rangle]\) with an integer or half-integer \(m\). After the integral, non-vanishing bases obey a conservation law of

Figure 2: Accuracy rate AR as a function of controllable parameters \(\varphi\) and \(\tilde{h}\) in GWMF or equivalently in shn-FNN. We concern ground states in (a) a generalized ferromagnetic Ising chain with \(\boldsymbol{\Omega}=\hat{x}\), ferromagnetic XY chains with (b) PBC and (c) TBC (even parity), and (d) an antiferromagnetic XY chain with PBC, respectively. Black-filled triangles mark the parameters given by the optimized shn-FNN with AR = 1 or 100%. For (a) and (b), the phase vector \(w_{l}=\varphi\), while for (c) and (d) \(w_{l}=\varphi l\). We set \(L=16\) always.
\(\sum_{l=1}^{L}\hat{S}_{l}^{z}=m\) due to a recovered \(U(1)\) symmetry, that is \(e^{i\varphi\hat{S}_{i}^{z}}|\psi\rangle=e^{im\varphi}|\psi\rangle\) for arbitrary angle \(\varphi\). A global rotation can tune the sign rule with a uniform \(w_{l}=\varphi\). As \(\varphi=0\), the sign for arbitrary configuration in the ground state is always positive, which is summarized as the Perron-Frobenius theorem in history [5; 6]. In a numerical variation, e.g. ED or others, it is hard to eliminate the angle, so all combinations with \(\tilde{h}=0\) and \(\varphi\in[\pi/16,\,3\pi/16]\) get 100% AR in Fig. 2(b).

For the twisted boundary condition (TBC), an antiferromagnetic bond connects two edge lattice sites in the Hamiltonian \(\hat{H}_{XY}^{T}(J)=(1/2)(\sum_{l=1}^{L-1}J\hat{S}_{l}^{+}\hat{S}_{l+1}^{-}-J \hat{S}_{L}^{+}\hat{S}_{1}^{-}+\text{h.c.})\). Under a rotation of \(\hat{U}_{\delta}=\prod_{l=1}^{L}\hat{R}_{l}(\hat{z},\,l\delta)\) with a gradient angle \(\delta=\pi/L\), the twisting effect from the edge bond is absorbed into a gauge field \(\tilde{J}=\exp(i\delta)\) in a new Hamiltonian \(\hat{H}_{XY}^{P}(J\tilde{J})\). Meanwhile, \(\hat{U}_{\delta}^{\dagger}\hat{S}_{l}^{\pm}\hat{U}_{\delta}=\hat{S}_{l}^{\pm} \exp(\mp il\delta)\). Because \(s_{\mathbf{n}}\) is always positive definite in the ground state \(|\psi_{XY}^{P}(J\tilde{J})\rangle\) of \(\hat{H}_{XY}^{P}(J\tilde{J})\) argued in App. B, the ground state \(|\psi_{XY}^{T}(J)\rangle\) of \(\hat{H}_{XY}^{T}(J)\) carries a nonzero complex phase due to the rotation mentioned above, i.e. \(|\psi_{XY}^{T}(J)\rangle=\hat{U}_{\delta}|\psi_{XY}^{P}(J\tilde{J})\rangle\). After combining \(\pm\delta\), we obtain a real and inversion-symmetric wave function \(|\psi_{xy}^{T}(J)\rangle=\cos[\sum_{l}w_{l}\hat{S}_{l}^{z}]|\psi_{xy}^{P}(J \tilde{J})\rangle\), the sign rule of which is \(w_{l}=\delta l\) and \(\tilde{h}=-(L+1)\pi/4\) with an extra phase gradient \(\delta\) uniformly in space, which is successfully dug out by an shn-FNN in Fig. 2(c).

Under another transformation \(\hat{U}_{\pi}=\prod_{l=1}^{L}\hat{R}_{l}(z,\,\,l\pi)=\prod_{l\in\text{odd}} \hat{R}_{l}(z,\,\,\pi)\), we know that \(\hat{S}^{\pm}\rightarrow-\hat{S}^{\pm}\) for all odd sites, so the ferromagnetic XY chain for \(J<0\) is linked to an antiferromagnetic counterpart for \(J>0\). So in the antiferromagnetic XY chain with PBC, the ground state has an extra MPR, i.e. \(s_{\mathbf{n}}=(-1)^{N_{O}}\) where \(N_{O}=\sum_{l\in\text{odd}}\langle\hat{S}_{l}^{z}+1/2\rangle\) sums over all odd sites, or equivalently \(w_{l}=\pi l\), as shown in Fig. 2(d).

Therefore, in XY chains, the above leading-order sign rules have a general form of \(w_{l}=\phi_{l}=\varphi l\) with \(\varphi=0\), \(\delta\) or \(\pi\), which is related to the rotation of the spin with a specific angle gradient and can be easily read out by optimizing an shn-FNN with the whole data set. The resulting long-range correlation \(\langle\hat{\mathbf{S}}_{l}\cdot\hat{\mathbf{S}}_{l^{\prime}}\rangle=\mathbf{S }_{l}\cdot\mathbf{S}_{l^{\prime}}=\cos(\phi_{l}-\phi_{l^{\prime}})=\cos[\varphi (l-l^{\prime})]\) gives an oscillation in space, which suggests double peaks of the structure factor \(\mathcal{S}_{k}=(1/L^{2})\sum_{l,l^{\prime}}\exp[ik(l-l^{\prime})|\langle\hat{ \mathbf{S}}_{l}\cdot\hat{\mathbf{S}}_{l^{\prime}}\rangle\) at the momentum \(k=\pm\varphi\) correspondingly in Fig. 3(a).

_Heisenberg chain_. In a pure antiferromagnetic Heisenberg chain (AFHC) with equal nearest-neighboring antiferromagnetic couplings \(J_{1}=1\) in the \(x\), \(y\), and \(z\) axes, spins are aligned to the direction \(\mathbf{\Omega}\) at even sites, and the inverse \(-\mathbf{\Omega}\) at odd sites according to GWMF. A pair of degenerate manifolds are linked by a three-dimensional or equivalent two-dimensional rotation by an angle about a specified axis. In GWMF, \(|\Psi\rangle=\int(d\Omega/4\pi)Y_{l,m}(\theta,\phi)[\mathbf{\hat{\otimes}}_{l} \,|\Omega_{l}\rangle]\) still obey MPR since \(\theta\) does not provide any sign, where \(Y_{l,m}(\theta,\phi)\) gives the standard spheric harmonics function for the orbit with a total angular momentum \(l\) and a magnetization \(m\) in the z-axis. Although the actual ground state behaves as the Tomonago-Luttinger liquid (TLL) [59; 60; 61], it has been proven that MPR is still ideally obeyed [7; 14]. Here the optimized shn-FNN consistently shows that \(w_{l}=\pi l\) modulo \(2\pi\) in Fig. 3(f).

## III B. Frustrated spin models

\(J_{1}\)-\(J_{2}\)_Afhc_. As the antiferromagnetic next-nearest-neighboring (NNN) Heisenberg coupling \(J_{2}>0\) is turned on in the frustrated spin-\(1/2\)\(J_{1}\)-\(J_{2}\) AFHC \(\hat{H}_{J_{1}-J_{2}}=\sum_{l=1}^{L}(J_{1}\hat{\mathbf{S}}_{l}\cdot\hat{\mathbf{S}} _{l+1}+J_{2}\hat{\mathbf{S}}_{l}\cdot\hat{\mathbf{S}}_{l+2})\), with a dimensionless ratio \(\alpha=J_{2}/J_{1}\). At the Majumdar-Ghosh (MG) point \(\alpha_{\text{MG}}=1/2\), the dimerized (DM) ground state is a product of the next-nearest-neighboring spin-\(1/2\) pairs and obeys MPR strictly. As \(\alpha\) goes infinitely large, both decoupled chains, consisting of odd and even sites separately, obey MPRs individually. Away from that limit, a relatively tiny \(\alpha>0\) benefits a stable commensurate spin order with a pitch angle \(\varphi=\pi/2\). Once \(\alpha<\alpha_{\text{DC}}\approx 0.99\) for \(L=16\), commensurability breaks due to the emerged triplet defects [62; 63]. In between \(\alpha_{\text{MG}}\) and \(\alpha_{\text{DC}}\), the ground state undergoes an incommensurate crossover cut into several intervals, as shown in Figs. 3(f, g), each of

Figure 3: \(J_{1}\)-\(J_{2}\) antiferromagnetic Heisenberg chain (AFHC). (a-e) The structure factor \(\mathcal{S}_{k}\) as a function of the momentum \(k\) for \(L=16\). We choose (a) \(\alpha=J_{2}/J_{1}=0.35\), (b) 0.52, (c) 0.58, (d) 0.73, and (e) 1.2, respectively. According to the optimized shn-FNN, we obtain (f) the phase gradient \(\varphi\) in the GWMF sign rule \(w_{l}=\varphi l\), (g) the corresponding accuracy rate AR (black dots) and correction rate \(w_{c}\) (red dots). A series of level crossings at \(\alpha_{\text{MG}}=1/2\), \(\alpha_{c1}\approx 0.53\), \(\alpha_{c2}\approx 0.64\), and \(\alpha_{\text{DC}}\approx 0.99\) are marked. (h) At \(\alpha=0.35\), bases in the ground state are regrouped into an MPR-obeying set (red dots) and an MPR-violating set (or \(\overline{\text{MPR}}\), blue crosses). The violation only takes place in the bases with small amplitudes. (i) Sign-fidelity susceptibility density \(\chi_{f}\) in the region \(\alpha\in[0\), \(\alpha_{\text{MG}}=1/2)\) for \(L=8\), 12, 16, 20, 22 and 24. The peaks depart from the real BKT transition point \(\alpha_{\text{BKT}}\approx 0.241\) because of an abnormal scaling hypothesis [58].
which carries a specified pitch angle \(\varphi=2p\pi/L\) with an integer number \(p\) chosen from \(L/2\) to \(L/4\)[62, 63], which suggests \(w_{l}=\varphi l\). For a finite system size \(L\), the ground state keeps the translation symmetry with a conserved momentum \(0\) or \(\pi\) depending on \(p\). The additional inversion symmetry concerning the center of the chain leads to a constrain \(w_{l}+w_{L+1-l}=2\pi p(L+1)/L\), and the resulting sign rule has \(\tilde{h}=p\pi/2\). Note that the data set in frustrated spin systems are chosen from the first \(N_{s}\) samples, which should be carefully adjusted during training.

Due to the interplay of interactions, strong quantum fluctuations usually violate the leading-order sign rule with a pitch angle \(\varphi\) and the resulting AR \(<100\%\). For a small \(\alpha=0.35\) and \(L=16\) in the Fig. 3(h), the bases \(\mathbf{T}_{\text{MPR}}\) with the large weights still obey MPR, while the wrong prediction occurs in the MPR-violating set \(\mathbf{T}_{\overline{\text{MPR}}}\) with smaller weights in principle. Thus, the place where the most significant weight in \(\mathbf{T}_{\overline{\text{MPR}}}\) becomes detectable as it exceeds the limited numeric precision of floating numbers, gives an artificial critical point [11, 13, 14].

To quantitatively estimate the violation of MPR, we define a sign-fidelity \(f=\langle\psi^{\text{MPR}}|\psi\rangle\), referencing from a state \(|\psi^{\text{MPR}}\rangle=\sum_{\{\mathbf{n}\}}s_{\mathbf{n}}^{\text{MPR}}a_ {\mathbf{n}}|\mathbf{n}\rangle\) fully obeying MPR. In fact, \(f=2w_{c}-1\) with a correct rate \(w_{c}=\sum_{\mathbf{n}\in\mathbf{T}_{\text{MPR}}}|a_{\mathbf{n}}|^{2}\) summing over all bases in \(\mathbf{T}_{\text{MPR}}\) as convention [11, 13, 14]. In the vicinity of a continuous transition point, the minimum of \(f\) or \(w_{c}\) expects to be achieved, which means the most complicated sign rule [23, 64]. Like the orthogonalization catastrophe for free fermions [65], fidelity is a pow-law function of the system size \(L\). In principle, the relevant sign-fidelity susceptibility density \(\chi_{f}=-(\ln f)/L\) has a good capability of indicating the places of continuous transition points [66]. However, caused by the abnormal behavior of the exponential closure of gaps at the famous Berzinskii-Kosterlitz-Thouless (BKT) transition point \(\alpha_{\text{BKT}}\approx 0.241\), the maximum of \(\chi_{f}\) is located at \(\alpha_{\text{peak}}\approx 0.43>\alpha_{\text{BKT}}\) in the DM region [67], where \(\chi_{f}\) approaches a \(L\)-independent function as shown in Fig. 3(i) [58]. Similarly, in the incommensurate crossover region, the correct rate still shows a clear structure of staircases in Fig. 3(g), which is believed to vanish in the thermodynamical limit (TDL).

_Antiferromagnetic spin-\(1/2\) XY model on the triangular lattice_. FNN is also capable of learning sign rules for the ground state of 2D quantum models, such as the XY model on triangular lattices with \(L_{x}\times L_{y}\) sites as shown in Fig. 4(a), where the corresponding Hamiltonian reads \(\hat{H}_{\triangle}=\sum_{\{l,l^{\prime}\}}(\hat{S}_{l}^{+}\hat{S}_{l^{\prime }}^{-}+\text{h.c.})\) and \(\langle\rangle\) sums over all the nearest-neighboring sites \(l\) and \(l^{\prime}\). In the XC geometry, the lattice site \(l=l_{y}L_{x}+l_{x}+1\) with a displacement \(\mathbf{r}_{l}\) are labeled by binary indices \((l_{x},l_{y})\) with \(l_{x}=0,\,\cdots,\,L_{x}-1\) and \(l_{y}=0,\,\cdots,\,L_{y}-1\). According to the previous studies, the ground state on a torus depicts a coplanar \(120^{\circ}\) order [68], i.e. the angle between spins at neighboring sites is always \(2\pi/3\). To consider the translation symmetry, \(L_{x}\) is selected as a multiple of \(3\) to guarantee the exact hit at relevant high-symmetry momentum points \(K^{\pm}\) in the first Brillouin zone, as shown in Fig. 4(b). The desired leading-order sign rule \(w_{(l_{x},l_{y})}=(2\pi/3)(l_{x}+[l_{y}])\) is obtained in Fig. 4(c), where \([l_{y}]=1\) once \(l_{y}\) is even and becomes \(0\) otherwise.

Meanwhile, the ground state inherits point group symmetries of the triangular lattice. The expectation values of the symmetry operations listed in table 1 are \(+1/-1\) corresponding to either the symmetric/even or antisymmetric/odd sector of the group representation in math. We take the mirror inversion \(\mathcal{M}_{y}\) about the y-axis as an example. To suppose that the basis \(|\mathbf{n}\rangle\) becomes \(|\mathbf{n}^{\prime}\rangle\) under \(\mathcal{M}_{y}\), we easily know that \(\mathbf{w}\cdot\mathbf{n}^{\prime}=L_{y}\pi-\mathbf{w}\cdot\mathbf{n}\) modulo \(2\pi\). For even \(L_{y}/2\), such as the \(3\times 4\) lattice, the symmetric ground state helps the activation function select a cosine form with \(\tilde{h}=0\), maintaining \(\text{Sgn}[\cos(\mathbf{w}\cdot\mathbf{n})]=\text{Sgn}[\cos(\mathbf{w}\cdot \mathbf{n}^{\prime})]\). In contrast, for the odd (\(L_{y}/2\)), e.g. the geometry of \(3\times 6\) lattices, the antisymmetric ground state prefers \(\tilde{h}=\pi/2\), i.e. \(\text{Sgn}[\sin(\mathbf{w}\cdot\mathbf{n})]=-\text{Sgn}[\sin(\mathbf{w}\cdot \mathbf{n}^{\prime})]\). This discrepancy is captured by shn-FNN in Fig. 4(c-d).

Besides, based on the mean-field picture of spinless Dirac fermions coupled to Chern-Simons gauge fields [69,

Figure 4: Antiferromagnetic spin-\(1/2\) XY model on the triangle lattice. (a) Lattice structure with XC torus geometry. \(a_{1}\) and \(a_{2}\) denote two primitive vectors. All sites are labeled with indices. (b) Structure factor of the spin-flipping correlation \(\mathcal{S}_{\mathbf{k}}^{+-}=(1/S^{2})\sum_{l,l^{\prime}}\exp[i\mathbf{k} \cdot(\mathbf{r}_{l}-\mathbf{r}_{l^{\prime}})](\hat{S}_{l}^{+}\hat{S}_{l^{ \prime}}^{-})\) in the first Brillouin zone and \(S\) is the area. Filled circles mark all allowed momentum as \(L_{x}=3\) and \(L_{y}=4\). The largest amplitude accumulates at high-symmetry points \(K^{\pm}\) (red circles) for indicating a \(120^{\circ}\) order. (c) Phase distribution \(w_{l}\) in \(\mathbf{w}\) for the geometry \(3\times 4\). (d) Accuracy rate AR (black squares) and correction rate \(w_{c}\) (red squares) as a function of geometry \(L_{x}\times L_{y}\). It is noticed that the optimized shn-FNN for the ground state always suggests that \(\tilde{h}=0\) for the even \(L_{y}/2\) but \(\tilde{h}=\pi/2\) for the odd one.
70], for different lattice geometries with finite \(L_{x}\) and \(L_{y}\), non-condensed BCS pairs of spinons from high symmetry points \(K^{\pm}\) would violate the leading-order sign rule, where both AR and \(w_{c}\) deviate from 1. However, the subtle relationship between the lattice geometry and the discrepancy from GWMF still needs to be included.

## III C. Fermi-Hubbard chain

The Fermi-Hubbard model is the simplest model to describe the physics in the strongly correlated electron systems, which is closely related to magnetism, metal-insulator transition, and the promising theory of high-temperature superconductivity [71; 72; 73]. In one dimension, a Hamiltonian for two-species fermions reads \(\hat{H}_{F}=\sum_{l=1}^{L}[-t\sum_{\sigma}(\hat{c}_{l,\sigma}^{\dagger}\hat{c} _{l+1,\sigma}+\text{h.c.})+U\hat{n}_{l,\uparrow}\hat{n}_{l,\downarrow}]\), where \(\hat{c}_{l,\sigma}^{\dagger}\), \(\hat{c}_{l,\sigma}\) and \(\hat{n}_{l,\sigma}=\hat{c}_{l,\sigma}^{\dagger}\hat{c}_{l,\sigma}\) denote the creation, annihilation and particle number operators of fermion at site-\(l\) respectively, \(\sigma=\uparrow\) or \(\downarrow\) the spin polarization, \(t>0\) the hopping amplitude between two nearest-neighboring sites, and \(U\) the onsite coulomb repulsion.

In the Fock space, each basis is a product of the local fermion bases with spin-up and down, that is \(|\mathbf{n}\rangle=[\bigotimes_{l=1}^{L}|n_{l,\uparrow}\rangle][\bigotimes_{l= 1}^{L}|n_{l,\downarrow}\rangle]\). By the conventional Jordan-Wigner transformation \(\hat{S}_{l,\sigma}^{\dagger}=\hat{\Pi}_{l,\sigma}\hat{c}_{l,\sigma}^{\dagger}\) with \(\hat{\Pi}_{l,\sigma}=\prod_{k=1}^{l-1}\hat{F}_{k,\sigma}\) and \(\hat{F}_{k,\sigma}=\exp(i\pi\hat{n}_{k,\sigma})\)[74], we get a two-leg spin-1/2 ladder \(\hat{H}_{\text{Ladder}}=\sum_{\sigma}\hat{H}_{\parallel,\sigma}+\hat{H}_{\perp}\) plus a Hamiltonian \(\hat{H}_{\parallel,\sigma}=-t\) [\(\sum_{l=1}^{L-1}\hat{S}_{l,\sigma}^{+}\hat{S}_{l+1,\sigma}^{-}+(-1)^{\hat{N}_ {\sigma}-1}\hat{S}_{l,\sigma}^{+}\hat{S}_{1,\sigma}^{-}+\text{h.c.}\)] in the transverse \(x\) and \(y\)-axes, a Hamiltonian \(\hat{H}_{\perp}=U\sum_{l=1}^{L}(\hat{S}_{l,\uparrow}^{z}+1/2)(\hat{S}_{l, \downarrow}^{z}+1/2)\) in the longitudinal z-axis, and the particle number of a species in total \(\hat{N}_{\sigma}=\sum_{l=1}^{L}\hat{n}_{l,\sigma}\).

Once \(U=0\), even numbers of spin-up and down fermions propose TBC applied to legs in the spin ladder, which leads to a unique phase vector \(w_{l}=-(l-1)\pi/L+\pi/2-\pi/(2L)\) in the sign rule \(\text{Sgn}[\cos(\sum_{l}n_{l,\sigma}w_{l})]\) for the even-parity state of the species \(\sigma\) as shown in Fig. 5(a). For the odd-parity state, the cosine function is replaced by sine, i.e. \(\text{Sgn}[\sin(\sum_{l}n_{l,\sigma}w_{l})]\). In the section, we never discuss a trivial case of odd fermion numbers, where the induced PBC in the spin ladder suggests zero phases everywhere, i.e. \(w_{l}=0\).

For small \(U/t>0\), the ground state for arbitrary finite \(N_{\uparrow}\) and \(N_{\downarrow}\) keeps even parity, which is their combination of \(\text{Sgn}[\alpha_{1}\cos(\sum_{l}n_{l,\uparrow}w_{l})\cos(\sum_{l}n_{l, \downarrow}w_{l})+\alpha_{2}\sin(\sum_{l}n_{l,\uparrow}w_{l})\sin(\sum_{l}n_{l,\downarrow}w_{l})]\). After training as \(U/t=0.1\), \(N_{\uparrow}=14\), \(N_{\downarrow}=2\) and \(L=16\), the optimized shn-FNN suggests a maximum AR \(\approx 97\%\) at \(\alpha_{1}=-1\) and \(\alpha_{2}=1\) in Fig. 5(b). Thus, the GWMF sign rule for the Fermi-Hubbard model becomes \(\text{Sgn}[\cos(\sum_{l,\sigma}n_{l,\sigma}w_{l})]\). We also found that the GWMF sign rule looks robust and relies less on the filling fraction and the system size \(L\). For the case of \(U/t=0.1\) and \(L=16\) in Fig. 5(c), AR \(>96.8\%\) persists for different even numbers of spin-down fermions. Moreover, AR for \(N_{\downarrow}=2\) gets closer to 100% as \(L\) grows.

In the dominantly large U limit, only single occupations can live in the ground state because of a considerable charge gap, so spin fluctuations in the reduced Hilbert space of either spin-up \(\hat{c}_{l,\uparrow}^{\dagger}|0\rangle\) or spin-down \(-\hat{c}_{l,\downarrow}^{\dagger}|0\rangle\) are described by the effective antiferromagnetic Heisenberg chain, equivalent to MPR. Returning to the fermion bases, it is easy to prove that \(w_{l}\) is the same as one in the GWMF sign rule. For instance, the correction rate \(w_{c}\approx 1\) for the GWMF sign rule once \(U/t\geq 8\) in

\begin{table}
\begin{tabular}{c c c c c c} \hline \hline \(L_{x}\times L_{y}\) & \(\langle\mathcal{T}_{x}\rangle\) & \(\langle\mathcal{T}_{y}\rangle\) & \(\langle\mathcal{M}_{x}\rangle\) & \(\langle\mathcal{M}_{y}\rangle\) & \(\langle\mathcal{T}_{c}\rangle\) \\ \hline \(3\times 4\) & \(+1\) & \(+1\) & \(+1\) & \(+1\) & \(+1\) \\ \(3\times 6\) & \(+1\) & \(+1\) & \(+1\) & \(-1\) & \(-1\) \\ \(3\times 8\) & \(+1\) & \(+1\) & \(+1\) & \(+1\) & \(+1\) \\ \(6\times 4\) & \(+1\) & \(+1\) & \(+1\) & \(+1\) & \(+1\) \\ \(3\times 10\) & \(+1\) & \(+1\) & \(+1\) & \(-1\) & \(-1\) \\ \hline \hline \end{tabular}
\end{table}
Table 1: Measurement of the symmetry operations of the ground state for the antiferromagnetic spin-1/2 XY model on the triangular lattice. We consider the translation by a site \(\mathcal{T}_{x}\) in x-axis and \(\mathcal{T}_{y}\) in y-axis, mirror inversion \(\mathcal{M}_{x}\) about the x-axis and \(\mathcal{M}_{y}\) about the y-axis, center inversion \(\mathcal{I}_{c}\).
Fig. 5(d).

According to the Bethe ansatz solution [75], the Fermi liquid only survives at \(U=0\) in TDL. However, because of a tiny charge gap close to \(U=0\), fermions behave like a Fermi liquid in the ground state with a limited system size \(L\leq 20\), much smaller than the correlation length. A quasi-critical point appears for finite system size, in the vicinity of which the strong quantum fluctuations would violate the GWMF sign rules and suddenly drop \(w_{c}\). As \(L\) grows in Fig. 5(d), the quasi-critical point approaches \(U=0\) gradually.

In an alternative combination scheme of \(|{\bf n}\rangle=\bigotimes_{l=1}^{L}[|n_{l,\uparrow}\rangle|n_{l,\downarrow}\rangle]\), the Jordan Wigner transformation changes accordingly and an additional nonlinear appendix \((-1)^{\sum_{l=2}^{l}n_{l,\uparrow}\sum_{k=1}^{l-1}n_{k,\downarrow}}\) in front of the predicted sign rules, which is not easily generalized in an shn-FNN.

## IV IV. Summary and Discussions

We successfully establish a Gutzwiller mean-field theory of sign rules for the ordered ground state in qubit lattice models, which perfectly matches the sign predicted by a shallow FNN with a single hidden neuron called shn-FNN. Based on that principle, we not only consistently explain the excellent performance of activation functions in the neural network, but also exhibit a way of vividly interpreting the sign rule represented by FNN.

We test our theory by systematical benchmarks in various spin models and the Fermi-Hubbard chain. For the case of non-frustrated spin-1/2 models, such as a generalized Ising chain, XY chains with the periodic or twisted boundary conditions, an antiferromagnetic Heisenberg chain, sign rules for the ground states with magnetic orders can be fully captured by shn-FNN, where the accurate rate of the prediction can archive 100% exactly. In contrast, competition between interactions in frustrated models strongly enhances the complexity of sign rules for the ground states and reduces the prediction accuracy. However, the leading-order or mean-field sign rules obtained by optimizing shn-FNN are still capable of visualizing the pictorial scenario of orders in spins, where the characteristic phase vector is tightly related to pitch angles, gauge field gradients, etc. We can also get a unified mean-field sign rule by choosing suitable bases in the Fermi-Hubbard chain.

Our theory is a simple starting point by removing short-range details in the ordered states. It is interesting to further decode information from high-order microscopic processes instead of the leading-order ones. Of course, the theory for general lattice models also deserves profound studies in the future.

## V Acknowledgement

We thank Tao Li, Rui Wang, Ji-Lu He, Wei Su, and Wei Pan for the grateful discussion. S. H. acknowledges funding from the Ministry of Science and Technology of China (Grant No. 2017YFA0302904) and the National Science Foundation of China (Grants No. 12174020). Z. P. Y. acknowledges funding from the National Science Foundation of China (Grants No. 12074041). S. H. and K. X. further acknowledge support from Grant NSAF-U2230402. The computations were performed on the Tianhe-2JK at the Beijing Computational Science Research Center (CSRC) and the high-performance computing cluster of Beijing Normal University in Zhuhai.

### A. Function softmax in FNN

In our work, we only have a single neuron \(y_{H}\) in the hidden layer and the normalization function softmax gives two neurons (\(y_{O,1}\), \(y_{O,2}\)) in the output layer, i.e.

\[\begin{split}& y_{O,1}=\frac{(e^{y_{H}})^{a}}{(e^{y_{H}})^{a}+(e^{y_{H}})^ {b}},\\ & y_{O,2}=\frac{(e^{y_{H}})^{b}}{(e^{y_{H}})^{a}+(e^{y_{H}})^{b}}. \end{split} \tag{3}\]

In practice, we choose an appropriate discrepancy between exponents \(a\) and \(b\) so that \((e^{y_{H}})^{a}\) and \((e^{y_{H}})^{b}\) are distinguishable. Taking \(a>b\) as an example, \(y_{H}>0\) leads to \(y_{O,1}>1/2\) and a positive predicted sign, otherwise a negative one.

### B. Sign rule for the Spin-1/2 XY model

Here we explicitly prove that the ground state of Hamiltonian \(H_{XY}^{P}(J\tilde{J})\) in the main text always has a positive sign for arbitrary configuration \({\bf n}\), i.e. \(s_{\bf n}>0\).

Under the Jordan-Wigner transformation [74]

\[\begin{split}&\hat{S}_{l}^{+}=\hat{c}_{l}^{\dagger}\exp(\ \ i\pi\sum_{k<l}\hat{n}_{k}),\\ &\hat{S}_{l}^{-}=\hat{c}_{l}\exp(-i\pi\sum_{k<l}\hat{n}_{k})\end{split} \tag{4}\]

with the creation (annihilation) operator \(\hat{c}_{l}^{\dagger}\) (\(\hat{c}_{l}\)) and particle number operator \(\hat{n}_{k}=\hat{c}_{l}^{\dagger}\hat{c}_{l}\) of the fermion, the Hamiltonian \(\hat{H}_{XY}^{P}(J\tilde{J})\) becomes \(\hat{H}_{F}^{P/T}(J\tilde{J})\) for spinless free fermions at half-filling where

\[\hat{H}_{F}^{P/T}(J)=-J\left(\sum_{l=1}^{L-1}\hat{c}_{l}^{\dagger}\hat{c}_{l+ 1}\pm\hat{c}_{L}^{\dagger}\hat{c}_{1}\right)+{\rm h.c.}. \tag{5}\]

The periodic/twisted boundary condition is selected if \(N\) is odd/even. On condition that \(N\) is odd, single particle energy levels are still described by the plane wave
with discrete momentum \(k_{m}=2m\pi/L\) and an integer \(m=0\),..., \(L-1\). If \(L\) is large enough, the many-body wave function, consisting of single-particle energy levels, is the same as one of the ground states for the Hamiltonian \(\hat{H}_{F}^{P}(J)\). When \(N\) is even, analogous to the above argument, the ground state keeps the same as one of the Hamiltonian \(\hat{H}_{F}^{T}(J)\). Both of two above Hamiltonian can be transferred back to \(\hat{H}_{XY}^{P}(J)\) by the inverse Jordan-Wigner transformation, in which the sign of configurations is always positive.
