Measuring Renyi Entropy in Neural Network Quantum States
We compute the Renyi entropy in a one-dimensional transverse-field quantum
Ising model by employing a swapping operator acting on the states which are
prepared from the neural network methods. In the static ground state, Renyi
entropy can uncover the critical point of the quantum phase transition from
paramagnetic to ferromagnetic. At the critical point, the relation between the
Renyi entropy and the subsystem size satisfies the predictions from conformal
field theory. In the dynamical case, we find coherent oscillations of the Renyi
entropy after the end of the linear quench. These oscillations have universal
frequencies which may come from the superpositions of excited states. The
asymptotic form of the Renyi entropy implies a new length scale away from the
critical point. This length scale is also verified by the overlap of the
reduced Renyi entropy against the dimensionless subsystem size.
Han-Qing Shi, Hai-Qing Zhang
# Measuring Renyi Entropy in Neural Network Quantum States

###### Abstract

We compute the Renyi entropy in a one-dimensional transverse-field quantum Ising model by employing a swapping operator acting on the states which are prepared from the neural network methods. In the static ground state, Renyi entropy can uncover the critical point of the quantum phase transition from paramagnetic to ferromagnetic. At the critical point, the relation between the Renyi entropy and the subsystem size satisfies the predictions from conformal field theory. In the dynamical case, we find coherent oscillations of the Renyi entropy after the end of the linear quench. These oscillations have universal frequencies which may come from the superpositions of excited states. The asymptotic form of the Renyi entropy implies a new length scale away from the critical point. This length scale is also verified by the overlap of the reduced Renyi entropy against the dimensionless subsystem size.

_Introduction_.-- In recent years, neural networks with machine learning methods has become a powerful tool in solving quantum many-body problems [1; 2], ranging from static ground states [3] to time-dependent evolutions [4; 5]. Besides these successes in quantum physics, it is also been adopted in a broad spectrum of physics, from computational physics [6] to high energy physics [7] and cosmology [8]. The wide range of its applications is due to the high efficient representing power of neural networks, which can characterize the states of the system with acceptable number of parameters [9]. Therefore, neural networks makes the overwhelming complexity computationally tractable. Computation of entanglement in a quantum system is formidable because of its exponential complexity of states in the Hilbert space [10]. Therefore, to study the entanglement of a quantum system by virtue of the neural networks becomes an intriguing task.

Entanglement entropy (von Neumann entropy, i.e., \(S_{1}\) defined below) is an important concept in quantum physics. Measuring entanglement entropy can reveal some universal properties of quantum many-body systems. For instance, in a one-dimensional conformal field theory, there is a universal logarithmic scaling of the entanglement entropy [11; 12]. Renyi entropy (\(S_{n}\), defined below), a generalized version of the entanglement entropy, has attracted much attention recently [13], since Renyi entropy can encode much more information than von Neumann entropy in studying the entanglement spectrum of the density matrix [14].

We will focus on studying the second Renyi entropy \(S_{2}\) of a one-dimensional transverse-field quantum Ising model (TFQIM) by utilizing the neural network methods. We prepare the neural-network quantum states (NQS) of TFQIM with the machine learning methods [5]. Then we transform the studying of \(S_{2}\) by computing the expectation value of a swapping operator [15]. First, we study the Renyi entropy in static ground states. By varying the transverse magnetic field, the peak of the Renyi entropy appears at the critical value of the magnetic field, which reflects a quantum phase transition from paramagnetic to ferromagnetic. Therefore, Renyi entropy can serve as an order parameter to disclose the phase transition. As the transverse magnetic field goes to zero, Renyi entropy tends to \(\ln 2\) which is consistent with the two-degenerated vacuum states in the pure ferromagnetic phase, i.e., the spins all point up or down [11]. We also study the relation between the Renyi entropy and the subsystem size at the critical point, and find that it satisfies the theoretical predictions in conformal field theory [11].

Later, we study the Renyi entropy in a dynamical case induced by a linear quench of the transverse magnetic field. This is a paradigmatic model in studying the formation of one-dimensional defects (kinks) from the celebrated Kibble-Zurek mechanism (KZM) [16; 17]. From KZM, there is an adiabatic-impulse-adiabatic process as the magnetic field traverses from paramagnetic to ferromagnetic state. In the impulse regime nearby the critical point, the system is excited rather than following the original ground state. Therefore, Renyi entropy in this case is assumed to be different from those in the static case. Specifically, we quench the transverse magnetic field from greater than critical values to zero, and then let the system evolve freely. We find that superpositions of different symmetry-broken states result in the coherent oscillations of the Renyi entropy after the end of the quench. The periods (or frequencies) of these oscillations for different quench rates are identical, which implies the degeneracy of energy levels as magnetic field vanishes. The length scale \(\xi\) in this free evolution regime is different from that nearby the critical point, i.e., \(\xi\), which is usually used in KZM to predict the number density of the defects. We see that the relation between the asymptotic behavior of the Renyi entropy and the quench rate satisfies the theoretical formula if we recognize \(\xi\) as the new length scale. Besides, the collapsing of relations between the reduced Renyi entropy and the reduced dimensionless subsystem size also supports the above asserts that in the free evolution regime \(\xi\) is the new length scale.

_Model_.-- The Hamiltonian of one-dimensional TFQIM with \(N\) sites is [18]

\[H=-J\sum_{i=1}^{N}(\sigma_{i}^{z}\sigma_{i+1}^{z}+h\sigma_{i}^{x}) \tag{1}\]

where \(\sigma_{i}^{z}\) and \(\sigma_{i}^{x}\) are the Pauli matrices at the site \(i\)
\(J\) represents the coupling strengths between the nearest-neighbor sites while \(h\) denotes the strength of the transverse magnetic field. We adopt the periodic boundary conditions (PBC), i.e., \(\vec{\sigma}_{N+1}=\vec{\sigma}_{1}\). In this paper we set \(J=1\). In the ground state, there is a quantum phase transition at the critical value \(h_{c}=1\). (We will only consider \(h\geq 0\) since \(h\leq 0\) has similar phenomenon.) As \(h\gg 1\), the system is in a paramagnetic phase with spins all pointing along \(x\)-direction. On the contrary, as \(h<1\), the system is in a ferromagnetic phase. In particular, when \(h=0\) the system falls into a complete ferromagnetic phase in which the system is in a two-degenerated state with all spins either pointing up or down along the \(z\)-direction.

This phase transition can also be captured by the Renyi entropy [11], defined as

\[S_{n}(\rho_{A})=\ \tfrac{1}{1-n}\ln\left[\operatorname{Tr}(\rho_{A}^{n})\right] \tag{2}\]

where \(S_{n}(\rho_{A})\) is the \(n\)-th Renyi entropy of the subsystem \(A\), \(\rho_{A}\) is the reduced density matrix by tracing out the rest part. As \(n\to 1\), it reduces to the von Neumann entropy \(S_{1}=-\operatorname{Tr}(\rho_{A}\ln\rho_{A})\). For an infinitely large system, Renyi entropy will diverge at the critical point \(h_{c}=1\), while for a finite system, it has a finite peak at this point. As \(h=0\), due to the \(Z_{2}\) symmetry of the complete ferromagnetic system, the value of Renyi entropy should be \(\ln 2\). As \(h>1\), the system is in a paramagnetic phase and Renyi entropy will decrease and then vanish in the limit of \(h\to\infty\).

However, for a time-dependent \(h(t)\), the studying of Renyi entropy in the dynamical phase transition of TFQIM is rare. We assume that the system is undergoing a linear quench of the transverse magnetic field from paramagnetic to ferromagnetic phase, i.e.,

\[h(t)=-\frac{t}{\tau_{Q}},\quad t\in[-T,0]. \tag{3}\]

where \(\tau_{Q}\) is the quench rate and \(-T\) is the initial time of the quench. At the initial time, \(h\gg 1\) and the system is prepared in the paramagnetic phase; By quenching the system across the critical point \(h_{c}=1\), dynamical symmetry-breaking will bring out the topological defects (kinks) with the density depending on the quench rate \(\tau_{Q}\) according to the KZM [16; 17]. This quantum phase transition inevitably excites the system and the final state is a superposition of the excited states with different symmetry-broken domains [19; 20]. Therefore, we can readily imagine that Renyi entropy in the dynamical case will be different from that in static case.

_Neural network machine learning._-- We utilize the restricted Boltzmann machines (RBM) as the neural networks to represent the states of the TFQIM. This network has two layers, one includes \(N\) visible neurons \(s_{j}\) (i.e., the spins at site \(j\)) and the other has \(M\) hidden neurons \(h_{i}\). The visible neurons are assigned as input with the directions of spins as \(s(\uparrow)=1\) and \(s(\downarrow)=-1\). The hidden neurons can be assigned the same values \(h_{i}=\{1,-1\}\). According to the structure of RBM, we can write down the expression of NQS with the neural network parameters \(\mathcal{W}=\{a,b,w\}\)[4],

\[\Psi_{\text{NQS}}(s,\mathcal{W})=\sum_{\{h_{i}\}}e^{\sum_{j}a_{j}s_{j}+\sum_{ i}b_{i}h_{i}+\sum_{ij}w_{ij}h_{i}s_{j}}\,. \tag{4}\]

The dynamics we considered is an evolution from an initial ground state with strong transverse magnetic field to a state with vanishing transverse magnetic field. In order to obtain this initial ground state, we need to train a beginning wave function whose parameters are random complex numbers from machine learning algorithms, which is realized through minimizing the expectation value of the energy with the Stochastic Reconfiguration (SR) method [21]. After preparing the initial ground state, the NQS need to satisfy the time-dependent Schrodinger equation according to the linear quench (3). To this end, we utilize the time-dependent variational principle (TDVP) to solve the time-dependent neural network parameters \(\mathcal{W}(t)\). In each iteration, we need to minimize the Fubini-Study distance

\[\mathcal{D}(\mathcal{W})=\arccos\left[\frac{\langle\partial_{t}\Psi|H\Psi \rangle\langle H\Psi|\partial_{t}\Psi\rangle}{\langle\partial_{t}\Psi| \partial_{t}\Psi\rangle\langle H\Psi|H\Psi\rangle}\right]^{1/2} \tag{5}\]

which describes the difference between the exact time evolution and variational evolution. Eventually, it can yield an evolution equation about the parameters \(\mathcal{W}\)[4],

\[S_{k^{\prime}k}\dot{\mathcal{W}}_{k}=-iF_{k^{\prime}} \tag{6}\]

where \(\dot{}\) represents time derivative, \(S_{k^{\prime}k}=\langle O_{k^{\prime}}^{*}O_{k}\rangle-\langle O_{k^{\prime}}^ {*}\rangle\langle O_{k}\rangle\) is a covariance matrix of the operator \(O_{k}=\frac{\partial|\hbar\Psi}{\partial\mathcal{W}_{k}}\) and \(F_{k^{\prime}}=\langle O_{k^{\prime}}^{*}E_{\text{loc}}\rangle-\langle O_{k^{ \prime}}^{*}\rangle\langle E_{\text{loc}}\rangle\) is the generalized forces with \(E_{\text{loc}}=\frac{\langle s|H|\Psi\rangle}{\Psi(s)}\). According to TDVP, the updated parameter is \(\mathcal{W}(t+\delta t)=\mathcal{W}(t)+\dot{\mathcal{W}}\delta t\) in each iteration.

_Swapping operation._-- In this paper, we focus on how to compute the second Renyi entropy \(S_{2}\) from the neural networks. For simplicity, we call \(S_{2}\) as Renyi entropy in the following. We will utilize a swapping operation \(S_{\text{wap}}\) to measure \(S_{2}\) from NQS [15]. Assume that one can construct the state \(|\Psi\rangle\) of the system from two parts' basis \(|\alpha\rangle\) and \(|\beta\rangle\), where \(|\alpha\rangle\) is a complete basis of states in the part \(A\), and \(|\beta\rangle\) is a complete basis of state in the complement part \(B\). Therefore, the whole state of the system can be decomposed in the product of basis as \(|\Psi\rangle=\sum_{\alpha\beta}C_{\alpha\beta}|\alpha\rangle|\beta\rangle\). The swapping operator \(S_{\text{wap}}\) will exchange the states in the part \(A\) between the original and the copied one, such that,

\[S_{\text{wap}}\left(\sum_{\alpha_{1}\beta_{1}}C_{\alpha_{1}\beta _{1}}|\alpha_{1}\rangle|\beta_{1}\rangle\right)\otimes\left(\sum_{\alpha_{2} \beta_{2}}D_{\alpha_{2}\beta_{2}}|\alpha_{2}\rangle|\beta_{2}\rangle\right)\] \[=\sum_{\alpha\beta}C_{\alpha_{1}\beta_{1}}D_{\alpha_{2}\beta_{2}}| \alpha_{2}\rangle|\beta_{1}\rangle\otimes|\alpha_{1}\rangle|\beta_{2}\rangle \tag{7}\]

According to this definition, one can link the expectation
value of \(\langle S_{\rm wap}\rangle\) to the Renyi entropy,

\[\langle\Psi\otimes\Psi|S_{\rm wap}|\Psi\otimes\Psi\rangle=\sum_{ \alpha\beta}C_{\alpha_{1}\beta_{1}}C^{*}_{\alpha_{2}\beta_{1}}C_{\alpha_{2} \beta_{2}}C^{*}_{\alpha_{1}\beta_{2}}\] \[=\sum_{\alpha_{1}\alpha_{2}}[\rho_{A}]_{\alpha_{1}\alpha_{2}}[ \rho_{A}]_{\alpha_{2}\alpha_{1}}={\rm Tr}(\rho_{A}^{2})=e^{-S_{2}} \tag{8}\]

where \([\rho_{A}]_{\alpha_{1}\alpha_{2}}=\sum_{\beta_{1}}C_{\alpha_{1}\beta_{1}}C^{*} _{\alpha_{2}\beta_{1}}\) is the element of the reduced density matrix \(\rho_{A}\). The coefficient \(C\) and \(C^{*}\) can be obtained by samplings from the NQS with quantum Monte-Carlo methods.

_Renyi entropy in static ground state.--_ First, we study the Renyi entropy from the neural networks for the static one dimensional TFQIM with \(N=100\) sites. In Fig.1(a), we show the Renyi entropy against different transverse magnetic field strength \(h\) for various network size \(\alpha\). We define \(\alpha\) as the ratio between the hidden and visible neurons \(\alpha=M/N\). Therefore, bigger \(\alpha\) represents higher accuracy of the neural networks. Theoretically, the entropy will diverge at the critical point \(h_{c}=1\) in the infinite-size system. While in the finite system, a finite peak will replace the divergence. Here, the Renyi entropy is for the half-size subsystem, i.e., an interval with 50 sites. We indeed see a peak around \(h_{c}=1\). When increasing \(\alpha\), the peak will move closer to the critical point position \(h_{c}=1\), see the inset plot in Fig.1(a). As \(h\to 0\), the Renyi entropy goes to the theoretical predicted value \(\ln 2\approx 0.6931\) due to the two-degenerated vacuum states in the pure ferromagnetic phase. While \(h\rightarrow\infty\), it decreases and tends to zero. This figure is consistent with theoretical predictions [12].

At the critical point, the dependence of Renyi entropy \(S_{n}\) to the size \(N_{A}\) of the subsystem \(A\) is (with PBC) [12]

\[S_{n}(N_{A})=\frac{c}{6}\left(1+\frac{1}{n}\right)\ln\left(\frac{N}{\pi a}\sin \left(\frac{\pi N_{A}}{N}\right)\right)+{\rm const.} \tag{9}\]

where \(c=1/2\) is the central charge in TFQIM, while \(a\) is the lattice spacing and was set to \(a=1\) throughout this paper. Fig.1(b) exhibits a linear relation between \(S_{2}\) and the logarithmic term for \(N_{A}\leq 50\). The slope 1/8 is consistent with the theoretical prediction (9). In the inset plot we show the regular relation between \(S_{2}\) and the size \(N_{A}\) in the whole range. The numerical data are symmetric under \(N_{A}\to 100-N_{A}\), and the maximum value appears at \(N_{A}=50\).

_Renyi entropy in quenched dynamics._-- In the time-dependent evolution, we consider a linear quench of the transverse magnetic field as in Eq.(3). At the initial time we set \(h=2\), where the system is prepared in the paramagnetic ground state. In the numerics, time step is set to \(\Delta t=10^{-3}\). Then we quench the magnetic field linearly to zero, and keep the system to evolve freely with \(h=0\) for a while. During the quench, the system will be excited to a ferromagnetic state with kink configurations due to the KZM. The superpositions of the excited states will result in different behaviors of the Renyi entropy compared to the static case. We show the time evolution of \(S_{2}\) in Fig.2(a) for various quench rates. \(t=0\) is the instant for ending the quench. We see that Renyi entropy will grow in time and then enter an oscillatory phase. For faster quench (smaller \(\tau_{Q}\)), the ramp is steeper. However, in the oscillatory phase the periods of the oscillations are almost the same for different quench rates. In the Fig.2(b) we slightly shift the Renyi entropy by a phase difference \(t_{*}\) in order to compare their periods conveniently. Specifically, \(t_{*}(\tau_{Q}=1)=0.2\), \(t_{*}(\tau_{Q}=2)=-0.4\), \(t_{*}(\tau_{Q}=4)=0.12\), and \(t_{*}(\tau_{Q}=8)=-0.34\). We can clearly see that their periods are almost similar and are roughly \(T_{\rm period}\approx 1.5867\). Interestingly, we find that this period is coincident with that of the coherent oscillatory behavior of transverse magnetization in [20], in which the analytical period was \(\pi/2\) which is very close to our numerical results. The co

Figure 1: (a) Renyi entropy for half-size subsystem in static ground states against the transverse-field strength with network size \(\alpha=1,2,4\). Inset plot shows that the peak of Renyi entropy will be closer to the critical point \(h_{c}=1\) as increasing the size \(\alpha\); (b) Linear relation between the Renyi entropy and \(\ln\left(\frac{N}{\pi a}\sin\left(\frac{\pi N_{A}}{N}\right)\right)\) at the critical point, satisfying the theoretical results (9). The inset plot shows the relation between \(S_{2}\) and the subsystem size \(N_{A}\) in the ordinary coordinates. The error bars stand for the standard errors, and the dashed lines are the fitting lines of the numerical data.

Figure 2: (a) Time evolution of Renyi entropy for the various quench rates \(\tau_{Q}=1,2,4\) and \(8\). As \(t<0\), the system undergoes a linear quench from \(h=2\) to \(h=0\); After \(t=0\), we keep the system to evolve with zero transverse magnetic field for a while. Renyi entropy begin to oscillate after the ramp; (b) In order to compare the periods of the oscillations for different quench rates, we shift the Renyi entropy by the phase differences \(t_{*}\). Then we see that the periods for these oscillations are almost the same, which is close to \(\pi/2\).
herent oscillations are interpreted as the superpositions of the different symmetry-broken excited states. Therefore, we can speculate that the oscillatory behavior of \(S_{2}\) in our paper may also come from the superpositions of the excited states after the end of the quench.

At the end of the quench, i.e., at \(t=0\), we can read off the relation between the Renyi entropy and the logarithmic function of quench rate, which is shown in Fig.3. We already see from Fig.2(a) that the Renyi entropy is oscillatory at \(t=0\), therefore, it is easy to deduce that \(S_{2}\) at the end of quench is not monotonic against the quench rate. From Fig.3 we indeed see that \(S_{2}\) is oscillatory as well with respect to \(\tau_{Q}\). However, as \(\tau_{Q}\) grows, this oscillation becomes smaller, which is reflected in Fig.2(a) that the amplitudes of \(S_{2}\) become smaller as \(\tau_{Q}\) is greater. 1 The asymptotic form of the Renyi entropy as \(\tau_{Q}\rightarrow\infty\) can be fitted by the theoretical formula in static case. At the instant \(t=0\) the system is away from the critical point. According to [22], there emerged a new length scale \(\xi\simeq\sqrt{\tau_{Q}}\ln\tau_{Q}\) in this case. Therefore, the Renyi entropy for an interval can be predicted from the length scale \(\xi\) as [12],

Footnote 1: In numerics, the largest quench rate we used is \(\tau_{Q}=16\) in order to balance the precisions and time consumptions of the codes.

\[S_{n} = 2\times\frac{c}{12}\left(1+\frac{1}{n}\right)\ln\left(\frac{ \xi}{a}\right)+\text{const.}\] \[\Rightarrow S_{2} = \frac{1}{8}\ln(\sqrt{\tau_{Q}}\ln\tau_{Q})+\text{const.} \tag{10}\]

Note that multiplying a prefactor 2 is because the interval has two boundary points [12; 23]. The asymptotic behavior of \(S_{2}\) is denoted as the red dashed line in Fig.3, which is consistent with the theoretical formula (10).

In the Fig.4(a) we show the relation of the Renyi entropy with respect to the size of the subsystem at the end of quench \(t=0\), for various quench rates. It is obvious that this relation should be different from the static case, i.e., Eq.(9). As an example, we show in the inset plot the relation between \(S_{2}\) and \(\ln\left(\frac{N}{\pi a}\sin\left(\frac{\pi N_{A}}{N}\right)\right)\) for \(\tau_{Q}=7.4643\). It is away from the linear relation Eq.(9). From Fig.4(a) we can still see the symmetry under \(N_{A}\to 100-N_{A}\). Besides, in the range \(N_{A}\in[0,50]\), Renyi entropy grows as the subsystem size grows, and then saturates nearby \(N_{A}=50\). We define the Renyi entropy at saturation as \(S_{\text{satu.}}\).

As was mentioned above, at this case the length scale is \(\xi\simeq\sqrt{\tau_{Q}}\ln\tau_{Q}\). Therefore, the ratio \(N_{A}/(\sqrt{\tau_{Q}}\ln\tau_{Q})\) is a reduced dimensionless scale. We again define a reduced Renyi entropy which is the ratio between \(S_{2}\) and \(S_{\text{satu.}}\) for each quench rate. Their relations can be found in Fig.4(b). We see that for each quench rate they overlap very well, which implies that the length scale \(\xi\simeq\sqrt{\tau_{Q}}\ln\tau_{Q}\) at \(t=0\) is reasonable.

_Conclusions and discussions._-- We studied the second Renyi entropy \(S_{2}\) for the one-dimensional TFQIM with neural networks in both static ground state and quenched dynamics. By adopting the swapping operation, we transform the computation of \(S_{2}\) to calculating the expectation value of the swapping operator \(S_{\text{wap}}\). In the static case, the peak of the Renyi entropy can reveal the critical point of the quantum phase transition from paramagnetic to ferromagnetic. Therefore, Renyi entropy in this sense can play a role of order parameter for uncovering phase transitions. The relation between Renyi entropy and the size of the subsystem matches the theoretical predictions very well, which verifies the accuracy of the neural network methods.

In the quenched dynamics, we linearly quenched the transverse magnetic field from \(h>1\) to \(h=0\) and then let the system evolve freely. We found the coherent oscillations of the Renyi entropy in the free evolutions. The oscillation periods are identical to \(\pi/2\) which was con

Figure 3: Renyi entropy at the end of quench with respect to the logarithmic function of quench rate \(\ln(\sqrt{\tau_{Q}}\ln\tau_{Q})\). The asymptotic form of \(S_{2}\) as \(\tau_{Q}\rightarrow\infty\) is fitted by the red dashed line, which is consistent with the Eq.(10).

Figure 4: (a) Renyi entropy against the size of the interval \(N_{A}\) for several quench rates. Renyi entropy will increase with \(N_{A}\) and reach saturation quickly before the half of system. The error bars represent the standard errors. The inset is an example for \(\tau_{Q}=7.4643\) to show that the relation Eq.(9) in static case does not work in the quenched case; (b) The relation between the reduced Renyi entropy and the reduced length scale. They collapse together for each quench rate.
sistent with the coherent oscillations of the transverse magnetization studied in existing literatures. We interpreted this oscillation behavior as the superpositions of the different symmetry-broken excited states. At the end of the quench, the system embodies a new length scale as \(\xi\simeq\sqrt{\tau_{Q}}\ln\tau_{Q}\), different from the scale \(\hat{\xi}\simeq\sqrt{\tau_{Q}}\) in the impulse regime which is nearby the critical point. We verified this new length scale from the asymptotic behavior of the Renyi entropy in the limit of large quench rate. Besides, the relation between the reduced Renyi entropy \(S_{2}/S_{\text{satu.}}\) and the reduced size of the subsystem \(N_{A}/\xi\) collapse together, which indicates that the new length scale \(\xi\simeq\sqrt{\tau_{Q}}\ln\tau_{Q}\) at the end of the quench is correct.

## Acknowledgements

We appreciate the helpful discussions with Marek Rams. This work was partially supported by the National Natural Science Foundation of China (Grants No.12175008).
