Digital Quantum Simulation and Circuit Learning for the Generation of Coherent States

Coherent states, known as displaced vacuum states, play an important role in quantum information processing, quantum machine learning,and quantum optics. In this article, two ways to digitally prepare coherent states in quantum circuits are introduced. First, we construct the displacement operator by decomposing it into Pauli matrices via ladder operators, i.e., creation and annihilation operators. The high fidelity of the digitally generated coherent states is verified compared with the Poissonian distribution in Fock space. Secondly, by using Variational Quantum Algorithms, we choose different ansatzes to generate coherent states. The quantum resources -- such as numbers of quantum gates, layers and iterations -- are analyzed for quantum circuit learning. The simulation results show that quantum circuit learning can provide high fidelity on learning coherent states by choosing appropriate ansatzes.


I. INTRODUCTION
The exponentially increasing scaling of degrees of freedom poses challenges in the computation for quantum chemistry [1]. Recent developments in quantum computing present new routes for the exploration of quantum chemistry by taking advantage of quantum resources and manipulating the states of matter. In the Noisy Intermediate-Scale Quantum (NISQ) era [2], seeking appropriate algorithms [3] is crucial for quantum dynamics digital simulation, which is one of the most promising applications.
As the first step of any quantum algorithm, the preparation of an initial state directly decides its success. Furthermore, in the Hamiltonian simulation, an efficient and accurate implementation of U = e −iHt is another crucial task. While the Hamiltonian of a molecule can be expressed easily in terms of its first quantization in real space [4] and simulate the kinetic part using the Quantum Fourier Transformation [5], the basis set for expressing the quantum states is smaller and more explicit in the second quantization [6], since a Fock state can be easily represented in the computational basis.
Analyzing and improving asymptotic scaling of resources on a quantum computer have been widely studied during the last decade [3,[7][8][9]. In the NISQ era, low-depth circuits and reduced number of quantum gates are required to execute quantum algorithms in the presence of limited coherence time. Variational Quantum algorithms (VQA) [10][11][12], which are hybrid quantum-classical methods that take advantage from quantum and classical computation, have demonstrated to be resource-efficient strategies. Among them, Variational Quantum Eigensolvers (VQE) [13,14] can prepare the initial state and estimate the ground-state energy in a flexible and efficient way by choosing a suitable ansatz [15][16][17] in a parameterized quantum circuit (PQC). In addition, optimization in PQCs aims at achieving high fidelity of digital simulation by mitigating quantum errors [18]. To this end, gradient-descent based quantum circuit learning (QCL) [19] can be used to optimize the control function via finding out appropriate variational parameters.
Coherent states are a very special set of states forming the basis of continuous variables in quantum information [20,21], being useful in a wide variety of applications-for instance, to represent thermal and Schrödinger cat states, in the Mach-Zehnder interferometers configuration [22,23], in quantum metrology [24,25], in quantum cryptography [26], in quantum machine learning [27,28], among others. Simulation on coherent states in quantum circuits provides a fundamental and digital alternative to design and optimize quantum phenomena, quantum dynamics in gatebased quantum computers. Since the scalability of quantum algorithms is still limited by the complexity of quantum circuits, high-fidelity and efficient ways for digital quantum simulation of coherent states are indispensable for quantum technologies. In this paper, we propose a new method of digitized quantum simulation to simulate and optimize the generation of coherent states. We first use the creation and annihilation operators of the quantum harmonic oscillator to construct the displacement operator in the basis of a Fock state. By mapping the displacement operator acting on the vacuum state in the circuit, we can obtain coherent states with high fidelity. At the same time, to reduce the consumption of quantum resources in the digitized quantum simulation process, we propose VQA by combining the quantum circuit with a classical optimizer.
The paper is organized as follows. In Section II, we introduce the coherent state and its digital simulation in a quantum circuit by trotterizing the displacement operator, where its decomposition with N qubits is generalized via the creation and annihilation operators. In Section III, the Hardware Efficient Ansatz and Checkerboard Ansatz [29] are used to learn the coherent state. The quantum resources such as the number of quantum gates and iteration times are compared in different schemes. Finally, we give the Conclusion in Section IV.

II. COHERENT STATE AND ITS DIGITAL SIMULATION
First consider a quantum harmonic oscillator with the time-independent frequency ω, whose Hamiltonian can be written as (m =h = 1 in dimensionless units, where m is mass andh is the reduced Planck constant): In the basis of a Fock space {|n }, the creation operatorâ † and the annihilation operatorâ are written respectively Using the displacement operatorD(α) = e αâ † −α * â to act on the vacuum state |0 , we can generate the coherent state |α =D(α) |0 , which is also the eigenstate of the annihilation operatorâ, satisfyingâ |α = α |α with the arbitrary complex number α. As in Fock space N qubits map n = 2 N number of states, we directly express the coherent states in the basis of Fock states {|n }. It is feasible to simulate the generation of coherent states digitally in a quantum circuit, since the displacement operatorD(α) is a unitary operator.
Without loss of generality, we consider α to be a complex number a + bi, where a and b are real numbers and i is the imaginary unit, so that the displacement operator is written aŝ Here, we use the Hermitian matrix Z 1 = i(a † − a) and the symmetric one Z 2 = −(â +â † ), where is truncated from the subspace-embracing N qubits. For N qubits, we need N 2 N −1 Pauli strings for decomposing To express the formula in a more compact way, we can rewrite where c l and A 1,2 (l) are suitable definitions of each of the N 2 N −1 constants and strings, respectively (see Appendix A for more details). By using the first-order Suzuki-Trotter formula [30,31], we can decompose the displacement operator into M number of Trotter steps, wherê In fact,D(a) andD(ib) in Equation 3, representing the real and the imaginary displacements of the coherent state, respectively, are implemented in quantum circuits in completely different ways due to their distinct decomposition into tensor products of the matrices from σ D and σ S . We use Qiskit [32] to implement the quantum circuit. Initialized in the vacuum states, i.e., |0 in all qubits, the quantum circuit generates coherent states after the implementation of the displacement operator (Equation 5) into a finite number of segmentations. For instance, a two-qubit system (N = 2) with four Fock states expressed in the computational basis, leads to the following real and imaginary parts for the displacement operator: For example, the digital implementation of the displacement operator with real and imaginary displacementsD(a) andD(ib) in a single Trotter step, where the total Trotter number is M , expressed by two qubits is shown in Figure  1. To analyze the accuracy of the coherent state we derive, we define its fidelity where |ψ f is the final state prepared by the circuit and |ψ tar is the target state which can be calculated in Fock space as Such a target has the probability of the m-th Fock state in the analytical form which returns a Poissonian distribution centered at n , with n = â †â = |α| 2 . We benchmark our method by digitally generating the coherent state |α = |1 + i . Note that the coherent state is in bold in order to distinguish it from the Fock state |n . The circuit implementation is expressed in Figure 2a, where the blue (real displacement part) and red (imaginary displacement part) blocks act alternatively. Depending on the magnitude of |α| and meanwhile aiming at achieving the desired fidelity, one needs to choose the appropriate number of qubits to derive the coherent state with a desired fidelity in the circuit.   8 10 12 14 16 18 20 22 24 26 28  2b. In Figure 2c, we plot the distribution of the coherent state |α = |1 + i prepared by digitally implementing the displacement operatorD with 3 qubits and M = 20 Trotter steps. It coincides well with the Poissonian probability distribution, indicated from Equation (10), where n = â †â = |α| 2 = 2. The analysis on the accuracy of the coherent state expressed in a truncated space with 2 N states, where N is the qubit number, can be found in Appendix B.

III. COHERENT STATE GENERATION BY VARIATIONAL QUANTUM ALGORITHM
Gradient-based quantum circuit learning, a kind of VQA for supervised learning, aims at achieving the target state by lowering the cost function. In this section, we use a variational quantum circuit combined with classical optimizers to prepare coherent states. Inputting the ground state as the initial state into the circuit, processing the evolution in the form of three alternatives, we obtain the results at the output |ψ f . To approach the target state |ψ tar (Equation 9) and by using gradient descent method based on the cost function where |ψ f and |ψ tar are the final state and target state as defined above, we find the optimized variational parameters in the ansatz. Such VQA is implemented in the Qiskit package where the optimizer is SLSQP from SciPy [33]. Essentially, a core component of a VQA is to find the appropriate ansatz which produces the coherent state with few gates and shallow depth in the circuit. Here, as shown in Figure 3, we apply two kinds of ansatzes by using 4 qubits: Hardware Efficient Ansatz (Figure 3a and Figure 3b, named as Scheme a and Scheme b, respectively) and Checkerboard Ansatz [29] (Figure 3c, named as Scheme c), since they are easy to be implemented in the current and near-term hardware. For the Hardware Efficient Ansatz which consists of a sequence of single-qubit R x , R z , R x gates and two-qubit-entangling Controlled-R y gates, we implemented two alternatives in order to see the relation between the fidelity and the number of control parameters. In Scheme a, the rotation angles of all the gates used in the circuit are the variational parameters with a number of 4N in each layer, where N is the number of applied qubits. While the initial values of all the angles are set to 1 empirically, their optimized values are derived from VQA. For Scheme b, the block of R y gates, with a number of N (equal to the qubit number) labeled in the block as shown in Scheme b, is repeated in each layer. In order to gain the desired fidelity, a number M l of repetition on each layer in the circuit is needed. For a circuit with M l layers, the number of control parameters in Scheme a and b are 4N M l and (3 + M l )N , respectively. The Checkerboard Ansatz, composed by N − 1 blocks connecting neighboring qubits with a sequence of single-qubit R x and R z gates and two-qubit-entangling CNOT gates, is demonstrated in Scheme c, with a total amount of 5(N − 1)M l parameters.  The first two columns of Table I shows the number of the applied single-qubit and CNOT gates for three schemes in terms of the number of layers M l and the number of qubits N , where controlled-R y gates are decomposed into single-qubit and CNOT gates for comparison. In order to guarantee high-precision preparation of coherent states (F > 0.9999), Schemes a, b, and c need 4, 6, and 6 layers for a 4-qubit system, respectively, as shown in Figure 4. Scheme b requires less quantum gates and controlled parameters even though it demands more layers. For VQAs, the running time of the optimization is determined by the iteration steps, the number of parameters to be optimized, the initial value of the parameters, and the chosen optimizer. The last two columns of the Table I show the minimized iteration times and depth to guarantee high-precision preparation of coherent states (F > 0.9999). The minimal steps needed to realize a high-precision preparation of coherent states |1 + i is achieved by Scheme b.  Figure 3 and their corresponding results for acquiring F > 0.9999.

IV. CONCLUSIONS
Coherent states and their digital quantum simulation are of significance in many fields, as a fundamental element in quantum computing, quantum machine leaning, and quantum optics. In this article, we proposed a new method for digitally simulating coherent states in quantum circuits. By expressing the Fock states with an appropriate number of qubits, we decomposed the displacement operator into Pauli matrices via the second quantization. A generalized formula on the Trotter expansion of the displacement operator with N qubits was demonstrated. The derived coherent states in quantum circuits coincided with a Poissonian distribution with high fidelity. Moreover, we also generated coherent states by gradient-based quantum circuit learning. Hardware Efficient Ansatz and Checkerboard Ansatz were used to find coherent states. Different schemes with distinct numbers of variational parameters were compared in terms of quantum resources and iteration times.
In the NISQ era, seeking efficient encoding methods, i.e., shorter circuit depth and less quantum gates while maintaining high fidelities, is always the object for the digital quantum simulation. Finding the optimized ansatzes to generate coherent states which can exhibit robustness in the presence of different kinds of noise will also be considered. These will be explored and addressed in our future work. Meanwhile, the transfer of digital quantum simulation from a coherent state to a squeezed state might be interesting to study. The quantum information processing hardware containing continuous-variable objects, such as mechanical or electromagnetic oscillators, instead of discrete-variable qubits, have demonstrated advantages in some aspects, such as quantum error corrections [34] and data encoding [35], although the physical implementation still demands further development [36]. We hope our method of digital simulation on coherent states will be useful for the dynamic simulation of quantum many-body systems and device design for quantum machine learning.

Appendix A: Decomposition of the Displacement Operator
First of all, we start by computing Z 1 = i(â † −â) and Z 2 = −(â+â † ) using Equation 4 with n = 2 N . Observe that Z 1 is Hermitian and Z 2 is symmetric; so, an odd (even) number of Y matrices, named as n y must appear in the Pauli string decomposition of Z 1 and Z 2 . Its corresponding Pauli strings can be defined as (σ D ) ⊗N −m (σ S ) ⊗m ∀m ∈ {1, . . . , N }. For computing all of them, we need to iterate over m and compute all of the possible strings taking care about the parity of n y . For a general number of qubits N , it can be seen that we need N 2 N −1 Pauli strings for decomposing each matrix. The weights of the Pauli strings for Z 1 are given by with γ m = (−1) ( ny/2 +ñy) mod 2 ,ñ y the amount of Y matrices in the (m−1)-rightmost σ S matrices of the composition, and The weights of the Pauli strings for Z 2 are given from We can rearrange these equations to redefine Z i in terms of its Pauli decomposition, where where c l and A 1,2 (l) are suitable definitions of each of the N 2 N −1 constants and strings, respectively, which this sum returns in order to have a more compact result. Thus, Here, we compute string-by-string Z 1 and Z 2 for n = 3: Z1 : IIσ 2 y : Iσ 1 z σ 2 y :  ), the coherent state in the truncated subspace with N qubits, leading to 2 N available independent states, can be expressed as where Γ(k + 1) = k! is the gamma function and Γ(k, x) is the incomplete gamma function and is defined as Thus, the probability of measuring the state |m is with P m the Poissonian probability given by Equation 10. For the particular case of |α = |1 + i , we can find n = â †â = |α| 2 = 2, since Γ(2 N )/Γ(2 N , 2) = 21e 2 /155 ≈ 1.0011 for N = 3, we can state that P m ≈ P m .