Quantum Photonic Simulation of Spin-Magnetic Field Coupling and Atom-Optical Field Interaction

In this work, we present the physical simulation of the dynamical and topological properties of atom-field quantum interacting systems by means of integrated quantum photonic devices. In particular, we simulate mechanical systems used, for example, for quantum processing and requiring a very complex technology such as a spin-1/2 particle interacting with an external classical time-dependent magnetic field and a two-level atom under the action of an external classical time-dependent electric (optical) field (light-matter interaction). The photonic device consists of integrated optical waveguides supporting two collinear or codirectional modes, which are coupled by integrated optical gratings. We show that the single-photon quantum description of the dynamics of this photonic device is a quantum physical simulation of both aforementioned interacting systems. The two-mode photonic device with a single-photon quantum state represents the quantum system, and the optical grating corresponds to an external field. Likewise, we also present the generation of Aharonov–Anandan geometric phases within this photonic device, which also appear in the simulated systems. On the other hand, this photonic simulator can be regarded as a basic brick for constructing more complex photonic simulators. We present a few examples where optical gratings interacting with several collinear and/or codirectional modes are used in order to illustrate the new possibilities for quantum simulation.


Introduction
One of the most promising tasks in quantum science and technology is the implementation of quantum simulations. Its physical foundation is based on the fact that the dynamics of a quantum system is governed by its HamiltonianĤ (time evolution) or momentum operatorM (spatial evolution), that is given a Hilbert space H and some input state |Ψ(0) ∈ H, the full evolution of the system is given by the action of the evolution operator on such a state. The evolution operator can be either the time evolution oneÛ t = exp (−iĤt/h), which comes from the Schrödinger equation −ih∂|Ψ /∂t =Ĥ|Ψ , that is |Ψ(t) =Û t |Ψ(0) , or its spatial counterpartÛ s = exp (iMs/h), which comes from the momentum operator in the position representation, that is ih∂|Ψ /∂s =M|Ψ , where s is the spatial variable that defines the direction along which the system evolves (it can be, for instance, the z-direction) then |Ψ(s) =Û s |Ψ(0) . One is perhaps more familiar with the temporal case |Ψ(t) =Û t |Ψ(0) , but note that the spatial case is totally analogous [1,2]. Now, as it occurs in nature that very different and unrelated quantum systems share analogous Hamiltonians or momentum operators, the dynamics of these systems will be analogous. This implies that if we have some system of interest, we will be able the fast and energetically efficient operation and miniaturization capabilities of integrated photonics, which favor scalability. Moreover, integrated photonic devices are becoming some of the most powerful and appealing technologies for classical and quantum information [13,14]. Finally, we must stress that although we present a photonic device for quantum simulation, it can be also used to implement quantum operations and/or effects with the photonic device itself such as logic gates, geometric phases, and so on.
The plan of the paper is as follows: In Section 2, we briefly present the Hamiltonian of the quantum interacting systems, in a suitable form for their photonic simulation, along with the physical parameters and some useful solutions. In Section 3, starting from quantum states as single-photon states, an integrated photonic device for the quantum simulation of both a spin-magnetic field coupling and light-matter interaction is presented, along with the limits of this simulation. In Section 4, quantum simulation of geometric phases is studied. Finally, a summary is presented in Section 5.

Mechanical Interacting Systems
In this section, we present the main results about the mechanical interacting systems whose dynamic and topological properties are going to be simulated with an integrated photonic device. The primary aim is to write the Hamiltonians of these systems in a suitable form to facilitate the study of their photonic simulations.

Spin-1/2 Particle Interacting with a Magnetic Field
The Hamiltonian of a spin particle interacting with a magnetic field is given byĤ = −µ · B, where µ is the magnetic moment of the particle, which is proportional to the spin operator, and B is the magnetic field. Let us consider a spin- 1 2 particle, then µ = 1 2 µσ, where µ =hγ p , with γ p the gyromagnetic ratio of the particle (p = e for an electron, p = n for a neutron, etc.), and σ = (σ x , σ y , σ z ) are the Pauli matrices. Moreover, we choose a time-dependent magnetic field, which, by assuming a sinusoidal dependence in time with frequency ω, is written as B = B 0 (sin θ cos ωt, − sin θ sin ωt, cos θ), representing a magnetic field of modulus B 0 rotated an angle θ with respect to the z-axis and spinning around this same axis with a frequency ω. We can then write the well-known spin-magnetic Hamiltonian as (see for instance [8]): By taking into account the expressions of the Pauli matrices, then the above Hamiltonian gives rise to the following time-dependent Schrödinger equation: This time-dependent Hamiltonian is enough for our simulation purposes. Note that for the neutron case, we have the well-known Nuclear Magnetic Resonance (NMR). The solution of the equation above can be obtained as a time-dependent linear combination of down and up spin states, |0 and |1 , of the particle, that is |Ψ(t) = c o (t)|0 + c 1 (t)|1 . Thus, by using the vector representation of |Ψ(t) and the matrix Hamiltonian given by Equation (2), the Schrödinger equation can be rewritten as follows: ih dc n (t) dt = E n cos θc n (t) + i ∑ n =m C nm (t)c m (t).
with n = 0, 1, E o = −¯h γ p 2 B o and E 1 =¯h γ p 2 B o the eigenvalues of spin states when a static magnetic field along z-direction is applied, and C 01 (t) = C * 10 (t) = −¯h γ p 2 B o sin θ exp(iωt) the coupling coefficients. On the other hand, it is interesting, for the sake of expositional convenience, to present the main results about the dynamics of the system. First of all, in order to simplify things, we can shift to a reference frame that is rotating at a frequency ω by means of the following unitary transformation: therefore, by inserting |Ψ(t) = exp (iωσ z t/2)|η(t) into the Schrödinger equation, we obtain, after some simple calculations, the following Hamiltonian acting on |η(t) : This HamiltonianĤ can be rewritten as a product of the form −¯h 2 γ p (σ · B e f ), with B e f an effective static magnetic field, that is, with: and: therefore, the effective magnetic field is given by B e f = (B 0 sin θ , 0, B 0 cos θ ), where B 0 and θ are related to B 0 and θ by B 0 = B 0 ∆, with sin θ = γ p B 0 sin θ/∆ o = sin θ/∆ and cos θ = γ p B 0 [cos θ − (ω/γ p B 0 )]/∆ o = [cos θ − (ω/γ p B 0 )]/∆. As seen from the expression for ∆, it would seem that for this reparametrization to have physical meaning, restrictions on the parameters would appear, as ∆ contains a possible non-positive term under the square root. The worst case would be likely to happen if cos θ = 1, but one can find that the resulting quantity 1 − (2hω/µB 0 ) + (hω/µB 0 ) 2 is never negative, for any value of the parameters. Next, it is interesting to compute the eigenstates |η and eigenvalues E η of HamiltonianĤ given by Equation (6), that is |η(t) = exp − ī h E η t |η(0) . After a standard calculation, we have: where |0 ≡ (1, 0) T and |1 ≡ (0, 1) T , with T denoting the transpose. The eigenvalues are E ± = ±¯h 2 ∆ o , that is E ± = ±¯h 2 γ p B 0 = ± µ 2 B 0 . Therefore, by taking into account Equation (4), the full evolved states |Ψ(t) can be easily obtained.

Two-Level Atom Interacting with an Electric (Optical) Field
On the other hand, let us consider a two-level atom coupled to a harmonic external classical electric field, which describes semiclassical light-matter interaction. As is usually done [9], we label the atomic levels as |g (ground) and |e (excited). They have energieshω g andhω e , respectively.
Their energy difference is given by hω 0 =h (ω e − ω g ). The expression for this non-interacting part of the Hamiltonian can be formally written as follows: where we used the matrix representation of |g g| and |e e|, withω = (ω g + ω e )/2, and I the two-dimensional identity matrix. As for the interacting part, it is given by the dipole interaction (electric dipole approximation) between an external electric (optical) field and the atom. Indeed, by assuming, for the sake of simplicity, that the field is propagating along z, has a sinusoidal dependence in time with frequency ω, and is linearly polarized along the x-direction, then the electric (optical) field can be written as follows E = E 0 cos ω(z/c − t u x . Moreover, we disregard the spatial dependence of the electric (optical) field because the wavelength λ = c/2πω is considered much larger than the atomic dimensions. Therefore, we apply the dipole or long-wavelength approximation, that is by assuming without lost of generality ωz/c = 2mπ, with m an integer, then E = E 0 cos ωt u x , the electric-dipole interaction is given byĤ where d is the atomic dipole operator d = q · r, with q = −e, and r is the electron's position vector (operator). This interaction term allows transitions between the two levels. The form of the dipole operator can be calculated by using twice the closure relationshipÎ = |g g| + |e e|, that isÎ(−ex)Î; therefore: with c ± = ( g|ex|g ± e|ex|e )/2, d 0 = g|ex|e , and where we have used the matrix representations (|g e| + |e g| ≡ σ x , |g g| ≡ (I + σ z )/2, and |e e| = (I − σ z )/2. We must stress that sometimes, parity arguments [9] narrow the form of the dipole operator, leading up to the expression d x = − g|ex|e (|g e| + |e g|) = −d o σ x . Likewise, it is customary to introduce the Rabi frequency Ω = E o d o /h. In short, the total Hamiltonian is given byĤ o +Ĥ I , and therefore, the corresponding Schrödinger equation, by using this new variables, is given by: with C ± = c ± cos ωt. The general solution of this Schrödinger equation can again be obtained by using a time-dependent linear combination of fundamental and excited states, |g ≡ |0 and |e ≡ |1 , of the particle, that is |Ψ(t) = c o (t)|0 + c 1 (t)|1 . However, the high value of the frequency ω means that the electric field is rapidly oscillating, which suggests to make the following change |Ψ(t) = f 0 (t) exp(iωt/2)|0 + f 1 (t) exp(−iωt/2)|1 ≡ exp (iωσ z t/2)|η(t) . Moreover, in many cases, by parity arguments, it is fulfilled that c ± = 0. Therefore, by substituting this state into Equation (12), we obtain the following Hamiltonian for the state f 0 (t), with δ = (ω 0 − ω) the detuning parameter and where we have neglected terms rapidly oscillating of the form exp(±iωt); that is, a temporal Rotating Wave Approximation (RWA) has been made, and a time independent Hamiltonian has thus been obtained. We must stress that under this approximation, the terms C ± in Equation (12) can be also neglected independently of the wave-function parity. Finally, note that Hamiltonians given by Equations (6) and (13) have the same algebraic structure.

Quantum Photonic Simulations
In this section, we present the quantum simulation, which can be implemented by an integrated photonic device, that is integrated optical gratings supporting two collinear guided modes, that is two mode guides assisted by a periodic perturbation. It can be considered the basic brick for constructing more complex simulators.

Classical Study of the Photonic Device
Let us consider a standard integrated photonic device consisting of, for example, an integrated waveguide 1D (one-dimensional) with refractive index n(x) (slab guide) that supports two optical modes e 0 (x) and e 1 (x). These modes are collinear and travel in the z-direction with propagation constants β 0 and β 1 , that is wave vectors in the z-direction defined as β = (ω/c)N, where ω is the frequency of the mode and N is the effective index [10]. The mentioned modes are coupled by an integrated grating present in a region of the slab guide, as shown in Figure 1a), where relevant parameters are indicated, that is substrate index n s , film index n f , cover index n c = 1, and film thickness d. The grating is represented, for example, by a periodic modulation (perturbation) of the electrical permittivity [10], with ∆ (x) the modulation strength of the optical grating, α o an initial phase, if required, γ = 2π/Λ the frequency of the perturbation, and Λ its period. This index profile can be obtained by different technologies of integrated optics, for instance ion-exchange in glass [15,16] could be used, or even by optical fiber technology [17]. Likewise, in crystals such as lithium niobate, these optical gratings can also be reconfigurable due to acousto-optic or electro-optic effects [18]. (a) Integrated optical grating with period Λ on a two-mode slab waveguide with modes e 0 (x) and e 1 (x). The inset shows the simulated mechanical device: atom-field interaction. (b) Integrated optical grating with period Λ on a two-mode channel waveguide with modes, for example e 00 (x, y) and e 10 (x, y).
As we assume that only two guided modes are excited in our integrated photonic structure, the perturbed electric field amplitude is given by e(x, z) = a 0 (z)e 0 (x) + a 1 (z)e 1 (x). It is well known that the general set of equations that describe the coupling between n copropagating optical modes with propagation constants β n in a perturbed waveguide and that allow calculating the amplitude coefficients a n (z) is given by (see for instance [10]): whereβ n (z) = β n + C nn (z) are the corrected propagation constants due to the self-coupling coefficients C nn and C nm are the coupling coefficients between the n mode and each of the other m modes. All these coefficients are calculated as follows [10]: with ω the temporal frequency of the modes and e n (x) and e m (x) the normalized optical n and m modes of a planar guide.
The study with 2D guides (integrated channel guides or optical fibers) can be also made, but no new relevant result would be obtained. Indeed, a channel guide can be defined starting from a planar guide whose width is reduced up to a size a of the same order as its depth, that is a ≈ d, as shown in Figure 1b). In such a case, the optical modes are characterized by two subscripts, one for each spatial direction, that is e np (x, y) and e mq (x, y); therefore, the general coupling coefficients are given by: where we assumed that the grating modulation can also have a y-dependence. Finally, the mode coupling equations can be obtained by applying the formal changes n → np, m → mq in Equation (15). Accordingly, the results for planar guides can be easily transferred to channel guides.

Quantum Study of the Photonic Device
A canonical quantization procedure [1,2] proves that the a(z) coefficients become the photon absorption (or emission) operatorsâ(z) (correspondence principle). Therefore, the coupled mode equations are in fact the Heisenberg equations, which, in general, give the evolution of the operators in time. In this case, they give the spatial evolution of the operators. Moreover, the relevant operator here responsible for the spatial propagation of quantum states of the device is the momentum operator, which is the generator of spatial translations [2,19], and not the Hamiltonian, which is the generator of temporal translations. In short, we can study the integrated photonic device in a fully quantum mechanical way, by solving the equations for absorption operators (spatial Heisenberg equations). That is, by performing the change a(z) →hâ(z) in Equation (15), we obtain [2,20]: We must stress that modal coupling preserves energy; therefore, Equation (18) corresponds to a unitary transformation, and accordingly, C nm = C mn . On the other hand, we only consider single-photon states, which is enough for our simulation purposes. We must stress that the linear momentum of a single photon without modal coupling, that is ∆ (x, y) = 0, is given by p (0,1) =hβ (0,1) depending on whether the photon is excited in mode β 0 or mode β 1 [19,20]. Obviously, more general quantum states could be used such as multiphoton states, entangled states of two photons, and so on. These states would give rise to more complex quantum simulations, which fall outside of the scope of this work. In general, the single-photon state is a quantum superposition because the photon can either be excited in the mode β 0 , that is |1 0 , or in the mode β 1 , that is |1 1 . Hence, the general quantum state is given by: where a 0 (z) and a 1 (z) are the quantum complex amplitudes and fulfil the normalization condition |a 0 (z)| 2 + |a 1 (z)| 2 = 1. States |1 0 and |1 1 must be understood as single-photon states at a distance (plane) z. It can be checked that the solutions of Equation (18) for the spatial propagation of emission operators are the same as for single-photon states |L(z) [21]. The main reason is that single-photon states are proportional to emission operators, that is |1 0 =â † 0 |0 , |1 1 =â † 1 |0 . Indeed, let us consider free propagation, that is non-coupling case C nm = 0, then the solutions of Equation (18) areâ 0,1 (z) = exp(iβ 0,1 z)â 0,1 (0). Now, let us consider, for the sake of simplicity, a single-photon state at z = 0, for instance |1 0 , then the optical propagation can be obtained as follows: |1 0 =â † 0 (0)|0 (one-photon emission), but by taking into account the z-propagation, therefore, the coefficients a 0,1 (z) of a single-photon state have the same optical propagation solution as the operatorsâ 0,1 (z). This can be proven for a general unitary transformation after a certain algebra. We will take advantage of this property for simulation purposes. Accordingly, for single-photon states, Equation (18) can formally be rewritten as follows: where |L(z) is given, in vector representation, by (a o (z), a 1 (z)) T andM is the matrix representation of the so-called momentum operator. This is equivalent to the matrix equation given by Equation (2) for the Hamiltonian. We must stress that Equations (2), (3), (13), (18) and (20) are the main results for implementing the quantum simulations in this work.

Photonic Simulation of Spin-Magnetic Field Interaction
Let us consider an integrated optical grating characterized by the function given by Equation (14). It will be useful to work with the slowly varying operatorsÂ n , defined asÂ n =â n exp(−iβ n z). On the other hand, the coupling coefficients for a grating with initial phase α o = 0 can be written as C 00 = c 00 cos γz, C 11 = c 11 cos γz, and C 01 = C 10 = C o cos γz, where c nm = (ω/2) ∆ (x)e n (x) · e * m (x)dx, and so on. Therefore, from Equation (18), we obtain, for the two-mode case, the following spatial Heisenberg equations: i where ∆β 01 = β 0 − β 1 . The above equation reveals that we have oscillating terms coming from the cosine of the self-coupling terms with arguments ±γz and also terms with arguments (γ − ∆β 01 )z and (γ + ∆β 01 )z. We make the assumption that γ is of the same order as ∆β 01 , so that (γ − ∆β 01 ) is small. The other terms are rapidly oscillating and, thus, will average to zero on a sufficiently large z-scale.
We must stress that what we do here is essentially a spatial RWA, which is well-known in light-matter interaction in the time domain. Therefore, the above equations become, to a good approximation, Next, we make the following relabeling ∆β 01 ≡ ∆β and define the new absorption operatorŝ A 0 =b 0 exp(−i∆βz/2) andÂ 1 =b 1 exp(i∆βz/2). We rewrite the Heisenberg equations in terms of theb(z) operators, It is interesting to note thatâ 0,1 andb 0,1 are, after the spatial RWA, the same operators, except a global phase, that isâ 0,1 = b 0,1 exp(iβz),β = (β 0 + β 1 )/2. Finally, as mentioned above, we can write the above equation in a matrix form acting on the single-photon state This equation is just the spatial equivalent of Equation (2). A Hamiltonian operator is replaced by a momentum operator. Obviously, the dynamic properties are identical under the formal changes: Note that a rotating equivalent vector (γ p B) eq ≡ B = B(sin α cos γz, − sin α sin γz, cos α) is obtained. In short, we have achieved a photonic simulator of aspin-magnetic field coupling. However, we must stress some limitations for this simulator. The momentum operatorM defined by (27) and simulating the coupling spin-magnetic field only is valid under the spatial RWA, that is the values of ∆β and γ have to be high and not too different. Therefore, we will be able to simulate the interaction with magnetic fields with a large z-component and oscillating with a frequency ω of the same order as the term γ p B o cos θ.
Finally, it is interesting to obtain a constant momentum operator by applying a unitary transformation (rotating reference system) to the quantum state |L b (z) , that is, Therefore, by using |L b (z) = exp (iγσ z z/2)|l(z) in Equation (27), we obtain, after a certain, but straightforward calculation, the following momentum operator for the state |l(z) : As shown later, these results are important for simulating both dynamical and topological properties. By comparison between Equations (5) and (29), we obtain the following simulation parameters: Next, it is interesting to compute the eigenstates |l(z) and eigenvalues β l of the momentum operatorM given by Equation (6), that is |l(z) = exp ī h p l z |l(0) = exp iβ l z |l(0) . After a standard calculation, we have: with eigenvalues β ± = ±D o /2, that is linear momentums p ± = ±¯h 2 D o = ±p o . Therefore, by taking into account Equation (28), the full evolved states |L b (z) can be easily obtained. Note that we are simulating the quantum state Ψ(t) given by Equation (4), and thus, for example, quantum processing based on NMR could be simulated by this photonic device. For the sake of expositional convenience, we will return to this question in the next subsection.

Photonic Simulation of Light-Matter Interaction
For the case of light-matter interaction, we have a more direct photonic simulation by using a two-mode planar guide perturbed by an integrated optical grating. Thus, by defining ∆β = β 0 − β 1 andβ = (β 0 + β 1 )/2 and for the sake of simulation purposes, choosing an initial phase α o = π, the momentum operator defined in Equation (20) can be rewritten as follows: where C ± = (C 00 (z) ± C 11 (z))/2. As in the mechanical case, these terms could be zero if the optical modes e n,m (x) and perturbation ∆ (x) have a suitable parity, that is even or odd modes along with an odd perturbation. Next, we perform the following relevant change in the vector representation of the single-photon state |L(z) with t indicating the transpose. By inserting this state into the above equation, usingM = −ih∂/∂z, and neglecting terms that are rapidly oscillating, that is exp(±iqγz) with q = 1/2, 1, 3/2, the following momentum operator is obtained for the state |l(z) ≡ l 0 (z), l 1 (z) t : with δ s = ∆β − γ. This momentum operator simulates the Hamiltonian given by Equation (13), where the following simulation parameters are obtained: with δ ↔ δ s the detuning simulation parameter and Ω ↔ C o the Rabi frequency simulation parameter. Hence, this photonic device simulates light-matter interaction under a spatial RWA. Obviously, all temporal dynamics obtained by light-matter interaction can be simulated by means of this photonic device, as for example Rabi oscillations, logic gates for one-qubit transformations, and so on. In order to make clear these possibilities, let us consider the synchronous (or resonant) case, that is ∆β = γ. The momentum operator is thus simplified, and the solutions can be easily obtained. In matrix form, the solution of the equation above is given by: with Θ=C o z and where an irrelevant global phase e iβz has been omitted. As a simple example, if we choose a length of the grating (interaction length) z = 2π/C o , then a Xquantum logic gate is implemented. We must stress that these are transformations corresponding to the so-called Θ-pulses in atom-light temporal interaction for computing purposes [22]. For example, given an input state |1 0 , the state propagating along the optical grating will be: On the other hand, for the case |δ s | C o and by omitting again the global phase e iβz , we obtain, as a solution to Equation (33), a phase gate, that is, where Φ = δ s z. Therefore, a Z quantum logic gate is obtained from Equation (37) if δ s z/2 = π/2, an S-gate if δ s z/2 = π/4, a T-gate if δ s z/2 = π/8, and so on. Moreover, by using an optical grating implementing a transformation X(Θ/2) and two phase gates Z(Φ/2), a ZXZ-factorization of SU (2) is obtained; therefore, any unitary transformation can be implemented with the photonic device, and consequently, any one-qubit can be generated. Next, we present solutions for the asynchronous case, that is ∆β = γ, which provides a most general solution and will be very useful to obtain geometric phases. By using standard methods to solve a linear equation system, the general solution of Equation (33) is given by: with δ r = δ 2 s + C 2 o and where, once more, the irrelevant global phase e iβz is omitted. Note that for δ s = 0, the matrix given by Equation (35) is recovered. Likewise, under the condition |δ s | C o , the matrix solution given by Equation (37) is obtained. We must recall that all these transformations are obtained in a spatial rotating reference system defined by Equation (28) and induced by the RWA approximation, as occurs in atom-light temporal interactions. Likewise, we must stress that by using the simulation parameters given by Equation (34), mechanical solutions for light-matter (atom) interaction are directly obtained. Finally, it is also easy to check that the same solutions are obtained for the spin-magnetic field interaction simulation given by Equation (29); therefore, such an interaction has the same quantum processing properties as the atom-optical field interaction.
Finally, it is worth paying attention to the problem of properly initializing a quantum state. For that, let us consider an SPDC (Spontaneous Parametric Down Conversion) source of biphotons |1 k a 1 k b , that is twin photons excited in two spatial modes propagating along directions k a and k b . Photon |1 k b is directed towards an APD device, and the other one |1 k a is directed to the prism-waveguide coupler, as shown in Figure 1a). The direction k a is chosen in such a way that, for example, if the fundamental mode of the planar guide is excited, that is k a = k 0 , then we obtain the single-photon state (or register) |1 0 . Alternatively, direction k a = k 1 can be chosen to excite the mode e 1 of the planar guide, and thus, the single-photon state (or register) |1 1 is obtained. If we had channel waveguides, a similar procedure can be used, for example before the channel waveguide, there would be a planar waveguide with a prism-waveguide coupler and, next, an integrated lens or a similar integrated optical element [15] in such a way that the excited mode is focused onto the channel waveguide to excite the desired single-photon state. Next, by using optical gratings, different quantum transformations can be performed, and consequently, a general output state |L = a 0 (z)|1 k 0 + a 1 (z)|1 k 1 is obtained. Finally, at a distance z, another prism-waveguide coupler can be placed at the end of the device to detect the quantum state. Photon detections can be made by using coincidences between the output photon and the photon |1 k b reaching the APD.

Implementation of Photonic Simulators
In this subsection, we present more complex simulators by using several integrated optical gratings along with other integrated components as Directional Couplers (DCs) made with Single-Mode (SMWs) or Two-Mode channel Waveguides (TMWs). We present a simulator of the interaction between an atom with four levels and Θ-pulses, next the interaction of a particle (or physical system) with spin 3/2 and a magnetic field, and finally, an arbitrary unitary transformation SU(4) implemented with optical gratings what allows reducing the number of paths by half or even to a quarter, which can be generalized to SU(N) transformations, which can be of interest for photonic simulators.
Let us consider, as the first example, the Optical Grating (OG) studied above, but with a number d = 4 of collinear guided modes whose propagation constants are β j with j = 1, 2, 3, 4. This simple device can simulate a four-level atom, which can be used to implement a CNOT logic gate operation under atom-laser interaction [22]. The optical grating fulfills γ = β 2 − β 3 ; therefore, it will produce an efficient transition between Modes 2 and 3 if z = π/C o (π-pulse in atom-laser interaction) according to Equation (35). We can identify each single-photon state excited in each optical mode as a computational state (two-qubit single-photon [23]); thus, we have the state |L = c 00 |00 + c 01 |01 + c 10 |10 + c 11 |11 . When this state goes through the optical grating, the output state is |L = c 00 |00 + c 01 |01 + c 11 |10 + c 10 |11 , that is a CNOT operation is obtained. Obviously, this is not the best way to implement logic gates for two-qubits, but it makes clear how OGs can be used to simulate interaction between an atom with several levels and the so-called Θ-pulses.
The second example consists of using single-mode channel guides coupled by OGs in order to simulate the interaction between a particle (or physical system) with spin s and a magnetic field. This can be implemented by using a number N=2s+1 of optical modes excited in N channel waveguides and coupled by OGs, as shown in Figure 2 for the particular case of four guides (spin s=3/2). We must stress that coupling between parallel SMWs can be also described by the Heisenberg quantum equations given by Equation (18). In order to simulate spin-magnetic field interaction, either the strength of the OGs or the separation between consecutive SMWs has to be adjusted, and therefore, proper coupling strength values C j,j+1 with j=1, ...N − 1, between consecutive guides, are obtained. Likewise, the SMWs have to be designed with different propagation constants β j (asynchronous guides) by changing, for example, the depth of each channel waveguide. Finally, it is well known in integrated optics that for asynchronous DCs assisted by optical gratings, the coupling due to the overlapping fields is negligible. As a particular example, let us consider spin s = 3/2. The general equation system is given by: with (|j − j | < 2), that is coupling only exists between consecutive channel guides. Next, by using the same procedure followed for the case of spin-1/2, we obtain, after a long, but straightforward calculation, the following equation system: where I 4x4 is the identity matrix and the following propagation constants are used: These values can be achieved by adjusting, for example, the width of the channel waveguides. On the other hand, the coupling coefficients for the gratings fulfil the relationships C 12 =C 21 =C 34 =C 43 = √ 3C o and C 23 =C 32 =2C o , which can be achieved by adjusting the separation between consecutive guides with optical modes e j (x, y), j=1, 2, 3, 4. In our case, Guides 2−3 are closer than 1−2 and 3−4 because the coupling between Guides 2and3 is larger, as shown in Figure 2. Finally, by defining cos θ = ∆ o /Γ and sin θ = C o /Γ, with Γ = (∆ 2 o + C 2 o ) 1/2 , and a fictitious magnetic field B f = (sin θ cos γz, − sin θ sin γz, cos θ), we can write the above equation system as follows: where J(3/2) = (J x (3/2), J y (3/2), J z (3/2)) are the spin matrices for spin s = 3/2. In short, we constructed a photonic simulator for interaction between a spin-3/2 particle, or physical system, and a periodic magnetic field. Next, we present a general unitary transformation SU(4) by using optical gratings. With this example, we want to show that OGs allow reducing the number of paths required for constructing a simulator. Indeed, an SU(4) simulator is formed by four paths implemented by SMWs with optical modes e 10 (x, y) (j = 1, 2) and six OGs, as shown in Figure 3 (up). In this case, we also use Selective Directional Couplers (SDCs) (a SDC always performs an X transformation in one mode, and the other mode undergoes an identity transformation). Note that the number of paths was reduced by half because OGs act on collinear modes, unlike directional couplers, which act on codirectional modes. Obviously, if we had used OGs with four modes, we could reduce the number of paths by 1/4. Overall, we will be able to reduce the number of paths by 1/d if we use OGs with a number d of collinear modes. Ultimately, we can take advantage of the OGs to increase integration and thus to implement more flexible and scalable photonic simulators such as for example boson sampling ones [24], where the number of paths would be reduced by half. In short, the number N of paths of any required SU(N) transformation [25] could be reduced up to N/d. e 00 (1) e 00 (2) e 00 (3) e 00 (4)  Finally, it is important to indicate that quantum photonic devices have their own limitations [4]. Thus, the difficulty to implement two-qubit logic gates is well known, which is, at present, an important drawback in general purpose quantum photonic computation. However, quantum photonic simulation, or simply quantum photonic computation, for specific purposes can provide efficient technological solutions, particularly if new degrees of freedom are incorporated. In our case, we have just shown that integrated OGs allow processing with several collinear modes, which improves the optical integration for high-dimensional problems, that is it provides a moderate increase of the on-chip flexibility and scalability for photon-based quantum simulation. Moreover, OGs enable simulating quantum devices under variable perturbations and, in particular, periodic perturbations, which usually appear in quantum systems interacting with fields like spin (N=2s+1 modes)-magnetic field interaction, atom (d modes)-optical field interaction, and so on.

Quantum Geometric Phases
So far, we have simulated the dynamics of the spin-magnetic and light-matter interaction systems with a photonic device. However, these quantum devices also generate topological or geometric phases besides the dynamic phases. Geometric phases are precisely due to geometric properties as was originally proven by Berry in his seminal work about an adiabatic quantum system [26]. Later, these geometric phases were generalized by Aharonov and Anandan [27] to non-adiabatic processes, and their calculation is made by using the geometric properties of the projective Hilbert space. Finally, a useful extension to geometric phases associated with non-cyclic circuits on the projective Hilbert space was also proposed [28]. On the other hand, topological phases in optics have also been extensively studied in bulk devices with polarization modes [29] and also in integrated optics with spatial modes [30]. At present, geometrical phases have regained interest for their possible application to geometric quantum computation [31,32]. Non-adiabatic spatial propagation on the Hilbert space generate the geometric phase known as the Aharonov-Anandan (AA) phase. It is well known that the spin-magnetic field interaction, as for example NMR, produces AA phases. We must stress that the geometric phase for a two-dimensional projective Hilbert space can be calculated in a geometric way as φ g = (1/2)Ω(C), where Ω(C) is the solid angle subtended by the circuit C followed by the quantum state on the Bloch sphere. In this section, we prove that quantum geometrical phases can be obtained by an integrated photonic grating, and therefore, it simulates the geometric phases produced by both a spin-magnetic field system and an atom-optical field system.

Geometric Phases in Spin-Magnetic Field Photonic Simulation
Let us consider the eigenstates |l ± (0) given by Equation (31). Spatial propagation of these states is given, according to Equations (28) and (31), by |L b (z) ≡ |L ± (z) = exp(iγσ z z/2)|l ± (z) = exp( ip ± h z) exp(iγσ z z/2)|l ± (0) . For instance, let us take |L + (z) after a propagation distance z = νΛ, that is for a photonic integrated grating with a length νΛ, where Λ = 2π/γ and ν is the number of cycles taken, then we have: By following the same procedure for the state |L − (z = νΛ) and taking into account that ν is an integer, we obtain: The phases φ ± obtained above are the full phases acquired by the states |L ± after ν cycles in the optical grating, that is, A photonic Bloch sphere is shown on the left in Figure 4 where each point corresponds to a single-photon state given by Equation (19). For comparison purposes, an NMR Bloch sphere is also shown on the right. A single-photon state propagating along z can be represented by the following general expression |L(z) = c 0 (z)|1 0 + c 1 (z)|1 1 ; therefore, each point (x, y, z) of the photonic Bloch sphere is defined as follows: x = 2 Rec 0 (z)c 1 (z), y = 2 Imc 0 (z)c 1 (z), z = |c 0 (z)| 2 − |c 1 (z)| 2 , where Re and Im stand for real and imaginary parts, respectively.
It is easy to check that eigenstates |L ± (z) follow the curves C c and C c corresponding to spherical caps, as shown in Figure 4. The solid angle subtended by a spherical cap with an angular extension α is given by Ω(C) = 2π(1 − cos α ).
As the full phase φ can be decomposed into a dynamical part φ d and a geometric one φ g , then the geometric phase can be obtained from the relationship: We first compute the dynamical phase, that is φ ± d = 1 h νΛ 0 L ± (z)|M(z)|L ± (z) dz; therefore, by taking into account the transformation (28) and expression (29) forM , we obtain: and by taking into account the total phase given by Equation (43), the geometrical phases acquired by the eigenstates are given by: (47) Note that the geometric phase is half the solid angle subtended by the circuit, where the sign ± depends on the direction of rotation followed by the state on the Bloch sphere. The corresponding spherical cap circuits C c and C c are shown in Figure 4. Moreover, the geometric phase depends on the device parameters, that is ∆β, γ, C o . Likewise, it is important to indicate that the dynamical phase is of order ω 1 (note that β ∝ ω), but the geometrical phase is of order ω 0 ; therefore, the geometric phase is less sensitive to errors in the distance propagation. . Likewise, a spherical wedge circuit C w is shown. On the right, the simulated mechanical Bloch sphere for an interacting atom-field system is shown, with similar spherical cup circuits for states |η + and |η − and also a spherical wedge circuit C w .
In short, a single-photon state acquires an AA geometric phase under propagation in an integrated photonic grating. The same expression is found for a spin-1/2 particle in a magnetic field; therefore, topological simulations can be made. Thus, by applying the simulation parameters given by Equation (30), geometric phases can be obtained.

Elimination of the Dynamical Phase in Spin-Magnetic Field Photonic Simulation
It is well known in the mechanical case that the geometric phase is hidden in the spin-magnetic field interaction because it is combined with the dynamical phase within φ ± ; therefore, the dynamical phase has to be eliminated in order to take advantage of the properties of a geometric phase. We present a photonic solution, which is similar to the one used in the mechanical case, that is if the quantum state, after evolution under a first HamiltonianĤ 1 =Ĥ for time T, finds a second HamiltonianĤ 2 = −Ĥ, then the dynamical phase are mutually canceled; however, the eigenstates do not change, therefore neither does the geometrical phase.
In the photonic case, we have to find a new momentum operator, that is a new integrated optical grating, such asM 2 = −M. We assume that such a new optical grating has the same frequency γ; therefore, we have the same rotating system, that is the same transformation (28). Accordingly, the condition for eliminating the dynamical phase is obtained from the operatorM , that is, The first condition can be achieved by introducing an initial phase in the second grating, that is ∆ (x, z) = ∆ (x) cos(γz + π), and the second one is achieved if ∆β = 2γ − ∆β. These results indicate that we need an additional grating with a new difference between propagation constants (linear momentum of the photon) ∆β = (β 0 − β 1 ). In Figure 5 the system for eliminating the dynamical phase is shown . Therefore, the total phases are φ ± = ν(∓pΛ/h − π), and the dynamical phases are: Therefore, the total dynamical phase is Φ d = 0, and the total geometrical phase after the single-photon state propagates through the two integrated gratings is twice the value acquired in the first grating, that is, Alternatively, propagation constants can be unchanged, and the grating frequency can be modified, that is γ = 2∆β − γ; however, in this case, the transformation (28) must be applied with the factor γ . In short, we eliminated the dynamical phase; therefore, these results could be used for implementing logic gates or transformations based on topological phases, which are much more insensitive to fabrication errors, unlike dynamical phases, which as mentioned are of order ω. With these results, robust P-gates (Phase gates) can be designed; thus, the following transformation is implemented between the eigenstates: Note that for 4ν cos α = ±1, a Z-gate is obtained, and for 4ν cos α = ±1/2, an S-gate is implemented, and so on. The second grating has an initial phase π. Likewise, a prism is used to make a projective measure of states |1 0 and |1 1 for obtaining the probabilities P 0 and P 1 and, therefore, the geometric phase Φ g .

Geometric Phases with Other Quantum States
On the other hand, the eigenstates given by Equation (31) can be written as single-photon states excited in rotated optical modes, that is e + (x, y) = cos α 2 e o (x, y) + sin α 2 e 1 (x, y) and e − (x, y) = − sin α 2 e o (x, y) + cos α 2 e 1 (x, y); therefore: The elimination of the dynamical phase means that these eigenstates have undergone the transformation e ±iΦ g |1 ± ; therefore, the following formal relationships can be written: with Φ g = −2νπ(1 − cos α ). Accordingly, the following transformations, induced by geometric phases, for the absorption operators are obtained: This result can be used for obtaining geometric phases of other quantum light states. As an example, we present two states, that is the number photon state or Fock state |n + and the coherent state |α + , where subindex + indicates that the state is excited in the optical mode e + (x, y). The Fock state under propagation becomes: Therefore, the quantum state has acquired a geometric phase n + Φ g . Likewise, the coherent state can be rewritten by using the complex displacement operator, that is, Therefore, the geometric phase is Φ g , that is the same as the one acquired by a single photon. The same procedure can be applied to any other quantum light state excited in the integrated photonic grating.

Optical Measurement of Geometric Phases
Finally, we present how to measure the geometric phase starting from the measurements of the single-photon detection probability, which can be extracted by a prism-waveguide coupler [10], as shown in Figure 5. We focus on the spin-magnetic field interaction simulation case. By assuming that the input state is a single photon excited in the mode e 0 (x, y) and taking into account the relationships given by Equation (52), the following final state is obtained after the two gratings: The probability of the detection of a photon in Mode 0, that is P 0 , or in Mode 1, P 1 , is a function of the geometric phase, that is, If Φ g = 2π, then P 1 = 0 and P 0 = 1, and if Φ g = π, then P 1 = sin 2 α and P 0 = cos 2 α. Therefore, from the measurement of P 1 and P 0 , the phase Φ g is obtained. In Figure 5 it is shown the projective measure of states |1 0 and |1 1 by a prism-waveguide coupler, which projects these state in different spatial directions. Finally, note that by using a coherent state, these probabilities are proportional to the intensity of the light, what can be called a semiclassical optical characterization, or in the most technical way, the geometric phase is also acquired by the classical fields, but would rigorously correspond to the so-called Hannay phase [33].

Geometric Phases in Light-Matter Photonic Simulation
Finally, we check that light-matter simulation can be also used to obtain geometric phases. For the sake of simplicity, we show geometric phases for wedge circuits, although more general cases can be studied. Let us consider an initial state |L(0) = |1 0 , that is the point (0, 0, 1) on the photonic Bloch sphere. Next, let us consider an asynchronous optical grating with δ s C o ; therefore, according to Equation (37) (phase gate), for δ s z o = 3π/2, we obtain |L(z o ) = (1/ √ 2)(|1 0 + i|1 1 ), that is the state reaches the Bloch sphere point (0, 1, 0). Next, we consider that the grating has a greater coupling coefficient C o , then the single-photon state is given by the expression: where a = δ s /δ r and b = C o /δ r . If we choose a distance z = z 1 such as δ r z 1 /2 = π/2, then, after a certain calculation, the following state is obtained: where φ o = atn(a/b) = atn(δ s /C o ), that is a = sin φ o and b = cos φ o . The state has reached the point (0, −1, 0) of the photonic Bloch sphere. Now, we show that φ o is a geometric phase. Indeed, for the sake of symmetry, the state before reaching the above state has crossed the meridian y = 0 when δ r z/2 = π/4, that is, the state: It is easy to prove that both states have the same phase, that is 0 = 1 , and the modulus is given by m 0 = sin(φ o /2) and m 1 = cos(φ o /2); therefore, the state crosses the point P = (sin φ o , 0, cos φ o ) of the photonic Bloch sphere as indicated in Figure 4 for ϕ = φ o . Now, we must recall that partial cycles also generate geometric phases, which can be calculated by closing the end points of the open cycle by a geodesic line [28,30]. In our case, the corresponding geodesic lies along the meridian at the plane x = 0, from point (0, −1, 0) to initial point (0, 0, 1). In short, the state has followed a wedge circuit C w , as shown in Figure 4. Now, we calculate the subtended solid angle by this wedge circuit. It is easy to check that a wedge circuit with angle φ o subtends a solid angle Ω(C w ) = 2φ o ; therefore, the geometric phase is Φ g = (1/2)Ω(C w ) = φ o = atn(δ s /C o ), which is just the global phase obtained in Equation (60). It is worth underlining that in this case, the geometric phase is not hidden, and therefore, the dynamical phase does not have to be eliminated. Moreover, this geometric phase can be also obtained in a atom-optical field system out of resonance by using Θ-pulses, with the first optical field with low amplitude E o (Z gate) and the next with a higher amplitude E o . By using the simulation parameters given by Equation (34), the geometric phase would be Φ g = atn(δ/Ω).

Conclusions
We propose a quantum photonic device based on integrated optical gratings in a two-mode slab guide to simulate the interaction between external fields and atoms. By using single-photon states, we study the simulations of a spin-(1/2)-magnetic field system, as for example nuclear magnetic resonance, and a two-level atom-optical field system corresponding to light-matter simulation. Both dynamical and geometric properties are simulated, in particular the geometric phases obtained by the mentioned systems. We prove that dynamical properties can be simulated for a wide range of cases with practical interest, although in the spin-(1/2)-magnetic field system it is restricted to relatively high values of frequency and magnetic field amplitude B o . Overall, atom-optical field interaction does not present these restrictions. This study of integrated optical gratings opens up possibilities to more general simulations if several modes are used. Thus, spin (s)-magnetic field interaction simulations could be implemented by using a number N = 2s+1 of codirectional optical modes assisted by optical gratings; multilevel atom (n)-optical field interaction can be simulated by using N = n collinear optical modes coupled by optical gratings, which can in turn simulate, for example, two-qubit single photon logic gates, which has a high interest in quantum information systems; likewise, optical gratings allow interaction between d collinear modes, and thus, simulators based on N codirectional modes can reduce the number of paths used up to N/d, which improves the optical integration of the photonic simulator. On the other hand, AA geometric phases have been also obtained for both systems. The spin-(1/2)-magnetic field system requires dynamic phase cancellation, which is simulated by using two optical gratings; however, in the atom-optical field system, such cancellation is not required. Obviously, we must emphasize that although the proposed integrated photonic device is intended for quantum simulation, it can also be used to implement quantum operations and/or effects with the photonic device itself, such as logic gates, geometric phases, and so on, by using single-photon states or more general quantum states, as shown.
Author Contributions: All authors contributed equally to this work. All authors read and agreed to the published version of the manuscript. Acknowledgments: One of the authors (G.M.C.) wishes to acknowledge the financial support by Xunta de Galicia, Consellería de Educación, Universidades e FP, by a predoctoral grant co-financed with the European Social Fund.

Conflicts of Interest:
The authors declare no conflict of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; nor in the decision to publish the results.