Variational generation of spin squeezing on one-dimensional quantum devices with nearest-neighbor interactions

Efficient preparation of spin-squeezed states is important for quantum-enhanced metrology. Current protocols for generating strong spin squeezing rely on either high dimensionality or long-range interactions. A key challenge is how to generate considerable spin squeezing in one-dimensional systems with only nearest-neighbor interactions. Here, we develop variational spin-squeezing algorithms to solve this problem. We consider both digital and analog quantum circuits for these variational algorithms. After the closed optimization loop of the variational spin-squeezing algorithms, the generated squeezing can be comparable to the strongest squeezing created from two-axis twisting. By analyzing the experimental imperfections, the variational spin-squeezing algorithms proposed in this work are feasible in recent developed noisy intermediate-scale quantum computers.

Despite the enormous progress in generating squeezing via OAT, there are two key challenges in this field.The first one is that OAT relies on the infinite-range interactions, while only a few experimental platforms can achieve sufficiently longrange or infinite-range interactions.Consequently, exploring the possibility for generating highly spin-squeezed states in systems with short-range interactions is highly desirable.The second challenge is the realization of two-axis twisting (TAT), generating stronger squeezing than OAT [10].Even though several schemes for achieving TAT have been proposed [20][21][22][23][24], its experimental realization remains absent due to the limited controllability and flexibility of artificial quantum systems.
Recent studies have shown that spin squeezing comparable to the best one generated from OAT can be achieved in twoand three-dimensional short-range systems [25][26][27].It indicates that higher-dimensional systems have the potential to yield stronger squeezing [28,29].Nevertheless, there remains a more challenging problem, i.e., whether one-dimensional (1D) quantum devices with only nearest-neighbor interactions, as one of the most experimentally achievable systems in quantum simulation, can generate highly spin-squeezed states that are comparable to those from OAT, or even from TAT.
In the past few years, tremendous developments on variational quantum algorithms [30][31][32][33][34] opened new avenues for improving the performance of quantum sensors [29,[35][36][37][38][39], providing a method for overcoming the aforementioned challenges.Here, by adopting the squeezing parameter [40] (lower value of the parameter corresponding to a better spin-squeezed state) as the objective function, we propose variational spinsqueezing algorithms on 1D quantum devices with nearestneighbor interactions to achieve not only OAT but also TAT.

II. VARIATIONAL SPIN-SQUEEZING ALGORITHM WITH DIGITAL QUANTUM CIRCUITS
The workflow of variational spin-squeezing algorithms consists of four parts (see Fig. 1): (i) the objective function; (ii) the PQC; (iii) measurement of the squeezing parameter; and (iv) the classical optimizer.Here, for an N -qubit system, the spin squeezing parameter, chosen as the objective function, is defined as [40] ξ where Ŝ is a family of accessible operators, and λ max is the maximum eigenvalue of the matrix M[ρ, Ŝ].For the linear Ramsey squeezing parameter with and The parameter ξ 2 L can be easily measured in near-term quantum computers [19], as discussed below in Appendix A. The definition of the squeezing parameter (1) can be generalized to higher-order nonlinear squeezing parameter, which characterizes the entanglement of non-Gaussian states.
For digital quantum computers, we design the PQC enlightened by the ALA.As shown in Fig. 1(b), the circuit is comprised of arbitrary single-qubit rotations with the angles and two kinds of layers of Fermionic Simulation (FSIM) gates and being the entanglers, where FSIM(θ, ϕ) j,j+1 refers to the FSIM gate applied on the qubit pair consisting of the j-th and (j + 1)-th qubit with  The FSIM gate in (8) plays a key role in the simulation of electronic structures [43,51], and can provide sufficient entanglement for demonstrating quantum advantage [41,42].More importantly, a continuous set of high-fidelity FSIM gates with different control angles θ and ϕ can be experimentally realized [52].
The adjustable couplers in Fig. 1(a) enable us to individually implement the layer of entangler ÛE,1 and ÛE,2 .Here, for simplicity, we choose the same value of the angles (θ, ϕ) in FSIM gates Eq. ( 8) for different layers of entanglers ÛE,1 and ÛE,2 , i.e., all the FSIM gates in the PQC shown in Fig. 1(b) are the same.For the layers of single-qubit rotations, we adopt the protocol where the even (odd) qubits have the same angle → α (P ) ( → β (P ) ).The reason for choosing this protocol is analyzed in Appendix B from the perspective of the expressibility [53] of PQCs and the spatial symmetry.
Then, the final state after the p-layer PQC based on the ALA on the initial state |ψ 0 ⟩ = |00...0⟩ is written as with being a layer of single-qubit rotations (5).Here, and the initial single-qubit rotation without the first Z rotation in Eq. ( 5), due to the chosen initial state |ψ 0 ⟩.In the PQC with p layers, in addition to four variational parameters in the initialization, there are 12p variational parameters for the singlequbit rotations, and only two variational parameters for the entanglers.
After introducing the PQC, we can implement the optimization algorithms, such as the BFGS method [34], to search for the optimum parameters in the PQC for the state with the lowest squeezing parameter.We present details of the optimization by using the BFGS method in Appendix C. Note that the squeezing can be visualized via the Husimi Q function plots the Q function of the optimized state obtained from the variational spin-squeezing algorithm workflow with a depth of PQC p = 3 and a qubit number N = 12.The squeezing parameter of the optimized spinsqueezed state is ξ 2 opt ≃ 0.2, which is comparable to the lowest value of the squeezing parameter for TAT, i.e., ξ 2 TAT ≃ 0.24 (see Appendix D for the definitions of OAT and TAT and related numerical results).
We numerically simulate the variational spin-squeezing algorithm workflow with the PQC based on the ALA, using the BFGS as the optimization algorithm for total 12p + 6 variational parameters, and study the optimized linear Ramsey squeezing parameter ξ 2 L,opt as a function of the depth of the PQC p. Here, we adopt the PQC with periodic boundary conditions (PBCs), as displayed in Fig. 1(a) and (b).
Figure 2(a) shows the results with the system size up to N = 20.It is shown that for p = 1 and 2, the results for different N give the same value of ξ 2 L,opt .However, with increasing p, the values of ξ 2 L,opt diverge for different N .Actually, ξ 2 L,opt will approach the fundamental limit of the linear Ramsey squeezing parameter TAT as a function of p.We can define the p * as the most shallow depth achieving ξ 2 L,opt /ξ 2 L,TAT < 1.We plot p * as a function of N in the inset of Fig. 2(b), showing a slow (approximately linearly) growth of p * as N increases.
Note that OAT or TAT, with infinite-range interactions (see Appendix D), can also be realized by directly decomposing the infinite-range circuit into nearest-neighbor ones, which is known as the line swap strategy [54,55].By using this strategy, a N -qubit infinite-range circuit can be decomposed in N -layers of nearest-neighbor two-qubit gates.Although the depth of the circuit based on the line swap strategy also linearly scales with the qubit number N , to achieve OAT or TAT via the variational spin-squeezing algorithms, the required depth of the PQC is shallower [see the inset of Fig. 2(b)].
We then discuss whether a highly spin-squeezed state can be generated via the variational algorithm without the PBC of the PQC.We first consider a simple case where the PQC is the same as Fig. 1(b) but with open boundary conditions (OBCs), i.e., the two-qubit gate FSIM(θ, ϕ) 1,N is absent.The results are displayed in Fig. 2(c), showing that the ξ 2 L,opt obtained from the PQC with OBC is worse than that for the PQC with PBC.
Next, we consider a protocol, where the single-qubit rotations depends on the index of qubits and the layers (see Appendix B for a schematic representation of the PQC with sitedependent rotations).As shown in Fig. 2(c), with the OBC, although one can obtain a lower value of ξ 2 L,opt via the protocol with site-dependent rotations, the variational algorithm with an open-boundary PQC cannot generate an optimized spinsqueezed state with a squeezing parameter comparable with the case of PBC, suggesting that the PBC plays a key role in designing the PQCs for efficient variational spin-squeezing algorithms.This can be interpreted by the fact that both the OAT and TAT Hamiltonian, i.e., ĤOAT ∝ Ĵ2 z and ĤTAT ∝ Ĵ2 x − Ĵ2 y , have the PBC with cyclic permutation symmetry.Thus, it is expected that the PQCs for efficient variational spin-squeezing algorithms should fulfill the symmetry.
In addition, we consider the PQC, where the angles (θ, ϕ) of the FSIM gates (8) in each layer of entanglers are different, i.e., the protocol with layer-dependent entanglers.We present the schematic of the PQC in Appendix B. As displayed in Fig. 2(c), with PBC, the optimized squeezing parameters ξ 2 L,opt for the protocol with layer-dependent entanglers are only sightly smaller than those for the conventional protocol.However, the protocol with layer-dependent entanglers requires more experimental cost than the protocol shown in Fig. 1(b) since the calibration of two-qubit FSIM gates with different angles (θ, ϕ) is more demanding than single-qubit gates [56].Consequently, the PQC shown in Fig. 1(b) is more experimentally feasible.In Appendix E, in order to guide subsequent experimental investigations, we present the optimized angles (θ opt , ϕ opt ) of the FSIM gates (8) for the variational spin-squeezing algorithms with the PQC shown in Fig. 1(b).
The linear squeezing parameter can be generalized to the second-order non-linear squeezing parameter by adopting 1), which can characterize the entanglement of non-Gaussian states [40].Here we consider the non-linear squeezing parameter ξ 2 N L as the objective function and employed the variational spin-squeezing algorithm workflow with the PQC in Fig. 1(b) to obtain the optimized non-linear squeezing parameter ξ 2 N L,opt .As displayed in Fig. 2(d), for N = 10, ξ 2 N L,opt can achieve the lowest value of ξ 2 N L obtained from OAT and TAT with the depths p = 4 and 7, respectively.In comparison with the linear squeezing parameter, a deeper depth of the PQC is required for achieving the lowest ξ 2 N L of TAT.It has been verified that there is a hierarchy U( ⃗ α (1)  ) U( ⃗ α (1)   ) U( ⃗ β (1)  ) ) U( ⃗ α (3)  ) U( ⃗ α (3)   ) U( ⃗ β (3)  )  with F being the quantum Fisher information [40].Consequently, the inverse of the second-order squeezing parameter ξ −2 N L can estimate the lower bound of F /N .For p = 7, ξ −2 N L,opt ≃ 6.87.Because the violation of the inequality F /N ≤ κ signals (κ + 1)-partite entanglement [1], the optimized state with p = 7 at least has 7-partite entanglement.

III. VARIATIONAL SPIN-SQUEEZING ALGORITHM WITH ANALOG QUANTUM CIRCUITS
For the PQC as shown in Fig. 1(b), between two layers of single-qubit rotations, the entanglers ÛE,1 and ÛE,2 only make local qubit pairs entangled, as a typical digital quantum circuit.In contrast, for the hardware-efficient ansatz (HEA) introduced in Ref. [46], all qubits are entangled between two layers of single-qubit rotations, as shown in Fig. 3(a).Here, instead of using a gate-model-based way to construct the global entangler, i.e., ÛG = ÛE,1 ÛE,2 [46], we focus on the analog quantum process, where the global entangler is realized by letting all qubits evolve under a tailored Hamiltonian ĤT .
According to the results in Fig. 2(c), a PQC with PBC and layer-dependent entanglers has a better performance.Thus, for the design of analog quantum circuits based on the HEA, i.e., the analog-HEA protocol, we still adopt PBC and the layer-dependent global entangler ÛG (t j ) = exp(−i ĤT t j ) with variational parameters t j (j = 1, 2, ..., p for a p-layer PQC).We consider 1D analog superconducting circuits with nearest-neighbor interactions [57][58][59][60][61][62][63][64] as an example, and the tailored Hamiltonian can be written as (see Appendix F for details of the experimental realization) which is known as the 1D XY model.Overall, the final parameterized state obtained from the p-layer PQC of the analog-HEA protocol is where the initial state |ψ 0 ⟩ and the single-qubit rotations Û (l) s and Û (0) s are the same as those in Eq. ( 9).More precisely, the PQC s is an analog-digital circuit, because the layers of single-qubit rotations Û (l) s can be regarded as digital blocks [65].
As shown in the inset of Fig. 2(b), TAT can be achieved by using the variational spin-squeezing algorithm based on the ALA with the depth p * = 2, 3, 3, 4, 4, and 5 for N = 10, 12, 14, 16, 18, and 20.Here, in Fig. 4, we plot the ξ 2 L,opt obtained from the analog-HEA protocol with p = p * for different N .It is seen that the shallow-depth analog-HEA protocol can still generate a spin-squeezed state better than that obtained from the TAT, which provides the possibility for generating strong squeezing on near-term analog quantum computers.
Next, we explore the variational spin-squeezing algorithm based on the PQC shown in Fig. 5(a), with an additional entangler as the global Ising interaction, i.e., the analog-HEA-Ising protocol.The final parameterized state obtained from the p-layer PQC shown in Fig. 5(a) is where |ψ 0 ⟩, Û (0) s , and Û (l) s are the same as those in Eq. ( 14).In Fig. 5(b), we display the optimized squeezing parameter ξ 2 L,opt for the analog-HEA-Ising protocol, in comparison with the analog-HEA protocol shown in Fig. 3(a).It is seen that the ξ 2 L,opt obtained from the analog-HEA-Ising protocol can achieve lower values, which tend to the fundamental limit ξ 2 lim ≃ 0.167 with increasing p.The results shown in Fig. 5(b) indicate that the Ising interactions are indispensable for the design of variational spin-squeezing algorithms, which can achieve the fundamental limit of the linear Ramsey squeezing parameter.

IV. EXPERIMENTAL IMPERFECTIONS
We now analyze the influence of experimental imperfections on variational spin-squeezing algorithms.We focus on the algorithm based on the ALA, which is shown in Fig. 1(b), since it outperforms the analog-HEA protocol with p = 5 of the PQC [see Fig. 3(c)].Here we study the influence of the coherent errors in the FSIM gate (8).In experiments, the coherent errors can be induced by the uncertainty of θ and ϕ in Eq. ( 8), and the additional phases ∆ + , ∆ − , and ∆ −,off [66].One can see Appendix G for the formulation of the FSIM gate with coherent errors, i.e., FSIM exp.(θ * , ϕ * , ∆ + , ∆ − , ∆ −,off ).The coherent error can be quantified by where the target FSIM gate is FSIM target = FSIM(θ opt , ϕ opt ) with the optimized parameters (θ opt , ϕ opt ) obtained from the variational algorithm without the coherent error, and FSIM exp.represents the FSIM gate with the coherent error.As shown in Fig. 6(a), with coherent errors, the squeezing generated by the variational algorithm becomes weaker.When the coherent errors in the entanglers are considered, the FSIM gates of different qubit pairs are not identical (see Appendix G), and the partial permutation symmetry in the PQC as shown in Fig. 1(b), where all the FSIM gates are the same, is absent for the PQC with coherent errors.Consequently, according to the results of the PQC with site-dependent rotations [see Fig. 2(c)], one can expect a lower ξ 2 L,opt by employing the PQC with site-dependent rotations than its conventional version.As shown in Fig. 6(b), the optimization trajectory for the saturation of ξ 2 L to its optimized value ξ 2 L,opt is longer for the protocol with site-dependent rotations compared to the conventional protocol, due to its larger number of variational parameters.Moreover, the influence of the coherent errors on the generated squeezing is suppressed by using the protocol with site-dependent rotations [see Fig. 6(c)].

V. DISCUSSIONS
We have developed variational spin-squeezing algorithms for 1D quantum devices with nearest-neighbor interactions.We designed the PQC enlightened by the ALA, suitable for digital quantum computers, as well as the PQC based on the HEA, which can be naturally realized in analog superconducting circuits.We demonstrated that variational spinsqueezing algorithms with both digital and analog versions of the PQC can generate the spin-squeezed states comparable to the best spin-squeezed state obtained from TAT.Our work sheds light on the variational optimization of quantum sensors [38,39,67] for 1D quantum devices with nearestneighbor interactions.
The variational spin-squeezing algorithms proposed in this work pave the way for experimentally achieving the strongest squeezing generated from TAT.The efficient numerical simulation of the PQC shown in Fig. 1(b) with PBC for large system sizes is an intractable problem, because the matrixproduct-state-based algorithm is less efficient for PBC [68].Consequently, testing variational spin-squeezing algorithms on actual experimental platforms is desirable, because it can extend the results shown in the inset of Fig. 2(b) to larger system sizes and demonstrate the scalability of variational spinsqueezing algorithms.
For the analog version of the variational spin-squeezing algorithm, the global entangler is implemented by the unitary dynamics under the tailored Hamiltonian that describes an array of superconducting qubits with nearest-neighbor capacitive couplings.A further direction is to study the performance of the variational spin-squeezing algorithm based on other experimental platforms such as the Rydberg-dressed atoms [69][70][71][72] and cavity quantum electrodynamics systems [73][74][75].
We then calculate the expressibility of the PQCs in Fig. 7, and plot the results in Fig. 8 L generated by the OAT and TAT, i.e., the ξ 2 OAT and ξ 2 TAT as a function of the system size N .
Finally, for the OAT and TAT, we calculate the second-order non-linear squeezing parameter defined in the Eq. ( 1) with ŜNL = ( Ĵx , Ĵy , Ĵz , Ĵ2 x , Ĵ2 y , Ĵ2 z , Ĵ2 xy , Ĵ2 yz , Ĵ2 zx ).In Fig. 12 In Table I, we present the optimized angles (θ opt , ϕ opt ) of FSIM gates (8) in the PQC shown in Fig. 1(b) with different depth p and system size N .For each p, one can see a weak dependence of θ opt and ϕ opt on N .However, the values of θ opt and ϕ opt are sensitive to the depth of the PQC p.For p = 1 and 2, θ opt > ϕ opt , while for p ≥ 3, θ opt < ϕ opt .
To quantify the entanglement of the FSIM gates defined by Eq. ( 8), we consider the entanglement power (EP) [76], which is express as

FIG. 1 .
FIG. 1.(a) A digital quantum computer consisting of a loop of superconducting qubits connected with couplers.(b) Schematic of the parameterized quantum circuit (PQC) based on the alternating layered ansatz with N = 12 qubits and the number of layers p = 2.Here, the two-qubit gate notation refers to the Fermionic Simulation (FSIM) gate defined by Eq. (8).The initial state is chosen as |ψ0⟩ = |00...0⟩, where |0⟩ is the eigenstate of σz with the eigenvalue −1.The variational parameters are denoted as ⃗x.One layer of the PQC contains two layers of entangler ÛE,1 and ÛE,2 , each of which is followed by a layer of single-qubit rotations.After measuring the final state of the PQC, the value of objective function ξ 2 (⃗ x) can be obtained and then is fed into the classical computer, where the optimization algorithm is running, finding the next set of variational parameters ⃗ xnew.Then, ⃗ xnew is fed into the quantum computer, completing one loop of the algorithm.Finally, by iteratively running several loops, one can obtain the optimized objective function ξ 2 opt = ξ 2 (⃗ xopt).(c) The Husimi Q function for the optimized spinsqueezed states generated by the 12-qubit PQC with p = 3.

FIG. 2 .
FIG. 2. (a) The optimized linear Ramsey squeezing parameter ξ 2 L,opt as a function of the depth p of the PQC for different numbers of qubits N = 10, 12, 14, 16, 18, and 20.The inset of (a) shows the ξ 2 L,opt for the deeper depth of the PQC p with N = 10 and N = 12.The dashed and dotted horizontal lines represent the value of the fundamental limit of the linear Ramsey squeezing parameter with N = 10 and N = 12, respectively.(b) The ratio of ξ 2 L,opt to the lowest squeezing parameter ξ 2 L,TAT obtained from TAT, i.e., ξ 2 L,opt /ξ 2 L,TAT , as a function of the depth p.For each system size N , only the data with p ≤ p * are plotted, where p * denotes the smallest depth required for achieving ξ 2 L,opt /ξ 2 L,TAT < 1.The inset of (b) shows the p * as a function of N , where the dashed line is the linear fitting.(c) The optimized squeezing parameter ξ 2 L,opt as a function of the depth p for different designs of the PQC with N = 12.(d) The optimized nonlinear Ramsey squeezing parameter ξ 2 N L,opt as a function of the depth p for N = 10 qubits.The dashed and dotted lines in (d) represent the lowest nonlinear Ramsey squeezing parameter obtained from OAT and TAT, respectively.Note that (a) and (c) have a vertical logarithmic axis.

ALAFIG. 3 .
FIG. 3. (a) Schematic of the PQC for the analog-HEA protocol with the number of layers p = 2. (b) Semilogarithmic plot of the optimized linear Ramsey squeezing parameter ξ 2 L,opt versus the depth p of the PQC for N = 10.The dotted horizontal line is the saturated value of ξ 2L,opt for the analog-HEA protocol, i.e., ξ 2 L,opt ≃ 0.2.The dashed horizontal line represents the fundamental limit of the squeezing parameter with N = 10, i.e., ξ 2 lim ≃ 0.167.(c) The ξ 2 L,opt as a function of the number of qubits N with the depth of PQCs p = 5.Here, ALA refers to alternating layered ansatz.

3 FIG. 4 .
FIG. 4. The optimized linear Ramsey squeezing parameter ξ 2 L,opt obtained from the variational spin-squeezing algorithm based on the PQC shown in Fig. 3(a) with depth p = p * , for different numbers N of qubits, in comparison with the ξ 2 TAT .

FIG. 5 .
FIG. 5. (a) Schematic of the PQC for the analog-HEA protocol consisting of both the time evolution of the XY model ÛG (tj) and the Ising model ÛZ (Tj) (the analog-HEA-Ising protocol).Here, the depth of the PQC is p = 2. (b) The optimized linear Ramsey squeezing parameter ξ 2 L,opt versus the depth p of the PQC for N = 10.Here, both the analog-HEA-Ising protocol and the analog-HEA protocol are considered.

FIG. 6 .
FIG. 6.(a) The optimized linear Ramsey squeezing parameter ξ 2 L,opt obtained from the variational spin-squeezing algorithm based on the ALA as a function of the number N of qubits with depth p = 5 and different coherent errors r.(b) For N = 10 and r = 0.005, the squeezing parameter ξ 2L versus iterations during the optimization, for both the conventional ALA protocol and the ALA with site-dependent rotations.(c) For N = 10 and p = 5, the optimized squeezing parameter ξ 2 L,opt with different coherent errors r.Here, we consider both the conventional ALA protocol and the ALA with site-dependent rotations.Note that (a) has a vertical logarithmic axis, and (b) has both logarithmic axes.

FIG. 7 .
FIG. 7. (a) A PQC with global single-qubit gates and PBC.(b) A PQC which is similar to that shown in the Fig 1(b) but with the system size N = 10.(c) A PQC with site-dependent single-qubit gates and PBC.Here, the two-qubit gate notation refers to the FSIM gate defined by Eq. (8).

FIG. 9 .√ 2 , 2 ,
FIG. 9. (a) A PQC which is similar to that shown in the Fig 7(b), but with the open boundary condition (OBC).(b) A PQC which is similar that shown in the Fig 7(b), but with layer-dependent entanglers.(c) A PQC with site-dependent single-qubit gates and OBC.Here, the two-qubit gate notation refers to the FSIM gate defined by Eq. (8).
(b), we display the PQC with the same design of Fig. 1(b) in contrast to other designs of the PQCs.In Fig. 7(c), we plot the PQC with site-dependent single-qubit gates, i.e., all qubits could have different single-qubit rotations in each layers.The k-th layer of the single-qubit rotations in the PQC as shown in Fig. 7(c) can be represented as Û

FIG. 11 .
FIG. 11.(a) Linear spin squeezing parameter ξ 2 L as a function of the evolution time τ for the OAT and TAT with system size N = 20.The dashed and dotted horizontal lines represent the minimum ξ 2 L generated by the OAT and TAT, i.e., ξ 2 OAT = 0.1979 and ξ 2 TAT = 0.1623, respectively.(b) The minimum ξ 2L generated by the OAT and TAT, i.e., the ξ 2OAT and ξ 2 TAT as a function of the system size N .

FIG. 12 .
FIG. 12. (a) For the OAT, the time evolution of both the linear spin squeezing parameter ξ −2 L and the second-order non-linear squeezing parameter ξ −2 N L for system size N = 10.(b) For the TAT, the time evolution of ξ −2 N L with system size N = 10.