{'fraction_non_alphanumeric': 0.042680750838626796, 'fraction_numerical': 0.008029405467132968, 'mean_word_length': 4.646383235946001, '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': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Fault Simulation for Superconducting Quantum Circuits

This paper introduces a fast fault simulation algorithm for superconducting quantum circuits with realistic fault models based on real defect behavior or control errors of the circuits. The algorithm is developed on a novel tensor network representation of the fault models with fast tensor network computation. The effectiveness and utility of the algorithm are demonstrated by experimenting on a series of practical quantum circuits executed on Google's Sycamore quantum superconducting processor. As a result, up to 225 qubits (for the variational quantum circuits) are handled (within about 15 minutes), outperforming state-of-the-art fault simulation algorithms in both efficiency and scalability.


I. INTRODUCTION
Nowadays, various quantum processors have been manufactured, and quantum supremacy has been achieved. Among the existing hardware implementations of quantum processors, superconducting quantum computing is one of the most promising routines. Specifically, superconducting quantum bits (qubits) have faster gate time, which means the execution of the quantum circuit will be faster. Additionally, superconducting implementation is also capable of using a large number of qubits. The superconducting processor Sycamore of Google with 53 qubits is the first processor that achieves quantum supremacy (beyond classical computing) [1]. After that, University of Science and Technology of China implemented a 2dimensional quantum random walk on a 62-qubit superconducting quantum processor [2]. Thus, the superconducting quantum computing implementation may bring practical applications to the current NISQ (Noisy Intermediate-Scale Quantum) era [3], where quantum processors contain 50 to a few hundred noisy qubits.
The core of the processors is the circuits for executing computational tasks. Before the circuits are physically built, simulation is essential in digital circuit verification, test development, design debugging, and diagnosis. In particular, fault simulation is to simulate faulty digital circuits with two main objectives: one is fault-free (logic) simulation to help the designer verify that the design of digital circuits conforms to the intended functional specifications; the other is to determine the efficiency of test patterns in detecting the modeled faults of interest, with such patterns being usually generated by automatic test pattern generators (ATPG) [4], [5]. Now fault simulation can be efficiently applied to large-scale integrated circuits and has become a standard technique integrated into electronic design automation (EDA).
Currently, in quantum computing, however, physicists usually experimentally build the designed quantum circuits and then estimate their performance in the presence of quantum faults. Here, the quantum faults come from the inaccuracy of the control pulse and the surrounding environment, which is inevitable in the NISQ era. For example, a circuit with four qubits and four controlled quantum logic gates was implemented in [6] for an experiment of HHL algorithm [7], which could exponentially speed up solving linear systems over classical computers. The performance test for three different input states shows that compared to the ideal outcomes, the output states have fidelities of 99.3%, 82.5%, and 83.6%, respectively. Google's Sycamore has used a similar way to confirm quantum supremacy on sampling a quantum circuit with cross-entropy benchmark fidelity 0.2% [1].
Fault simulation of quantum circuits (on classical computers) before physically building them is helpful and more affordable due to the expensive resource and strict conditions (e.g., the environmental temperature must be close to absolute zero) of experimentally implementing quantum circuits and the uncertainty of reading out outputs on real quantum devices. Therefore, developing fault simulation algorithms for (superconducting) quantum circuits is urgent and necessary. However, a direct generalization of the existing fault simulation method for classical circuits to quantum circuits is expected to be unsuccessful. One primary reason is that quantum fault simulation is generally quantitative rather than qualitative as classical fault simulation: the inputs/outputs of quantum circuits are vectors or matrices of complex numbers, while those of classical circuits are boolean values -0 or 1. This fundamental difference requires quantum fault simulation to be built in its own way.
Quantum Fault Simulation Algorithms: We first recall the stateof-the-art simulation algorithms for noiseless and noisy quantum circuits. For both cases, a direct method is to calculate the transitions of the state vector or density matrix representation through a sequence of quantum gates modeled by unitary matrices. This method is simple and usually integrated into software development kits for quantum computing (e.g., Qiskit, Cirq, etc.). However, the exponential number of terms in these representations limits the number of qubits that can be simulated. For overcoming this issue, one of the most popular methods is to use a data structure, called tensor network, to catch the locality (a quantum gate is only applied on 1 or 2 qubits) and regularity (the pattern of quantum gates in practical circuits is regular) of quantum circuits and has been successively used in the simulation of sizeable noiseless quantum circuits [8]- [13]. However, the tensor network method cannot directly simulate noisy quantum circuits. Another approach is the Decision Diagram-based (DD-base) method [14], [15], which is generally more lightweight than the tensor network-based one. It stores all amplitudes of a state in a compact data structure, using less memory and performing better on circuits with simpler structures. However, most of these methods work well for the circuits which can keep the size of the data structures small for each intermediate state in the simulating process. They can achieve satisfactory performance in full amplitude simulation of this kind of circuit. However, superconducting quantum circuits compose of gates with arbitrary parameters, and the performance of such methods on these circuits is ineffective [14], [16]. Although the DD-based methods can be adapted to support noisy quantum circuit simulation [17], the extra noise operator leads to a high cost of runtime.
Current superconducting quantum processors have a relatively large number of qubits, and most circuits include gates with arbitrary rotation angles, this motivates us to develop a new simulation algorithm based on the tensor network representation of noisy quantum circuits to perform fault simulation on the superconducting quantum circuits.
Contributions of This Paper: The tensor network-based techniques cannot be immediately used to simulate faulty quantum circuits as quantum faults affected by quantum noises cannot be directly represented by tensor networks. We solve this problem by representing a faulty quantum circuit in a double-size tensor network. An algorithm is developed and implemented with Google TensorNetwork [18] to simulate all kinds of quantum faults. Our experimental results show that with our new method, the simulated size of practical faulty superconducting quantum circuits can be boosted up to 225 qubits for that of the QAOA algorithm.

II. FAULT MODELS
As a basis of our work, this section aims to present fault models of superconducting quantum circuits [19].
We start by recalling some basic concepts of quantum circuits. Ideally, a quantum computer without noise is a closed system. In this case, quantum data are mathematically modeled as complex unit vectors in a 2 n -dimensional Hilbert (linear) space H. Such a quantum datum is usually called a pure state and written as |ψ in the Dirac notation, and n represents the number of involved quantum bits (qubits). Specifically, a qubit is a quantum datum in , where complex numbers a and b satisfy the normalization condition |a| 2 + |b| 2 = 1. Here, the orthonormal basis {|0 , |1 } of the Hilbert space corresponds to the values {0, 1} of a bit in classical computers. A quantum computing task is implemented by a quantum circuit, which is mathematically represented by a 2 n × 2 n unitary matrix U , i.e., U † U = U U † = In, where U † is the (entry-wise) conjugate transpose of U and In is the identity matrix on H. For an input n-qubit datum |ψ , the output of the circuit is a datum of the same size: |ψ ′ = U |ψ . Like its classical counterpart, a quantum circuit U consists of a sequence (product) of quantum logic gates Ui, i.e., U = U d · · · U1. Here d is the depth of the circuit U . Each gate Ui only non-trivially operates on one or two qubits. We list commonly used 1-qubit gates in Table I. Arbitrary 1-qubit gates can be decomposed into 1-qubit rotation gates Rx(θ), Ry(θ) and Rz(θ) with rotation parameter θ, and superconducting quantum processors implement arbitrary 1-qubit gate by executing a sequence of these rotation gates. In addition, for any 1-qubit logic gate U , we can generate a 2-qubit logic gatecontrolled-U (CU) gate, applying U on the second (target) qubit if and only if the first (control) qubit is |1 . Specifically, the controlled-Z (CZ) gate is commonly used in superconducting quantum circuits.
Now, we are ready to introduce fault models for superconducting quantum circuits. By the principle of quantum mechanics, faults in quantum circuits fall into two classes -unitary faults and superoperator faults.
Unitary Faults: Elementary 2-qubit gates (e.g. CZ gate), are implemented by adding control pulses to effective Hamiltonians in real superconducting quantum chips. A typical CZ gate could be realized by modulating the frequency of the control qubit, which is called a σz control. Additional dynamical phases are accumulated in the pulse duration. However, the σz control requires fine-tuning. Therefore, errors in the pulse parameters will lead to undesired Rz(θ), accounting for the fidelity loss. The effect of this fault is appending a controlled-Rz gate after the ideal CZ gate, as shown in the dashed box of the following circuit for a quantum approximate optimization algorithm (QAOA) [20], which is a variational quantum algorithm for solving combinatorial optimization problems. Such a fault is called a unitary fault, which is represented by a unitary matrix.

with a unitary fault on CZ gate
Super-operator Faults: In the current NISQ era, quantum noise is unavoidable, we have to consider the noisy effect on quantum circuits. In this case, uncertainty will be brought in quantum computing such that quantum states became mixed instead of pure states. A mixed state is considered as an ensemble {(p k , |ψ k }, meaning the quantum system is in state |ψ k with probability p k . Mathematically, it can be described by a 2 n × 2 n density matrix ρ (Hermitian positive semidefinite matrix with unit trace 1 ) on H: ρ = k p k |ψ k ψ k |, where ψ k | is the conjugate transpose of |ψ k , i.e., ψ k | = |ψ k † . For convenience, we use ψ to donate the density operator of pure state |ψ ψ|. We write D(H) for the set of all (mixed) quantum states on H. In this situation, a computational task starting at a mixed state ρ is finished by a mapping E : ρ ′ = E (ρ), where E is the noisy implementation of the noiseless quantum circuit U . Such a E is called a super-operator, and admits a Kraus matrix form [21]: there exists a finite set {E k } k∈K of matrices on H such that Similar to noiseless quantum circuit U , noisy quantum circuit E also consists of a sequence (mapping composition) of (noisy) gates {Ei}, i.e., E = E d • · · · • E1, where each Ei is either a noiseless gate or a noisy one. The noisy one is called a super-operator fault, which is represented by Kraus matrices.
In superconducting quantum hardware, decoherence is a typical noisy fault resulting from the surrounding environment of the hardware. Decoherence can be mathematically explained as the decay effect of the off-diagonal element in the density matrices of mixed states. The decay comes from amplitude damping and phase damping.
(1) Amplitude damping Ea is a super-operator fault describing the effect that the energy of excited states gradually decreases, which has Kraus matrices: where T1 is the energy relaxation time and ∆t is the gate time [19].
(2) Phase damping Ep is also a super-operator fault refers to pure dephasing, which is the off-diagonal elements decay without affecting the population of diagonal elements. Phase damping can be described by three Kraus matrices: where Tϕ is defined by 1 Tϕ = 1 T 2 − 1 2T 1 and T2 is total dephasing time [19]. Decoherence ED is the composition of these two superoperators, i.e. ED = Ep • Ea.
At the end of quantum circuits, we cannot directly observe a qubit as it is physically a particle at the microscopic scale (near or less than 10 −9 meters). The only way allowed by quantum mechanics to extract classical information is through a quantum measurement, which is mathematically modeled by a set {Pi}i∈O of projection matrices on its state (Hilbert) space H with O being the set of outputs and i∈O Pi = In. This observing process is probabilistic: for a given quantum state ρ, a measurement outcome i ∈ O is obtained with probability pi = tr(Piρ).

III. FAULT SIMULATION OF QUANTUM CIRCUITS
As illustrated in Fig. 1, the result of fault simulation works for fault detection and diagnosis. In this section, we first introduce fault detection and diagnosis for quantum circuits, then formulate the simulation problem in our work.  Fault Detection and Diagnosis for Quantum Circuits: Following the strategy of fault detection for classical digital circuits, for each modeled fault of an ideal quantum circuit U , a carefully designed test state |ψt is applied to a faulty circuit E f and then the output state E (ψt) is observed by a measurement {Pi}i∈O according to each |ψt to get the probability distribution {tr(PiE f (ψt))}i∈O of outcomes O. If the distribution matches the expected one {tr(PiU(ψt)}i∈O for U = {U }, then such fault is deemed not to be present in U . Furthermore, if all tests corresponding to different modeled faults pass, the circuit U is guaranteed to contain no modeled faults. On the other hand, such test information (the probability distributions of measurement outcomes) can be used to find which modeled fault appears or which gate is faulty. This problem is known as the diagnosis of faulty quantum circuits (for more details, see [22]- [24], including how to generate such test states |ψt and measurement {Pi}i∈O). It is formally defined as follows.
Definition 1: Given a faulty quantum circuit E f , a test state |ψt and a measurement {Pi}i∈O, the fault simulation for detection and diagnosis is to compute probabilities tr(PiE f (ψt)) for all i ∈ O.
Note that Pi is the projection onto some subspace Hi of H: Pi|ψ = |ψ for all |ψ ∈ Hi; Pi|ψ = 0 for all |ψ ∈ H ⊥ i , the orthogonal complement of Hi. Thus, if {|φ ik } is an orthonormal basis of Hi, then Pi admits the eigenvalue decomposition: Pi = k |φ ik φ ik |, With this decomposition, we have: Fault Effect of Quantum Circuits: In the field of fault detection and diagnosis, the projection Pi is usually defined by a pure state |φi , i.e., Pi = |φi φi| [23], [24]. Subsequently, what we need to calculate is just φi|E f (ψt)|φi for all i ∈ O. Back to the general case of calculating tr(PiE f (ψt)) for all i ∈ O, we only need to compute φ ik |E f (ψt)|φ ik in parallel for each i and k. As a result, we summarize the task of our fault simulation as fault effect in the following.
Definition 2: Given a faulty quantum circuit E f , a test state |ψt and an measurement defined by state |ψe , the simulation for fault effect of E f on |ψt is to compute ψe|E f (ψt)|ψe .
Recall that the fidelity between two quantum states ρ and σ is: F (ρ, σ) = [tr( ρ 1/2 σρ 1/2 )] 2 . In particular, for pure state ψ = |ψ ψ| and mixed state σ, F (ψ, σ) = ψ|σ|ψ . As a result, the fault effect we defined is ψe|E f (ψt)|ψe = F (ψe, E f (ψt)). Since the fidelity measures how close two quantum states (density operators) are, observe that if we choose |ψe as the expected output state U |ψt , the fault effect just measures how close the real output state is with the expected output state. Thus instead of providing essential information for fault detection, fault simulation can also be used to predict the performance of quantum circuits under noise, such as that for the HHL algorithm mentioned in the introduction section.

IV. FAST FAULT SIMULATION ALGORITHM
In this section, we present our tensor network-based fast fault simulation algorithm for computing fault effect F (ψe, E f (ψt)).
Tensor Network Contraction: For a better understanding, let us explain tensor network contraction by tensor diagram notation in the context of quantum circuits (see [25] for more details). Briefly, a tensor is a multi-dimensional array of complex numbers and is a labeled box with zero or more open output legs. Each leg labeled by an index (e.g., i, j, k) represents a dimension of the array, and a complex number is a tensor without legs. For example, the following notations represent a complex number (e.g., e iπ/4 ), a vector (e.g., pure state |ψ ), a matrix (e.g., quantum gate U ) and a set of matrices (e.g. quantum noise E = {E k } k∈K ), respectively.
Furthermore, if multiple tensors exist in a diagram, then we call them a tensor network. In this case, we can contract them by linking their legs with the same indexes. This operation is known as tenor network contraction, which is a generalization of matrix (and vector) multiplication. For example, vector-matrix-vector product φ|U |ψ = ij aiUij bj for |φ = (a1, . . . , a2n ) † and |ψ = (b1, . . . , b2n ) ⊤ , and matrix-matrix product (AB) ik = j Aij B jk are illustrated as the following two tensor contractions: The above two diagrams on the left are instances of tensor networks. Indeed, all quantum circuits in the previous sections can be easily represented as tensor networks, where a gate is a tensor and each leg of the gate is labeled by an index in {0, 1}.
The benefit of representing quantum circuits by tensor networks is that tensor networks can exploit the regularity and locality contained in the structure of quantum circuits (but matrix representation cannot). Complexity of tensor network contraction for a q-local-interacting quantum circuit is [26], where T is the number of gates (tensors), d is the depth in the circuit (tensor network), and a circuit is q-local-interacting if under a linear ordering of its qubits, each gate acts only on qubits within distance q. Even though the worse case (presented in the complexity) is exponential in d, there are a bulk of efficient algorithms to implement tensor network contraction for practical large-size quantum circuits (e.g. [8]- [12]). Now we are ready to present our quantum fault simulation algorithm. The key idea is to convert the noisy quantum circuits into a double-size tensor network (Algorithm 1).
Fast Fault Simulation Algorithm: We can compute fault effect F (ψe, E f (ψt)) in the following way.
where |ψ * t is the entry-wise conjugate of |ψt , |Ω is the (unnormalized) maximal entangled state, i.e., |Ω = j |j ⊗ |j with {|j } being an orthonormal basis of Hilbert space H, and , a test state |ψt and an expected output |ψe . Output: The fault effect F (ψe, E f (ψt)) 1: Computing X = ψ * e | ⊗ ψe|(M E d · · · M E 1 )|ψ * t ⊗ |ψt by calling a tool for tensor network contraction 2: return X We observe that ME = k∈K E k ⊗ E * k can be represented by the following left tensor network. In particular, for a unitary U = {U }, MU is depicted as the right tensor network.
With this observation, we get a serial connection of the two tensor networks representing n-qubit circuits E f and E * f . Subsequently, we can compute ψ * e | ⊗ ψe|(ME d · · · ME 1 )|ψ * t ⊗ |ψt by contracting a tensor network with double size (2n qubits). Based on this idea, an algorithm (Algorithm 1) is developed to compute fault effect F (ψe, E f (ψt)). For calculating fidelity with input test states |ψt that have unknown expected output state |ψe , since |ψe = U |ψt , we can append the tensor network for calculating U |ψt at the end of the tensor network of the faulty circuit. Moreover, we observe that those gates after the last fault can be canceled out, reducing the calculation cost of contracting the tensor network, as shown in Fig. 2.

V. EXPERIMENTS ON SUPERCONDUCTING QUANTUM CIRCUITS
In this section, we demonstrate the utility and effectiveness of our fault simulation algorithm by computing the fault effects of superconducting quantum circuits with realistic fault models introduced before. All types of these circuits have been implemented on quantum superconducting devices of Google.
Runtime Environment: All our experiments are carried out on a server with Intel Xeon Platinum 8153 @ 2.00GHz × 256 Processors, 2048 GB Memory. The machine runs Centos 7.7.1908. We use the Google TensorNetwork Python package [18] for the tensor network computation. The time-out (TO) limit was set to 3600 seconds. The memory-out (MO) limit was set to 2048 GB.
Experimental Cases: We test our fault simulation algorithm by computing the fault effects of three types of practical superconducting quantum circuits which have already been implemented on Google's Sycamore quantum superconducting processor: (i) Quantum Approximate Optimization Algorithm (QAOA), (ii) Hartree-Fock Variational Quantum Eigensolver (VQE), and (iii) inst circuits used to show the quantum supremacy of Sycamore [20], [28], [29]. The test states in all experiments are chosen to be |0 ⊗· · ·⊗|0 . To get fidelity results we append the tensor network representing U |0 ⊗· · ·⊗|0 , as explained in Section IV. We generate the faulty circuits by putting the unitary fault after each CZ gate or randomly inserting m decoherence noises in the circuits. Thus, the number of unitary faults is that of CZ gates in the circuits, and the number m of super-operator fault is in the range 0 ≤ m ≤ 16.
Baselines: We compare the efficiency of our simulator with the simulators of DDSIM [15], Qiskit, and TDD (Tensor Decision Diagram) [30], [31]. The DDSIM is a state-of-the-art DD-based simulator for noiseless circuit simulation, we use it to benchmark the performance of our simulator in noise-free cases. The algorithm in Qiskit is widely used in quantum simulation and based on matrixvector techniques, and that of TDD is based on tensor network techniques. All three simulation algorithms are executed on the same runtime environment mentioned above.
Optimization Techniques: One standard method for contracting tensor networks is through a sequential pairwise contraction, i.e., two tensors from the tensor network are selected and merged as one tensor. The tensor network contraction is finished by repeatedly applying the pairwise contraction. A cleverly chosen pairwise contraction order can often reduce tensor network contraction's runtime by several orders of magnitude. Over the years, many heuristics have been proposed to find efficient orders. Here, we call a greedy method (embedded in Google TensorNetwork) to speed up the tensor network contraction in our algorithm. Other heuristics may further optimize the performance of our algorithm.
Experimental Results and Analysis: The utility and effectiveness of our simulation algorithm are confirmed by the following four numerical experiments (1 − 4) in terms of runtime, fault numbers, fidelity, and the physical parameters (introduced in Section II) appearing in realistic faulty superconducting quantum circuits. For all cases, except for (3), we fix the parameters: the fault rotation angle θ of controlled-Rz(θ) is chosen to be 0.1, the decoherent time is set to T1 = 100µs and T2 = 20µs.
The concrete benchmark circuits consist of A-qubit QAOA circuit (qaoa A), BxC-qubit inst circuit with depth D (inst BxC D) and E-qubit Hartree-Fock VQE circuit (hf E), where A, B, C, D, E are all positive numbers.
(1) Super-operator Fault Number and Runtime: We illustrate the performance of our algorithm with different super-operator fault numbers (i.e., the number of super-operator faults in quantum circuits) in Fig. 3. The result shows that our algorithm works very well when the super-operator fault number is small (≤ 6), while, with the superoperator fault number increasing, the runtime grows significantly. The main reason is that more super-operator faults may increase the maximum rank of nodes in the contraction of the tensor network.
(2) Fault Number and Fidelity: The relation between fidelity and different super-operator fault numbers is shown in Fig 4. The fault number ranges from 2 to 16. Not surprisingly, the fidelity drops with the fault number increasing.
(3) Fault Parameters and Fidelity: We show the fidelity with different parameters in the fault model, including rotation angle θ, T1, and T2, in Figs. 5 and 6. As a result, larger faulty rotation angles and shorter decoherence time (T1 and T2) will lead to a more significant fault effect on superconducting quantum circuits. From Fig. 5, we can say that a larger rotation angle leads to a high loss of fidelity, which is a challenge for hardware technology in the current NISQ era.
(4) Performance Comparison: First we compare the performance of our algorithm with the state-of-the-art QMDD-based simulator DDSIM in Table II by running a noiseless simulation task. The result shows that our method outperforms DDSIM in almost all test cases, indicating that our algorithm performs well on the noiseless simulation task of these superconducting quantum circuits. Then, we mainly compare the performance of TDD and our algorithm on the three benchmark circuits in Table III, IV, V. Qiskit can only simulate the Hartree-Fock VQE circuit since the qubit number is small. Although DDSIM can perform faulty circuit simulation [17], the task is slightly different from ours, and the performance is most concerned with stochastic simulation, so it is not compared with our simulator for noisy quantum circuits. The |ψe in this task is chosen to be |0 ⊗ · · · ⊗ |0 and the runtime of our algorithm will be the same for any other product states. From our result, our method has less runtime in all three benchmarks than the TDD method with the super-operator fault number set to be 2. The performance of our method is better, especially in inst circuits with large depths. The high efficiency of our method results from the fact that our tensor network method utilizes the locality of quantum circuits and several state-ofthe-art contracting methods embedded in the Google TensorNetwork package. Since the simulator in Qiskit does not consider the locality, it can only handle circuits with few qubits. Although the TDD method benefits from the locality, the representation is unsuitable for representing a state with arbitrary amplitude on all computational basis (e.g., inst circuits). Moreover, the partition strategy used in TDD is straightforward compared to the strategies embedded in the Google TensorNetwork package, which may find more efficient contraction orders.   contraction to calculate the fault effect. The utility and effectiveness of our algorithm are demonstrated by experimenting on a series of realistic faulty superconducting circuits. The experimental results indicate that the proposed algorithm (implemented with Google TensorNetwork) significantly improves the efficiency and scalability of the state-of-the-art fault simulation algorithms based on the density matrix or DD-based method, especially for superconducting quantum circuits in the current NISQ era. Therefore, our algorithm is expected to be used as an integrated feature in the currently developed ATPG programs (e.g., [22]- [24]) for verifying and detecting design errors, manufacturing defects, and quantum noise effects of large-size quantum (superconducting) circuits.