{'fraction_non_alphanumeric': 0.03109346089624983, 'fraction_numerical': 0.010514914932984341, 'mean_word_length': 4.261158594491928, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 17, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Reliability of optical gate array for C-Sign operator

We study optical gate array of KLM model of quantum computer for C-Sign operator, which contains linear elements and two nonlinear phase shifts. Linear elements and photon counting are taken to be ideal, whereas nonlinear phase shifts are subject of realistic and unavoidable factors of decoherence: the immediate photon leak from cavities and mediated leakage with the atom, which flies out of the cavity and plays the role of ancilla. We use JC model with Lindblad master equation to estimate the dependence of the validity of C-Sign operator from the rate of photon leak and estimate the limitation, which this validity imposes to quantum computations.


Introduction and background
Quantum mechanics gives us the new paradigm of computations: the peculiar type of information processing realized by quantum computers, called quantum computations. It has been shown by [1] and [2] that for some specific tasks, quantum computation allows for faster performance than it is theoretically possible in a classical computer. Quantum information and encryption provides a secure way of transmitting information based on the wavefunction collapse property of quantum systems and the use of quantum encryption algorithms. One of the main challenges of the field is the physical realization of a quantum computer. One of the proposals, the KLM scheme [3][4] [5], based on linear optical components, has paved the way for different implementations based on quantum optics.
The photon, being a chargeless and massless particle, is a very adequate candidate as the carrier of quantum information. The advantages of using photons include an easy and low-loss way to transport them using optical fiber, their relatively well understood quantum properties, and the existence of well-developed techniques for generating and measuring photons.
Linear quantum optics has proven to be very good playground for experimental and theoretical developments in the realization of quantum computers. The photons allow for at least two viable representations of quantum information in form of the dual rail and the polarization representation. The parametric down conversion [6] and the single atom microlaser [7] allow us to produce single photons on demand, ready for computation. In addition to that, the KLM scheme provides a mechanism from which all the single qubit gates can be constructed using only mirrors, phase shifters and beamsplitters, which are all common and well understood. Even the nonlinear effects needed to build the CNOT gate can be obtained by the non-deterministic nonlinear shift (NS) gate. The associated decoherence of those components is low, meaning that most of the information loss comes from the photon storage between operations and from the photon measurement. Both of these can be reduced using optical resonators to store light in the infrared and microwave domain, and using solid state photoelectric detectors based in semiconductors to measure the qubits.
The main problem with the KLM scheme is scalability; this means that the resources needed for computation should increase linearly with the number of qubits used. The fact that the NS gate has a low success probability makes successive applications of it unreliable, as the probability of success quickly decreases exponentially. This effect can be countered using quantum teleportation gates as described in [8], but the amount of entangled pairs of qubits needed to make the CNOT gate work with 95% reliability is in the order of 100 pairs per gate [9] which limits the scheme scalability.
Another solution to the scalability problem is to extend the scheme to include nonlinear components. One way of realizing the NS gate is using nonlinear Kerr media to produce cross phase modulation, theoretically solving the main problem of the optical quantum computer model. Nevertheless, there is always some absorption associated with this nonlinearity, and it has been estimated [10] that in the best known case, approximately 50 photons must be absorbed to get one to experience a π cross phase modulation. This means that currently, the use of Kerr media isn't a solution for the scalability problem.
Cavity QED poses itself as a solution to the challenge of scalable qubit entanglement, both for qubits represented as atom states with interaction mediated by photons as shown by [11], as well as for qubits represented by photons interacting through atoms inside a cavity. A single atom in a cavity is enough to produce an entangled state between photons, as shown experimentally by [12]. Recently, a setup by [13] realizes the NS gate with an upper bound error probability of approximately 2.47%. This work continues by generalizing it to explore how the inclusion of decoupling and dissipative effects change the potential reliability of the NS and C-Sign gates.

Description of the physical system
Consider an optical Fabry-Perot cavity (as shown in Figure 1) with a two-level Rydberg atom flying through it with speed v. The geometrical parameter w denotes the half-width of the beam waist at the center of the cavity and L denotes the distance between the mirrors. Let the low and high energy states of the atom be denoted by |g and |e respectively an the n photon state inside the cavity be |n . Suppose that the atoms inside the cavity are prepared initially in the |g state, and the system is built so no more than two photons can enter the cavity. The Hilbert space associated with the system is Span{|g, 0 , |g, 1 , |g, 2 , |e, 0 , |e, 1 }. The evolution of such system is described by the Jaynes Cummings Hamiltonian ( [15]): where a + i , a i are operators of creation and annihilation of photons; σ + , σ are operators of excitation and relaxation of the atom in the cavity, and γ is the coupling constant for interaction between the atom and the field ( is taken to be 1). This Hamiltonian leaves invariant subspaces of the form Λ n = Span{|g, n + 1 , |e, n } and the space Λ g = Span{|g, 0 }. By taking the detuning ∆ = ω c − ω a , H JC , limited on Λ n can be written as a 2 × 2 matrix The evolution of the system can be fully obtained by solving the eigenvalue problem for H JC , which gives the eigenvalues for the energy: where Ω n = ∆ 2 + 4γ 2 (n + 1) is the generalized Rabi frequency of the system. The associated eigenstates are the dressed states of the system where tan(θ n ) = (2 √ n + 1γ)/(Ω n − ∆). For the system ground state |g, 0 , the energy eigenvalue is given by Considering the system as a part of an array of components, in which the number of photons is fixed, we turn our attention to only the interaction and free atom part of the Hamiltonian. It is useful then, to consider the interaction picture associated with H 0 = (a + a + 1/2)ω c . In such picture, the evolution of the state according to (1) is Let the system be initially prepared in a state of the form ψ(0) = α 0 |g, 0 + α 1 |g, 1 + α 2 |g, 2 . Then, equation (6) shows that after a time t the system evolves to the state The dissipation inside the cavity can be handled using a master equation in the Lindblad form on the system's density matrix ρ The main source of decoherence inside an optical cavity is the photon leakage through the mirrors, the effect of which can be described by the photon annihilation operator acting on the electric field state L 1 = a and the photon escape rate constant

Mathematical model of C-Sign gate array
The C-Sign gate array, proposed in [13] is shown in Figure 2. The wires are denoted by x 1 , x 2 , y 1 , y 2 and each wire can contain 0, 1 or 2 photons of the fixed frequency ω c and circular polarization, with a single limitation: the number of photons that are present in the gate array simultaneously does not exceed 2. The number of photons in any wire we denote by the same letter. Decoherence comes from the non ideal work of photo detectors, for example, dark countings, photon leakage from the walls of the cavities and from the harmful entanglement between photons and atom, which can remain when the atom flies out of the cavity. In this work we ignore the errors of photo detectors and analyze only the photon leakage and harmful entanglement. We also assume that the linear optical elements work ideally, thus the single source of errors is connected with the work of optical cavities.
The logical states of our computations are the spatial photon states in the dual rail representation. The qubits are denoted by x and y in Figure 2 and the computational basis is defined as The atomic states play the role of ancilla, which is prepared in the state |g and in the ideal case must leave the gate array in the same state. Unfortunately, the ideal situation is unattainable in the given model even theoretically. We can only get an increasingly accurate approximation to it by choosing larger times of interaction between the field and the atom in an optical cavity. However, this increase of time will inevitably lead also to the increase in the probability of photon leakage out of the cavity. Our task is to find the optimal time for finding the atom in an optical cavity, depending on the intensity of photons leak.
The array consists in four wires, two idle ones x 2 , y 2 and two wires x 1 , y 1 which are acted upon by the optical components. The idle wires cannot be disregarded, as the photons inside of them contribute to the overall energy of the system. There are two linear gates: beam splitters BS1 and BS2, whose action in Fock space looks as and two optical cavities, which perform the nonlinear shifts: NS1, NS2. The nonlinear shift in the ideal case acts on Fock states of photons as This is realized by Jaynes-Cummins Hamiltonian (1). The gates work sequentially, from the left to the right, as shown in the Figure 2. We assume that the beam splitters work instantly, whereas the NS gates work simultaneously, and their work lasts for the time ∆t. Nonlinear shifts are realized by optical cavities with resonant frequency ω c , which is close to the frequency of atom transition from the excited to the ground state ω a with a small detuning ∆. The atom, initially prepared in the ground state, flies through the cavity along the path, and during the flight interacts with field inside the cavity via (7). We interrupt this interaction by the deflation of photons from the cavity in the moment t = τ that is chosen in advance; the choice of τ determines the accuracy of the gate array.
At this stage we meet the unavoidable decoherence factor, which comes from the residual entanglement between atom and field, mentioned above.
To choose τ we consider three arithmetic progressions A : t 0 0 , t 0 1 , . . . , t 0 s , . . . , B : t 1 0 , t 1 1 , . . . , t 1 n , . . . , where A, B and C consist of the sequential time moments, when the unitary evolution of JC transforms photonic states as |0 to |0 , |1 to |1 and |2 to −|2 respectively. If we choose the time τ , when these progressions approximately coincide, we will obtain the required duration. The evolution of Fock states is shown in (7). Eigenvalues of the Hamiltonian blocks (2) for n = 0, 1, 2 have the form Nonlinear dependence of amplitude from the photon number, called optical nonlinearity is a rare and exceptional phenomenon. A manifestation of this exclusivity is the fact that the match in progressions (13) is only approximate. We could consider the generalization of operator (12): |0 → e ia |0 , |1 → e ib |1 , |2 → e ic |2 , where a + c = 2b, and realize its particular case with only one separated optical cavity with flying atom by the choice of appropriate parameters ∆ and the time τ .
By inspection of equation (7), it is clear that e ib and e ic must be real numbers, which means that b, c ∈ {0, π} (modulo 2π). We note that for the zero detuning (∆ = 0) the impossibility of the exact coincidence between elements of the sequence B and C is evident, because √ 2 is not rational and thus the differences of these progressions are incommensurable. We can only choose the value of τ that is maximally close to the both progressions. The more accuracy we wish to obtain the larger τ will be. We are only interested in the accuracy of the scheme, not the time of its execution. The value τ can thus only affect the quality of the circuit via the second factor of decoherence -the leak of photons through the walls of cavities.
For the detuned case, the nonlinearity condition can be satisfied if we take such d = ∆/γ so that √ 4 + d 2 / √ 8 + d 2 is rational; that can be guaranteed if we find the rational solutions of the equation Y 2 − X 2 = 1, for which there is dense set of appropriate values for the parameter d. To achieve nonlinearity it is then sufficient that a = c (modulo 2π). That we can achieved by almost any arbitrary choice of parameters among these solutions. For the C-Sign case we need more, (12) is realized only when a = c + π (modulo 2π). The numerical computations with Mathematica shows that there is no solution of such a system. The best we can do is to find the approximate solution.
The evolution with the leak of photons gives us the mixed state even if the initial state was pure; we thus must use the density matrix ρ for the description of the evolution. We use master equation The evolution of the state in the work of our gate array thus can be described by the equation (9), where the Hamiltonian H and κ ph , κ at are piecewise constants; namely, H coincide with the Hamiltonian, corresponding to the action of linear elements (for the simplicity, we can apply the corresponding transformation (11) directly in the corresponding time) without dissipation, and in the time frame when the field interacts with the atoms we set H = H JC and take the actual value of the κ coefficients.
We use the distance δ(ρ 0 , ρ) = ρ 0 − ρ between the ideal density matrix ρ 0 and the real density matrix ρ at the end of computation as the criterion of the validity of the gate array. This value δ depends on the intensity κ of photon leak, and we can find this dependence for the different choice of τ 0 .

Numerical simulation of the density matrix dynamics
All gates, except for the main part of the N S gates, are considered being ideal (both beamsplitter gates and the phase shift inside the N S gates, if enabled). The N S gates simulation was performed in the assumption that both of them have identical time. The simulation operates with 6 particles (4 rails and 2 atoms): x 1 , x 2 , y 1 , y 2 , a1, a2. There are 19 total possible states in the system, because all the other states are unreachable when using a valid input. The simulation deals only with those 19 reachable states.

The Hamiltonian for the N S gate
The Hamiltonian has to take into an account all the particles in the system. x2 and y2 receive only the phase shift over time with an amplitude which is assumed to be equal to ω c . Detuning ∆ is equal to ω a − ω c .
The total Hamiltonian for the main part of the N S gate (excluding the phase shift) has the following form: Variable g could be excluded from the parameters list, if all the variables are taken relative to g. When doing so, the main parameters for the calculation are the following: w a /g, ∆/g (or ∆/w a ), t = T √ 2g/π (where T is the absolute N S gate duration). h is taken equal to 1.
Also one extra parameter is phs, that denotes enabling (phs = 1) or disabling (phs = 0) a phase shift gate at the end of both N S gates.
From here on, it is taken g = 0.1 (does not affect anything as all parameters are relative to g), wc = g * 5. 11 3.41 * 10 6 . Values for detuning ∆ that are used below are from 0 to 5g, which is five orders of magnitude lower than the cavity frequency.

Lindblad operators for photon leakage
We simulate the photon leakage from the cavities using the Lindblad master equation. With the inclusion of the Lindblad master equation in the diagonal form, the simulation equation takes the following form: Lindblad operators for the photon leakage inside the N S gates have the following form: In the following equations l y is the photon leakage coefficient. For the simulation, we take it relative to the photon-atom interaction strength g, so this adds one more parameter to our model: l y /g.

Calculating the error rate
Error rate error takes values from 0 to 1 and is equal to 1 minus the gate validity. The gate validity from here on is calculated as max(|eigenvalues(P expected −P result ))) where P test = 1 4 (|x 1 + |y 1 + |x 2 + |y 2 )( x 1 | + y 1 | + x 2 | + y 2 |) density matrix was used as the input. Also other random valid P rand density matrices with the total number of photons equal to 2 (gate restriction) were tested as input, and the result corresponded with the result for P test .

The case of zero detuning
In the case of zero detuning, the only viable parameter sets are those with whole values of t. That is explained in section 3, and could be also seen from the figure 3. The higher the N S gate duration is, the more precise match we can find, and the lower is the error rate, but as could be seen on figure 4, the faster does the error rate grow over increasing the photon leakage and/or the inaccurate detuning setting (which is the same as the detuning itself for the case when the desired detuning is equal to 0). There are no reasons for choosing higher durations over lower ones, if the gate validity does not improve, so we treat as "optimal" only those sets of parameters that lower the error rate compared to the best found parameters set with lower time values.

Error over detuning
Error over photon leakage (logarithmic scale on leakage) Figure 4: Error rates over detuning and photon leakage for the optimal cases.

The case of non-zero desired detuning
It was also shown that non-zero detuning levels could greatly improve the validity of the gate. On figure 5, it could be seen how does the error rate depend on the absolute detuning value. The graph is done only for low times for clarity, the picture is the same for higher times, but the range of detuning values that interests us grows with time and also becomes more fine-grained. It is visible that for values of t around 4, some non-zero detuning range actually lowers the overall error level. In the case of non-zero detuning, t is not required to be a whole number, and it is not whole for most of the optimal parameters set.
If parameter sets with non-zero detuning value is taken into consideration, it greatly widens our possible selection of the "optimal" parameter sets, and also improves the lowest reachable error rate for a given time range. This could be seen on figure 6. Also the same figure shows the overall dependency of the reachable error rate over our duration range.

Optimal cases without desired detuning
Optimal cases with desired detuning (logarithmic scale on both axes) (linear scale) Figure 6: Optimal time values and their error rates for the cases with and without the desired detuning. Figure 7 shows how does the error rate in the cases of zero detuning depend on the inaccurate detuning setting ∆ − ∆ opt and from the photon emission coefficient. It could be seen that the dependency is not stronger than the corresponding dependency on figure 4, so non-zero detuning does not introduce larger error values in cases of inaccurate detuning setting and/or non-zero photon leakage from the N S gates cavities. With t = 99, the lowest reachable error rate is ≈ 0.008 without detuning and ≈ 0.002 with ∆ ≈ 4.80 * g.

Error over detuning offset
Error over photon leakage (logarithmic scale on leakage) Figure 7: Error rates over detuning and photon leakage for the optimal cases with desired detuning.

Conclusions
We have conducted an estimation of the error rate of modified KLM model. Optimal time values were found for the zero detuning case, and it was shown how non-zero detuning could lower the error rate and broaden our choice for the time values.
Error introduced by the photon leakage from the cavity at the N S gates was simulated, and it was shown how the photon emission rate affects the optimal time value.
Error introduced by inaccurate detuning setting was simulated, it was shown that it depends mostly on the chosen time.
Optimal (time, detuning) pairs were found for the cases of non-zero detuning, and it was shown that those are more efficient (introduce a lower error for the same or lower duration) compared to the cases when the detuning is equal to zero.
It was also shown that the error introduced by photon leakage from the cavities and by the inaccurate detuning setting imprecision does not increase in the nonzero optimal detuning case when compared to zero detuning case. Thus, to get the optimal gate validity for the known photon escape rate and detuning setting imprecision, one could first calculate the maximum N S gate duration after which the error introduced by them raises to an unacceptable level, and then find the optimal values for t and ∆ g where t is slightly less than that critical value.
The choice of the duration τ 0 can be made by exact fixation of the moment t 0 when atom entries the cavity; for the speed of atoms about 1cm. per sec. taken from a reservoir of cold gas such fixation can be performed with high precision.
Graphs at the figures 6, 7 shows that the lowest relative error level accessible by the considered model of C-Sign is about 0.01; for the increasing noise it rapidly increases. If we roughly estimate for what number of qubits Grover search algorithm ( [2]) can be realized on this model, taking into account the linear growth of error in course of quantum computation and take the error on one Grover operator equal to C-Sign error we found, we obtain the number n ≈ 13. This estimation, coming for the account of different sources of decoherence is more pessimistic than the more abstract estimations (see, for example, [14]) that gives the values n ≈ 20. To reach such values in the realistic models, like KLM, we need the following additional modernization of this scheme.

Acknowledgements
The work was partially supported by Russian Foundation for Basic Researches, grant 15-01-06132 a.