<<

Realistic simulation of computation using unitary and measurement channels

Ahmed Abid Moueddene∗ QuTech, Delft University of Technology Delft, The Netherlands and Quantum Computer Engineering Dept, Delft University of Technology Delft, The Netherlands.

Nader Khammassi† Intel Labs, Intel Corporation, Hillsboro, Oregon, USA

Koen Bertels‡ Quantum Computer Engineering Dept, Delft University of Technology Delft, The Netherlands.

Carmen G. Almudever§ QuTech, Delft University of Technology Delft, The Netherlands and Quantum Computer Engineering dept, Delft University of Technology Delft, The Netherlands. (Dated: May 14, 2020) The implementation and practicality of quantum algorithms highly hinge on the quality of opera- tions within a quantum processor. Therefore, including realistic error models in simulation platforms is crucial for testing these algorithms. Existing classical simulation techniques of processing devices exhibit a trade-off between scalability (number of that can be simulated) and accuracy (how close the simulation is to the target error model). In this paper, we introduce a new simulation approach that relies on approximating the evolution by a stochastic sum of unitary and measurement channels within a pure state simulation environment. This model shows an improvement of at least one order of magnitude in terms of accu- racy compared to the best known stochastic approaches while allowing to simulate a larger number of qubits compared to the exact density matrix simulation. Furthermore, we used this approach to realistically simulate the Grover’s algorithm and the surface code 17 using gate set tomography characterization of quantum operations as a noise model.

I. INTRODUCTION of qubits motivated the development of quantum com- puting simulation environments that incorporate realistic Quantum computing relies on exploiting quantum phe- noise models based on characteristics of real devices. nomena such as superposition and entanglement to solve When including realistic error models in quantum com- some complex computational tasks that are intractable puting simulation platforms, there is a trade-off between for classical computers. To this purpose, quantum algo- accuracy, the closeness of the simulation to the real physi- rithms are implemented on systems of qubits in which a cal noise model, and scalability, the largeness of the quan- universal set of quantum operations is available. How- tum system that can be simulated. As a matter of fact, ever, due to the unavoidable coupling with the environ- the exact simulation of density matrices using the super- ment and imperfect control, both qubits and operations representation has a major drawback of scala- are inherently noisy. Consequently, we are now entering bility in terms of the number of qubits possible to sim- the Noisy Intermediate Scale Quantum (NISQ) era, in ulate [5, 6]. Alternatively, there exist many stochastic which Quantum Processing Units (QPUs) consisting of approaches that approximate error channels by inject- a few tens of noisy qubits [1] are being demonstrated. ing errors from a cheaper to implement set of quantum Recently, was achieved[2], that is, arXiv:2005.06337v1 [quant-ph] 13 May 2020 channels, and therefore allowing the simulation of a larger solving problems that no classical counterpart can solve. number of qubits. These approaches include the depolar- Before having such a large chips widely available, there is izing channel[7], the Pauli channel[8], the Pauli Twirling a need for quantum platforms where to test the function- Approximation (PTA)[9–11], the Pauli Measurement ality of quantum algorithms and their robustness against Channel (PMC), and the Clifford Measurement Chan- noise. In order to respond to this need, a small num- nel (CMC) approximation[12]. Some of these approxima- ber of QPUs are available in the cloud [3, 4]. However, tions were endowed by honesty constraints[13, 14]. These their limited accessibility and still relatively low number approaches have limited accuracy when used to simulate reasonably large circuits, which we refer to as the chan- nel composition problem[15]. In order to overcome this ∗ [email protected] lack of accuracy, a quasistochastic version of the CMC † [email protected] was proposed[15], where negative of inject- ‡ [email protected] ing errors were allowed. However, the stochastic noise § [email protected] models that can be incorporated in pure state simulation 2 platforms are still poorly investigated. arbitrary quantum gate support in stabilizer-based sim- To have a more scalable simulation approach compared ulators limits the number of algorithms that can be ex- to the exact density matrix simulation while limiting the ecuted and the accuracy of implementable error models loss in terms of accuracy, we propose a new simulation that is often reduced to simple Pauli errors. technique. It is based on the stochastic approximation Universal quantum computer simulators include arbi- of quantum channels by i) unitary channels and ii) mea- trary quantum gates and operate on a pure quantum surements in arbitrary basis followed by conditional uni- state |ψi modeled by a state vector in the tary gates depending on the measurement outcome. As H with unit norm. Each quantum gate is implemented a noise model, we use the Gate Set Tomography (GST) as a unitary operator U : H → H, mapping a state characterization of real devices. Our simulation includes to another one with UU † = 1. In addition, measur- single- gates, two-qubit gates, and State Prepara- ing a corresponds to a projection on a tion And Measurement (SPAM) operations [16, 17]. The well-defined axis. Examples of such universal simulators main contributions of this work are the following: are the QX simulator [19], qHipster[21], ProjectQ[22], QuEST[6], and CGPU[23]. They allow simulating arbi- • To improve the accuracy of the stochastic ap- trary quantum circuits but on a limited number of qubits proaches, we approximate gate channels by con- compared to stabilizer-based simulators. Since universal vex sums of Unitary and Measurement Channels quantum computer simulators can implement arbitrary (UMC). qubit rotations, they also offer the opportunity to in- clude more accurate error models that are not anymore • We introduce a stochastic approximation to realis- limited to basic Pauli errors. Therefore, they provide a tically simulate SPAM operators. better accuracy-scalability trade-off than much heavier simulation techniques such as the full density matrix ap- • We propose to adjust the fidelity of the operations proach. The later operates on mixed quantum states and by linearly tuning the Lindbladian of errors. has significantly higher memory and computing power re- quirements that limits the simulation to a relatively small • The UMC approximation is integrated in the QX number of qubits. simulator, a pure state simulation platform. When simulating an error-free QPU, operators describ- ing state preparation, quantum gates and measurements • As a proof of concept, we simulate the 2-qubit are well known, since when they are assumed perfect, Grover’s algorithm and the surface code 17 under each operation corresponds by default to the desired one. various mean fidelities. However, it is known that isolating quantum systems from the environment is a major challenge for building a This paper is structured as follows. In Section II, an scalable QPU. This coupling with the environment makes overview of QPUs characterization protocols and simula- qubits in any to be in mixed states. tion techniques is presented. In Section III, we introduce Accordingly, the output of a state preparation is a mixed our simulation technique. In Section IV we describe the state composed of the target state with a portion of other integration of error models in QX. Finally, our results and unwanted states and therefore, it can be described by its conclusion are shown in Sections V and VI, respectively. corresponding density matrix in a given QPU. Density matrices can be estimated using Quantum State Tomog- raphy (QST)[24, 25], in which a number of copies of a II. QUANTUM DEVICES given state are measured in a tomographically complete CHARACTERIZATION AND SIMULATION: AN basis to approximate its corresponding density matrix. OVERVIEW Furthermore, by representing quantum states as den- sity matrices, noisy quantum gates should be regarded as A QPU can be modeled as a quantum system de- quantum channels, which are completely positive trace fined by its quantum state, a set of quantum gates and preserving (CPTP) maps that map valid quantum states quantum measurements. Several approaches have been (unit trace hermitian) to other valid quantum states. adopted to implement simulators for such systems with Quantum channels are commonly described by their different trade-offs in terms of accuracy, simulation ef- Krauss representation, and according to the Stinespring ficiency (including required computing power and mem- dilation theorem[26], they come from the joint unitary ory requirements), and scalability to large qubit systems. evolution of qubits with their environment. This interac- Stabilizer-based simulations can be performed very effi- tion with the environment together with imperfect con- ciently on classical computers due to low memory and trol introduce errors during the implementation of quan- computing power requirements. However, this comes at tum gates. In order to acquire some knowledge about the cost of restricting the supported quantum gates to the operational errors [7], Standard Quantum Process To- Clifford group and not supporting arbitrary qubit rota- mography (SQPT) [27] was proposed[28]. It is based tions. Examples of such simulators are CHP [18] and one on estimating a quantum process by implementing the of the backends of QX [19] and LIQUi|i [20].The lack of QST protocol on quantum states that are usually gen- 3 erated by applying the target process on a tomographi- by injecting CMC channels according to the n Pn cally complete set of states. A more inclusive approach vector {pi}i=1 that minimizes || i=1piΛi − E||, where called the Linear Gate Set Tomography (LGST) was in- Λi’s are CMC channels and E is the target realistic error troduced to characterize gate errors together with SPAM channel. Furthermore, these channels were endowed with errors[16, 29]. In this work, we simulate QPUs given their honesty constraints so the CMC channel does not under- Extended Gate Set Tomography (EGST) characterisa- estimate the effect of noise. But it turns out that this ap- tion. EGST is performed by sampling large sets of quan- proximation has a drawback of channel composition[32], tum circuits built as sequences taken from a target gate and the restriction on Clifford operations imposed by the set. These sequences ensure 1) initializations and mea- use of the stabilizer formalism prevents the simulation of surements in an informationally overcomplete set of ini- universal quantum computation. tializations and measurements, and 2) the amplification In summary, some of the simulation approaches such as of errors as the length of circuits increases. The target using density matrices are precise but not very scalable gate set is constructed via Maximum Likelihood Estima- in terms of the number of qubits that can be simulated. tion (MLE), that is, estimating the set of operations that Others, such as the CMC approximation, allow simulat- will most likely provide the measured frequencies. The ing a large number of qubits but with less accuracy. In EGST protocol certainly owes its accuracy to the use of order to overcome all these limitations and have a noise a large number of sequences and the separation of SPAM model that is more accurate than the CMC approxima- errors from gates errors [16, 17]. In short, the EGST pro- tion while being more scalable than the exact density tocol takes as input the measurements observed via the matrix simulation approach, we propose a new stochastic implementation of a predefined set of circuits run on the approach based on extending the CMC to include more target QPU and as output it provides the following: general forms of channels Λi. It has the advantage of i) Prepared states described as density matrices. using a universal pure states simulation back-end where ii) Quantum gates described as quantum channels. the states are stored in 2n complex vectors, and hence, iii) Quantum measurements described as measurement it requires the square root of memory compared to the operators that act on density matrices. exact density matrix simulation. Furthermore, we will show that it provides higher accuracy than the existing Based on such description, noisy quantum computa- stochastic approaches since it uses more varied elements tion can be simulated accurately as quantum channels to approximate the targeted noisy operations. and measurements acting on density matrices. To this end, it is optimal to use the superoperator representa- tion of quantum channels [5]. However, since the density matrix is stored on a 22×n vectors, n being the number of III. UMC APPROXIMATION OF QUANTUM qubits, this approach has a major drawback of scalabil- OPERATIONS ity due to the amount memory required. Therefore, the depolarizing channel is commonly used as a noise model. After running the EGST protocol on the target QPU, This model introduces Pauli errors with homogeneous this work, as illustrated by the dashed box in Figure 1, probability to each qubit at each step of the circuit. If aims at introducing a method to make a pure state sim- the circuit is restricted to only include Clifford gates, this ulation platform, the QX simulator, mimic the behavior kind of computations can be efficiently simulated using of a QPU given its EGST characterization. In order to the stabilizer formalism which is highly scalable[30]. Er- define the specifications of the noisy operations that are ror rates in this noise model are related to the randomized implementable in QX, this section explains how to ap- benchmarking protocol which in most cases gives a weak proximate quantum operations using UMC channels. We interpretation of errors faced in reality[31]. To provide also introduce methods to simulate more reliable opera- a more realistic approximation of errors, the Pauli Twirl tions by linearly tuning the Lindbladian of errors. Approximation was introduced [9–11]. PTA consists in simulating the erroneous parts of each operation by Pauli gates with probabilities equal to the diagonal elements of the process matrix of the error channel. That is equiva- A. UMC approximation of quantum channels lent to replace the error channel with another whose pro- cess matrix has only diagonal elements. Being oblivious We address the problem of the approximation of a to non-diagonal elements, PTA was updated to include noisy operation channel E by a convex sum of pure state the set of all possible operations that can be implemented operations. That is, unitary channels and measurement using the stabilizer formalism, which is Clifford gates channels corresponding to measurements followed by uni- and Measurement followed by conditional gates Chan- tary gates conditioned on the measurement outcome. In nels (CMC) [12–14]. It takes advantage of the convex- the absence of an algebraic decomposition, this is equiv- ity propriety; that is, given a set of n quantum chan- alent to solving the following constrained optimization n n problem: nels {Λi}i=1, and an n-entry probability vector {pi}i=1 n n n such that Σi=0pi = 1, the convex sum Σi=0Λipi is also Given the form of a finite set of channels {Λi}i=1 and a . The CMC approximation is done the channel E. Minimize: 4

Running EGST circuits on target vector, θ is a 4-by-3 angle matrix, and β is a 2-by-9 an- QPU gle matrix. The entries of p, θ, and β are the freedom degrees of our optimization problem. Observed frequencies/measurements For two-qubit channels, we use the following decompo- sition:

MLE-EGST n X X5 Density matrices, quantum channels, and Tuning the of operations piΛi = piU(θi,1, ..., θi,15) measurement operators (original QPU) i=1 i=1 + p M(θ , .., θ ) ⊗ I Density matrices, quantum channels, and 6 6,1 6,9 UMC approximation measurement operators (tuned QPU) + p7I ⊗ M(θ7,1, .., θ7,9) + p M(θ , ..θ ) ⊗ M(θ , ..θ ) (4) Approximate operations specifications: 8 8,1 8,9 9,1 9,9 probabilit y- vectors and angles This decomposition includes five unitary channels, two uncorrelated measurement channels and a pair of corre- Integration -in QX lated measurement channels.

Realistic simulation of quantum circuits on target QPU B. SPAM errors simulation

Furthermore, SPAM errors are characterized by vector- Figure 1. The process diagram of our simulation approach. ized operators corresponding to a prepared state ||ρ0ii and a measurement generator hhE||. However, in most of the quantum computing simulation platforms, qubits are usually initialized in the ||ρperfectii = √ √ t n X ||1/ 2, 0, 0, 1/ √2ii , and measured√ in the Pauli Z ba- f(p, θ, β) = || piΛi(p, θ, β) − E|| (1) sis hhE|| = hh1/ 2, 0, 0, −1/ 2||. Therefore, we use the i=1 channel Λprep that maps a pure ground state ||ρperfectii to the noisy prepared state ||ρ ii, and a channel Λ With the following linear constraints: 0 meas that maps states to be measured via the faulty measure- ment hhE|| to states having same expectation values un- n X der a perfect measurement hhE0||. Hence: pi = 1, pi ≥ 0 and 0 ≤ θj < 2π ∀i, j. (2) i=1 ||ρ0ii = Λprep ||ρperfectii (5) Where the metric ||..|| refers to the diamond  hhE0|| = hhEperfect|| Λmeas (6) distance[33], p is a probability vector[34], E is the tar- get channel and Λi’s are unitary and measurement chan- We obtain Λprep and Λmeas by maximizing the follow- nels. θ and β are matrices containing the angles that ing function: specify unitary U and M measurement channels, respec- f (p, θ, β) = fidelity(Λ (ρ ) , ρ ) (7) tively. For the single qubit case, we found optimal to use prep prep perfect 0 a convex sum of four unitary channels and two measure- fmeas(p, θ, β)) = fidelity(EΛprep() ,E0) (8) ment channels. Therefore, our approximate channel is Where (p, θ, β) are the parameters of Λprep and Λmeas as specified by pi’s, θi’s, and βi’s as following: a UMC convex sum and EΛ() stands for measuring the operator E after the application of a channel Λ. Note n that the notion of fidelity holds also for the measure- X X4 ment operators. For this approximation, we achieved a piΛi = piU(θi,1, θi,2, θi,3) i=1 i=1 100% fidelity in both fprep and fmeas using the SQP al- 2 gorithm from the Matlab optimization toolbox. Solving X these optimization problems is faster and more precise + pi+4M(βi,1, .., βi,9) (3) i=1 compared to the UMC decomposition of quantum maps, as it has to satisfy a smaller system of equations. For Explicitly, M(βi,1, .., βi,9) are specified by the two instance, fprep can be solved by maximizing the fidelity ¯ Krauss operators |f1i hf| and |f2i hf|, corresponding to between the upper left block of the Choi-Jamiolkowski |f1i = U(βi,1, βi,2, βi,3) |0i, |f2i = U(βi,4, βi,5, βi,6) |0i, representation [35] of Λprep and ρ0. Therefore, a sys- and hf| = h0| U(βi,7, βi,8, βi,9). As we include four uni- tem of three equations should be satisfied which makes it tary channels and two measurement channels in the single simpler than UMC decomposition single-qubit channels, qubit channel decomposition, p is a 6-entry probability where a system of twelve equations should be satisfied. 5

C. Tunning the fidelity of operations

Having SPAM channels together with single and two- qubit gate channels allows to realistically simulate noisy quantum computations. These noisy operations have fixed fidelities often lower than the threshold of many QEC codes. Thus, in order to be able to evaluate a given QEC code or under different fidelities, we use the Lindbladian representation of error generator L G˜ = Gtargete , where Gtarget is a perfect channel (no errors) and L is the Lindbladian of errors. The entries of the Lindbladian get close to zero when the channel is closer to the perfect one, and they get larger absolute val- Figure 2. QX simulator architecture and error model integra- tion. ues when the channel is noisier. Moreover, by tuning the Lindbladian of single qubit channels and computing the resulting channel’s fidelity, we observed that if a given ˜ ¯ ˜0 L×n channel G has infidelity f , the gate G = Gtargete troduced in QX as a new error model that injects the has an infidelity f¯0 = n × f¯. By varying the parameter errors from weighted combinations of the 24 single-qubit n, gates with different infidelities can be simulated . Clifford gates and the 6 Pauli resets. The probabili- As illustrated in the upper part of the dashed box ties of the different errors for a given quantum opera- in Figure 1, by using the approximations introduced in tion are computed from its GST characterization and this section and taking density matrices, quantum chan- expressed as a 30-entry probability vector where each nels and measurement operators characterizing the target entry is corresponding to a specific error type. A per- QPU as inputs, we can provide probabilities and angles fect circuit expressed in QX using the C++ API or the that specify pure state operations. These probabilities cQASM representation [36] is transformed into a noisy and angles are fed to the QX simulator as will be de- circuit through injecting errors based on that error prob- scribed in the next section. ability vectors. The measurement expectation values are obtained by sampling noisy circuits. Similarly, the UMC approximation has been imple- IV. ERROR MODEL INTEGRATION IN QX mented using the same interface to maintain the same plug-and-play error model interface and allow us to com- The QX simulator, as shown in Figure 2, provides an pare different error models using the same target quan- abstract interface for implementing various error models tum circuit. The UMC stores its parameters as a vec- and using them for injecting noise in arbitrary quantum tor of error probabilities with their respective operators. circuits. The error model interface exposes an abstract Those operators are modeled as a set of arbitrary uni- noise injection function that can be implemented and tary gates and measurements in arbitrary basis followed customized for each new error model, allowing the ex- by gates conditioned on the measurement outcome. Each tension and the integration of new error models in QX. of these operations is defined by a set of angles. These Previously, several error models such as the Depolariz- angles and the probabilities of injections are obtained via ing Channel or the Pauli Twirling Approximation have the optimization algorithm described in Section III. The been implemented. Those implementations use the user- UMC model is used to replace perfect gates by noisy ones provided Pauli errors parameters to inject noise in a per- when sampling a quantum circuit. fect quantum circuit loaded in the QX simulator based on the specified error probabilities. The simulation of the circuit can be executed efficiently compared to density matrix simulations due to lower re- quirements in terms of memory and computing power. V. RESULTS However, if the circuit is composed by stochastic sums of pure state operations, a pure state simulation plat- form provides, up to sampling errors, the same results In order to evaluate our UMC error model, we first as the density matrix simulation. In other words, the compare it to the CMC error model. Then, we use it measurement expectation values of the resulting density to simulate the two-qubit Grover’s algorithm using our matrix can be reconstructed through the sampling of a model and the full density matrix simulation. In ad- large number of pure state simulation runs. The circuit dition, to demonstrate the scalability potential of our of each run is constructed by picking from each opera- approach, we simulate the 17 qubits distance 3 surface tion’s convex sum, a pure state operation according to code using operations with tuned fidelities and infer the its corresponding probability. fidelity value beyond which the use of this code is bene- As a first step, the CMC approximation has been in- ficial. 6

A. UMC vs. CMC Table I shows the success rate of the algorithm using the mentioned approaches. In this case, the algorithm’s suc- In order to compare our UMC approach with the CMC cess rate provided by our approach has an inaccuracy −3 approximation, we have approximated the GST-derived in the order of 10 compared to exact density matrix simulation. channels of 5 single-qubit gates corresponding to Rx(90), Rx(180), Ry(90), Ry(180), and the idling gate. In Figure 3, the diamond norm between the target and approxi- |0i Ry(90) Ry(90) Ry(90) mate channels using the UMC and CMC approaches are O cU00 shown. In overall, our UMC allows a 2.73% diamond |0i Ry(90) Ry(90) Ry(90) distance closer approximation which means 36.6 times higher accuracy. Furthermore, we have achieved a dia- mond norm of 0.0225 between the UMC approximate and Figure 4. Circuit of the two-qubit Grover’s algorithm. The the target noisy Cphase gate. Note that our approach operator O is the oracle operator and it inverses the ampli- uses a smaller number of parameters to approximate two- tude of the target state. cU00 is the inversion operator of the amplitude of the |00i component. qubit gates compared to CMC which is generally imprac- tical for two-qubit channels due to the largeness of the search space (number of two-qubits Cliffords). In addi- Noise model f f f f tion, the achieved infidelities between the target and the 00 01 10 11 Exact 0.7365 0.7490 0.7474 0.7661 approximate SPAM operators are of the order of 10−11. UMC 0.7411 0.7473 0.7442 0.7652

CMC Table I. Success rate of the Grover’s algorithm using the ex- UMC 10 -2 act density matrix simulation and the stochastic approximate channels UMC.

In our simulations, the Oracle operator O and the in- version operator cU00 are implemented by a Cphase gate and when needed, also single-qubit Rx(180) ∗ Ry(180) are applied. For instance, the cU00 can be implemented 10 -3 as Rx(180)R˙ y(180) acting on both qubits followed by a Cphase gate. Note that, although the diamond norm of the UMC approximation of the CPhase gate, which is the main source of mismatch, is about 10−2 (0.0225), the

Diamond norm of the approximation gap between the fidelities of the Grover’s algorithm using the two simulation approaches is in the order of 10−3. 10 -4 Id X180 X90 Y180 Y90 Gate C. The pseudo-threshold of the surface code 17 Figure 3. The diamond norm for single-qubit gates using the CMC approximation (blue bars) and the UMC approximation The fidelity of single-qubit gates in the original gate set (red bars). we are using is 0.9996, which as we will show, is around the threshold of the surface code. However, the fideli- These results were obtained using the SQP algorithm ties of the controlled-phase (C-Phase) gate (0.9266), sate from the Matlab optimization toolbox. To compute preparation (0.9296) and measurement (0.9603) are far the diamond norm we used QETLAB[37] and the CVX below the threshold for this code. Therefore, we target package[38, 39]. gates that have higher fidelities by linearly decreasing the Lindbladian of errors as explained in Section II. The dia- mond norm of the approximation improves as the fidelity B. UMC vs. a full density matrix simulation of the of the target gate increases. Figure 5 shows the varia- two-qubit Grover’s algorithm tion of the diamond norm of our approximation for single and two-qubit channels. It can be seen that for fidelities To test the accuracy of our model, we have simulated between 0.9992 and 0.9999, the diamond norm of the the two-qubit Grover’s algorithm using the UMC approx- approximation of single-qubit gates and the controlled- imation and the exact density matrix simulation. As phase gate goes from 1.15×10−4 to 1.44×10−5 and from shown in Figure 4, the two-qubit Grover’s algorithm is 2.08 × 10−3 to 2.96 × 10−4, respectively. a special case since its corresponding circuit lies in the Using these approximations, we implemented the tiled two-qubit Clifford group and its theoretical success prob- version of the surface code 17 [11] with various fideli- ability is 100% (deterministic solution). Therefore, a fail- ties. As shown in Figure 6, the implementation is done ure of the algorithm is purely due to operational errors. using single-qubit Ry(±90) rotations and C-Phase gate 7

-3 1 10 -4 10 1.5 3 surface code 17 y=x Cphase 0.9998 av 1qubit

0.9996

1 2 0.9994

0.9992

0.999

0.5 1 QEC cycle succes rate succes cycle QEC 0.9988

0.9986 Diamond norm of the UMC approximation UMC the of norm Diamond Diamond norm of the UMC approximation UMC the of norm Diamond 0.9984 0 0 0.9992 0.9993 0.9994 0.9995 0.9996 0.9997 0.9998 0.9999 1 0.9992 0.9993 0.9994 0.9995 0.9996 0.9997 0.9998 0.9999 1 Fidelity of physical operations Fidelity of the target Figure 7. The logical error rate of the surface code 17 vs. the Figure 5. The fidelity of the target gate versus the UMC average fidelity of physical operations. approximation achieved distance of (red line) the controlled- phase gate and (blue line) single-qubit operations (average over the used single-qubit channels). VI. CONCLUSION as a two-qubit entangling gate that are supported by This work bridges the gap between the stochastic chan- superconducnting qubits [40]. We used the nel approximations using the stabilizer formalism and the minimum-weight perfect matching decoder[41]. For the exact density matrix simulation. It tackles the channel sake of optimality, we did not include idling errors to composition problem in the former approach by approx- have a lower threshold which requires less sampling for imating the density matrix evolution by stochastic sum higher accuracy. Figure 7 shows the logical error rate of unitary and measurement channels within a pure state obtained for various mean fidelities of the physical oper- simulation environment. This error model considerably ations. It can be observed that when using our proposed reduces the diamond norm between the target and ap- noise model, the pseudo-threshold for the surface code 17 proximate channels. For instance, our UMC approxima- resides within operations having mean fidelities around tion of single-qubit gate channels derived via the GST −4 0.9997 (crossing point dashed red and blue lines). protocol resulted in a diamond distance of ∼ 10 com- pared to ∼ 10−3 provided by the best known stochastic approaches. We also introduced an accurate simulation of SPAM operators with an infidelity of ∼ 10−11. Furthermore, to test the accuracy of our UMC model we simulated the Grover’s algorithm using our approach and compared it with the exact density matrix simu- lation. We have shown that our approach provides an inaccuracy of 10−3. We have also shown that by lin- early increasing/decreasing the Lindbladian of errors we a) can tune the fidelity of the quantum operations and the higher the fidelities are, the more accurate our approxi- mation is. Therefore, we were able to simulate the surface code 17 using the QX simulator under various operation fidelities. This allowed us to estimate that this code would be effective if gate fidelities b) c) are beyond 0.9997. The surface code simulations were performed on a cluster node with 2 × Xeon E5-2683 v3 Figure 6. a) Surface code 17 . Black dots correspond CPU’s (@ 2.00GHz = 28 cores / 56 threads) and 24 x to data qubits, white (black) plackets are ancila qubits used 16GB DDR4 = 384GB memory. As the qubit register to measure Z (X) syndromes. b) Parity-check circuit for mea- size is only 17, we could perform over 50 simulations si- suring X syndromes. C) Parity-check circuit for measuring multaneously. Furthermore, using more nodes of our dis- the Z syndromes. Note that - and + correspond respectively tributed system can increase significantly our sampling to Ry(−90) and Ry(90). speed and therefore speedup the overall simulation time. Although the distance 3 surface code is used as a use case 8 to illustrate quantum circuit simulation using the UMC spacial ”crosstalk” and temporal correlations. Therefore, error model, larger circuits on larger qubit registers can including such noise models will be a step towards realism be simulated: each node of our simulation platform al- in the simulation of quantum computation. lows the simulation of up to 34 fully entangled qubits in QX and therefore enable the simulation of a consider- ably larger number of qubits compared to exact density VII. ACKNOWLEDGEMENTS matrix simulations. This work was done under the as- sumption of static noise in the absence of leakage errors, The authors would like to acknowledge funding from Intel Corporation.

[1] J. Preskill, Quantum Computing in the NISQ era and below a rigorous fault tolerance threshold with beyond, Quantum 2, 79 (2018). gate set tomography, nature communications 8, [2] F. e. a. Arute, Quantum supremacy using a pro- https://doi.org/10.1038/ncomms14485 (2017). grammable superconducting processor, Nature 574, 505 [18] S. Aaronson and D. Gottesman, Improved simulation of (2019). stabilizer circuits, Phys. Rev. A 70, 052328 (2004). [3] Ibm, the quantum experience. [19] N. Khammassi, I. Ashraf, X. Fu, C. G. Almudever, and [4] Rigetti, quantum cloud services. K. Bertels, Qx: A high-performance quantum computer [5] T. E. OBrien, B. Tarasinski, and L. DiCarlo, Density- simulation platform, in Design, Automation Test in Eu- matrix simulation of small surface codes under cur- rope Conference Exhibition (DATE), 2017 (2017) pp. rent and projected experimental noise, nature,npj Quan- 464–469. tum Information 3, https://doi.org/10.1038/s41534-017- [20] D. Wecker and K. M. Svore, Liqui—¿: A software design 0039-x (2017). architecture and domain-specific language for quantum [6] T. Jones, A. Brown, I. Bush, and S. C. Benjamin, Quest computing (2014), arXiv:1402.4467. and high performance simulation of quantum computers, [21] M. Smelyanskiy and N. P. D. S. A. Aspuru-Guzik, qhip- Scientific Reports 9, 10.1038/s41598-019-47174-9 (2019). ster: The quantum high performance software testing [7] M. A. Nielsen and I. L. Chuang, Quantum Computation environment, . and Quantum Information (Cambridge University Press, [22] D. S. Steiger, T. H¨aner,and M. Troyer, ProjectQ: an Massachusetts Institute of Technology, 2010). open source software framework for quantum computing, [8] M. F. Sacchi and T. Sacchi, Convex approximations of Quantum 2, 49 (2018). quantum channels, Phys. Rev. A 96, 032311 (2017). [23] A. Kelly, Simulating quantum computers using opencl, [9] M. R. Geller and Z. Zhou, Efficient error models for fault- . tolerant architectures and the pauli twirling approxima- [24] D. Leibfried, D. M. Meekhof, B. E. King, C. Monroe, tion, Phys. Rev. A 88, 012314 (2013). W. M. Itano, and D. J. Wineland, Experimental deter- [10] A. Katabarwa and M. R. Geller, Logical error rate in the mination of the motional quantum state of a trapped pauli twirling approximation, Nature,Scientific Reports atom, Phys. Rev. Lett. 77, 4281 (1996). 5, https://doi.org/10.1038/srep14670 (2015). [25] M. Paris and J. ehek, Quantum State Estimation [11] Y. Tomita and K. M. Svore, Low-distance surface codes (Springer, Berlin, Heidelberg, 2004). under realistic , Phys. Rev. A 90, 062320 [26] W. F. Stinespring, Positive functions on c¡sup¿*¡/sup¿- (2014). algebras, Proceedings of the American Mathematical So- [12] M. Guti´errez,C. Smith, L. Lulushi, S. Janardan, and ciety 6, 211 (1955). K. R. Brown, Errors and pseudothresholds for incoherent [27] L. Artiles, R. D. Gill, and M. Guta, An invitation to and coherent noise, Phys. Rev. A 94, 042338 (2016). quantum tomography, Journal of the Royal Statistical [13] D. Puzzuoli, C. Granade, H. Haas, B. Criger, E. Mage- Society Series B 67, 109 (2005). san, and D. G. Cory, Tractable simulation of error correc- [28] I. L. Chuang and M. A. Nielsen, Prescription for ex- tion with honest approximations to realistic fault models, perimental determination of the dynamics of a quantum Phys. Rev. A 89, 022306 (2014). black box, Journal of Modern Optics 44, 2455 (1997). [14] E. Magesan, D. Puzzuoli, C. E. Granade, and D. G. Cory, [29] D. Greenbaum, Introduction to quantum gate set tomog- Modeling quantum noise for efficient testing of fault- raphy, 67 (2015). tolerant circuits, Phys. Rev. A 87, 012324 (2013). [30] D. Gottesman, The heisenberg representation of quan- [15] R. S. Bennink, E. M. Ferragut, T. S. Humble, J. A. Laska, tum computers, . J. J. Nutaro, M. G. Pleszkoch, and R. C. Pooser, Unbi- [31] C. Dankert, R. Cleve, J. Emerson, and E. Livine, Exact ased simulation of near-clifford quantum circuits, Phys. and approximate unitary 2-designs and their application Rev. A 95, 062337 (2017). to fidelity estimation, Phys. Rev. A 80, 012304 (2009). [16] R. Blume-Kohout, J. K. Gamble, E. Nielsen, J. Mizrahi, [32] The channel composition problem means that a given J. D. Sterk, and P. Maunz, Robust, self-consistent, approximation is accurate for a single channel, but closed-form tomography of quantum gates on a when simulating large circuits using multiple approxi- trapped ion qubit (2013), arXiv:1310.4492. mate channels the errors accumulate in a way that the [17] R. Blume-Kohout, J. K. Gamble, E. Nielsen, accuracy is substantially decreased. K. Rudinger, J. Mizrahi, K. Fortier, and [33] D. Aharonov, A. Kitaev, and N. Nisan, Quantum circuits P. Maunz, Demonstration of qubit operations with mixed states (1998), arXiv:quant-ph/9806029. 9

[34] p is a vector where each entry pi corresponds to the [39] M. Grant and S. Boyd, Graph implementations for nons- probability of the channel Λi being applied. Therefore, mooth convex programs, in Recent Advances in Learning Pn it should satisfy i=1 pi = 1 and pi ≥ 0. and Control, Lecture Notes in Control and Information [35] M.-D. Choi, Completely positive linear maps on complex Sciences, edited by V. Blondel, S. Boyd, and H. Kimura matrices, Linear Algebra and its Applications 10, 285 (Springer-Verlag Limited, 2008) pp. 95–110. (1975). [40] L. DiCarlo, J. M. Chow, J. M. Gambetta, L. S. Bishop, [36] N. Khammassi, G. G. Guerreschi, I. Ashraf, J. W. B. R. Johnson, D. I. Schuster, J. Majer, A. Blais, L. Frun- Hogaboam, C. G. Almudever, and K. Bertels, cqasm v1.0: zio, S. M. Girvin, and R. J. Schoelkopf, Demonstration Towards a common quantum assembly language (2018), of two-qubit algorithms with a superconducting quantum arXiv:1805.09607 [quant-ph]. processor, Nature 460, 240 (2009). [37] N. Johnston, Qetlab a matlab toolbox for quantum en- [41] A. G. Fowler, Minimum weight perfect matching of fault- tanglement, version 0.9 (2016). tolerant topological quantum error correction in average [38] M. Grant and S. Boyd, Cvx matlab software for disci- o(1) parallel time, (2013), arXiv:1307.1740. plined convex programming, version 2.1 (2014).