additions

# Fault Simulation for Superconducting Quantum Circuits

Mingyu Huang
Wang Fang  State Key Laboratory of Computer Science
Institute of Software, Chinese Academy of Sciences
Beijing, China
<EMAIL_ADDRESS>State Key Laboratory of Computer Science
Institute of Software, Chinese Academy of Sciences
Beijing, China
<EMAIL_ADDRESS>Ji Guan
Mingsheng Ying  State Key Laboratory of Computer Science
Institute of Software, Chinese Academy of Sciences
Beijing, China
<EMAIL_ADDRESS>State Key Laboratory of Computer Science
Institute of Software, Chinese Academy of Sciences
Department of Computer Science and Technology, Tsinghua University
Beijing, China
<EMAIL_ADDRESS>
###### Abstract

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.

###### Index Terms:

Quantum computing, quantum circuits, fault simulation, tensor network

##  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 2-dimensional 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 state-of-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, 9, 10, 11, 12, 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 $\mathcal{H}$. Such a quantum datum is usually called a
_pure state_ and written as $|\psi\rangle$ in the Dirac notation, and $n$
represents the number of involved _quantum bits (qubits)_. Specifically, a
qubit is a quantum datum in a $2$-dimensional Hilbert space, denoted by
$|q\rangle=\begin{pmatrix}a\\\ b\end{pmatrix}=a|0\rangle+b|1\rangle$ with
$|0\rangle=\begin{pmatrix}1\\\ 0\end{pmatrix}$ and
$|1\rangle=\begin{pmatrix}0\\\ 1\end{pmatrix}$, where complex numbers $a$ and
$b$ satisfy the normalization condition $|a|^{2}+|b|^{2}=1$. Here, the
orthonormal basis $\\{|0\rangle$, $|1\rangle\\}$ 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}\times 2^{n}$ unitary matrix $U$, i.e.,
$U^{\dagger}U=UU^{\dagger}=I_{n}$, where $U^{\dagger}$ is the (entry-wise)
conjugate transpose of $U$ and $I_{n}$ is the identity matrix on
$\mathcal{H}$. For an input $n$-qubit datum $|\psi\rangle$, the output of the
circuit is a datum of the same size: $|\psi^{\prime}\rangle=U|\psi\rangle.$

Like its classical counterpart, a quantum circuit $U$ consists of a sequence
(product) of _quantum logic gates_ $U_{i}$, i.e., $U=U_{d}\cdots U_{1}$. Here
$d$ is the depth of the circuit $U$. Each gate $U_{i}$ 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
$R_{x}(\theta)$, $R_{y}(\theta)$ and $R_{z}(\theta)$ with rotation parameter
$\theta$, 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 gate — controlled-$U$
(CU) gate, applying $U$ on the second (target) qubit if and only if the first
(control) qubit is $|1\rangle$. Specifically, the controlled-Z (CZ) gate is
commonly used in superconducting quantum circuits.

TABLE I: 1-Qubit Gate H | $\frac{1}{\sqrt{2}}\begin{pmatrix}1&1\\\ 1&-1\end{pmatrix}$ | X ($\sigma_{x}$) | $\begin{pmatrix}0&1\\\ 1&0\end{pmatrix}$
---|---|---|---
Y ($\sigma_{y}$) | ${\left(\begin{matrix}0&-i\\\ i&0\end{matrix}\right)}$ | Z ($\sigma_{z}$) | $\left(\begin{matrix}1&0\\\ 0&-1\end{matrix}\right)$
T | ${\left(\begin{matrix}1&0\\\ 0&e^{i\pi/4}\end{matrix}\right)}$ | $R_{x}(\theta)$ | ${\left(\begin{matrix}\cos\frac{\theta}{2}&-i\sin\frac{\theta}{2}\\\ -i\sin\frac{\theta}{2}&\cos\frac{\theta}{2}\end{matrix}\right)}$
$R_{y}(\theta)$ | ${\left(\begin{matrix}\cos\frac{\theta}{2}&-\sin\frac{\theta}{2}\\\ \sin\frac{\theta}{2}&\cos\frac{\theta}{2}\end{matrix}\right)}$ | $R_{z}(\theta)$ | ${\left(\begin{matrix}e^{-i\theta/2}&0\\\ 0&e^{i\theta/2}\end{matrix}\right)}$

$\begin{array}[]{c}\text{CU}=\begin{aligned}
\Qcircuit<EMAIL_ADDRESS>&\gate{U}&\qw}\end{aligned}\end{array}\begin{array}[]{c}\text{CZ}=\begin{aligned}
\Qcircuit@C=1em@R=1em{&\ctrl{1}&\qw\\\
&\ctrl{-1}&\qw}\end{aligned}=\left(\begin{matrix}1&0&0&0\\\ 0&1&0&0\\\
0&0&1&0\\\ 0&0&0&-1\end{matrix}\right)\\\ \end{array}$

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 super-operator 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 $\sigma_{z}$ control. Additional
dynamical phases are accumulated in the pulse duration. However, the
$\sigma_{z}$ control requires fine-tuning. Therefore, errors in the pulse
parameters will lead to undesired $R_{z}(\theta)$, accounting for the fidelity
loss. The effect of this fault is appending a controlled-$R_{z}$ 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.

$\displaystyle\begin{array}[]{c}\Qcircuit@C=0.5em@R=0.5em@!R{&\gate{\mathrm{R_{Y}}\,(\mathrm{\frac{-\pi}{2}})}&\gate{\mathrm{R_{Z}}\,(\mathrm{\frac{\pi}{2}})}&\ctrl{1}&\ctrl{1}&\gate{\mathrm{R_{X}}\,(\mathrm{\pi})}&\qw\\\
&\gate{\mathrm{R_{Y}}\,(\mathrm{\frac{-\pi}{2}})}&\gate{\mathrm{R_{Z}}\,(\mathrm{\frac{\pi}{2}})}&\ctrl{-1}&\gate{\mathrm{R_{Z}}\,(\theta)}&\gate{\mathrm{R_{X}}\,(\mathrm{\pi})}&\qw\gategroup{1}{4}{2}{5}{.6em}{--}}\\\
\text{A 2-qubit QAOA circuit with a unitary fault on CZ gate}\end{array}$

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},|\psi_{k}\rangle\\}$, meaning the quantum system is in
state $|\psi_{k}\rangle$ with probability $p_{k}$. Mathematically, it can be
described by a $2^{n}\times 2^{n}$ _density matrix_ $\rho$ (Hermitian positive
semidefinite matrix with unit trace111$\rho$ has unit trace if ${\rm
tr}(\rho)=1$, where trace ${\rm tr}(\rho)$ of $\rho$ is defined as the
summation of diagonal elements of $\rho$.) on $\mathcal{H}$:
$\rho=\sum_{k}p_{k}|\psi_{k}\rangle\langle\psi_{k}|,$ where $\langle\psi_{k}|$
is the conjugate transpose of $|\psi_{k}\rangle$, i.e.,
$\langle\psi_{k}|=|\psi_{k}\rangle^{\dagger}$. For convenience, we use $\psi$
to donate the density operator of pure state $|\psi\rangle\langle\psi|$. We
write $\mathcal{D(H)}$ for the set of all (mixed) quantum states on
$\mathcal{H}$. In this situation, a computational task starting at a mixed
state $\rho$ is finished by a mapping $\mathcal{E}$:
$\rho^{\prime}=\mathcal{E}(\rho),$ where $\mathcal{E}$ is the noisy
implementation of the noiseless quantum circuit $U$. Such a $\mathcal{E}$ is
called a _super-operator_ , and admits a _Kraus matrix form_ [21]: there
exists a finite set $\\{E_{k}\\}_{k\in\mathcal{K}}$ of matrices on
$\mathcal{H}$ such that

$\mathcal{E}(\rho)=\sum_{k\in\mathcal{K}}E_{k}\rho
E_{k}^{\dagger}\quad\textrm{ with
}\sum_{k\in\mathcal{K}}E_{k}^{\dagger}E_{k}=I_{n},$

where $\\{E_{k}\\}_{k\in\mathcal{K}}$ is called _Kraus matrices_ of
$\mathcal{E}$. Briefly, $\mathcal{E}$ is represented as
$\mathcal{E}=\\{E_{k}\\}_{k\in\mathcal{K}}$. Similar to noiseless quantum
circuit $U$, noisy quantum circuit $\mathcal{E}$ also consists of a sequence
(mapping composition) of (noisy) gates $\\{\mathcal{E}_{i}\\}$, i.e.,
$\mathcal{E}=\mathcal{E}_{d}\circ\cdots\circ\mathcal{E}_{1}$, where each
$\mathcal{E}_{i}$ 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 $\mathcal{E}_{a}$ is a super-operator fault describing
the effect that the energy of excited states gradually decreases, which has
Kraus matrices:

$E_{a,1}=\begin{pmatrix}1&0\\\ 0&e^{-\Delta t/2T_{1}}\end{pmatrix},\ \
E_{a,2}=\begin{pmatrix}0&\sqrt{1-e^{-\Delta t/T_{1}}}\\\ 0&0\end{pmatrix}$

where $T_{1}$ is the energy relaxation time and $\Delta t$ is the gate time
[19]. (2) Phase damping $\mathcal{E}_{p}$ 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:

$\qquad\qquad\qquad\qquad\qquad E_{p,0}=e^{-\Delta t/2T_{\varphi}}I,\\\
E_{p,1}=\sqrt{1-e^{-\Delta t/T_{\varphi}}}|0\rangle\langle 0|,\ \
E_{p,2}=\sqrt{1-e^{-\Delta t/T_{\varphi}}}|1\rangle\langle 1|$

where $T_{\varphi}$ is defined by
$\frac{1}{T_{\varphi}}=\frac{1}{T_{2}}-\frac{1}{2T_{1}}$ and $T_{2}$ is total
dephasing time [19]. Decoherence $\mathcal{E}_{D}$ is the composition of these
two super-operators, i.e.
$\mathcal{E}_{D}=\mathcal{E}_{p}\circ\mathcal{E}_{a}$.

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 $\\{P_{i}\\}_{i\in\mathcal{O}}$ of projection matrices on its state
(Hilbert) space $\mathcal{H}$ with $\mathcal{O}$ being the set of outputs and
$\sum_{i\in\mathcal{O}}P_{i}=I_{n}$. This observing process is probabilistic:
for a given quantum state $\rho$, a measurement outcome $i\in\mathcal{O}$ is
obtained with probability $p_{i}={\rm tr}(P_{i}\rho).$

##  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.

back arrow disabled=true, set color list=red!22,cyan!22,blue!22,green!22,
additions= additional item offset=0.85cm, additional item border color=black,
additional connections disabled=false, [flow diagram:horizontal]Test Circuit,
Fault Simulation, Fault Effect, Detection and Diagnosisbelow of module2/Fault
Model, above of module2/Input and Output State

Figure 1: Workflow of Fault Detection.

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 $|\psi_{t}\rangle$
is applied to a faulty circuit $\mathcal{E}_{f}$ and then the output state
$\mathcal{E}(\psi_{t})$ is observed by a measurement
$\\{P_{i}\\}_{i\in\mathcal{O}}$ according to each $|\psi_{t}\rangle$ to get
the probability distribution $\\{{\rm
tr}(P_{i}\mathcal{E}_{f}(\psi_{t}))\\}_{i\in\mathcal{O}}$ of outcomes
$\mathcal{O}$. If the distribution matches the expected one $\\{{\rm
tr}(P_{i}\mathcal{U}(\psi_{t})\\}_{i\in\mathcal{O}}$ for
$\mathcal{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, 23, 24], including how to generate such test states
$|\psi_{t}\rangle$ and measurement $\\{P_{i}\\}_{i\in\mathcal{O}}$). It is
formally defined as follows.

###### Definition 1

Given a faulty quantum circuit $\mathcal{E}_{f}$, a test state
$|\psi_{t}\rangle$ and a measurement $\\{P_{i}\\}_{i\in\mathcal{O}}$, the
fault simulation for detection and diagnosis is to compute probabilities ${\rm
tr}(P_{i}\mathcal{E}_{f}(\psi_{t}))$ for all $i\in\mathcal{O}$.

Note that $P_{i}$ is the projection onto some subspace $\mathcal{H}_{i}$ of
$\mathcal{H}$: $P_{i}|\psi\rangle=|\psi\rangle$ for all
$|\psi\rangle\in\mathcal{H}_{i}$; $P_{i}|\psi\rangle=0$ for all
$|\psi\rangle\in\mathcal{H}_{i}^{\perp}$, the orthogonal complement of
$\mathcal{H}_{i}$. Thus, if $\\{|\phi_{ik}\rangle\\}$ is an orthonormal basis
of $\mathcal{H}_{i}$, then $P_{i}$ admits the _eigenvalue decomposition_ :
$P_{i}=\sum_{k}|\phi_{ik}\rangle\langle\phi_{ik}|,$ With this decomposition,
we have:

$\displaystyle{\rm tr}(P_{i}\mathcal{E}_{f}(\psi_{t}))$ $\displaystyle={\rm
tr}(\sum_{k}|\phi_{ik}\rangle\langle\phi_{ik}|\mathcal{E}_{f}(\psi_{t}))$
$\displaystyle=\sum_{k}\langle\phi_{ik}|\mathcal{E}_{f}(\psi_{t})|\phi_{ik}\rangle$

Fault Effect of Quantum Circuits: In the field of fault detection and
diagnosis, the projection $P_{i}$ is usually defined by a pure state
$|\phi_{i}\rangle$, i.e., $P_{i}=|\phi_{i}\rangle\langle\phi_{i}|$ [23, 24].
Subsequently, what we need to calculate is just
$\langle\phi_{i}|\mathcal{E}_{f}(\psi_{t})|\phi_{i}\rangle$ for all
${i\in\mathcal{O}}$. Back to the general case of calculating ${\rm
tr}(P_{i}\mathcal{E}_{f}(\psi_{t}))$ for all ${i\in\mathcal{O}}$, we only need
to compute $\langle\phi_{ik}|\mathcal{E}_{f}(\psi_{t})|\phi_{ik}\rangle$ 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 $\mathcal{E}_{f}$, a test state
$|\psi_{t}\rangle$ and an measurement defined by state $|\psi_{e}\rangle$, the
simulation for fault effect of $\mathcal{E}_{f}$ on $|\psi_{t}\rangle$ is to
compute $\langle\psi_{e}|\mathcal{E}_{f}(\psi_{t})|\psi_{e}\rangle$.

Recall that the fidelity between two quantum states $\rho$ and $\sigma$ is:

$F(\rho,\sigma)=[{\rm tr}(\sqrt{\rho^{1/2}\sigma\rho^{1/2}})]^{2}.$

In particular, for pure state $\psi=|\psi\rangle\langle\psi|$ and mixed state
$\sigma$, $F(\psi,\sigma)=\langle\psi|\sigma|\psi\rangle$. As a result, the
fault effect we defined is
$\langle\psi_{e}|\mathcal{E}_{f}(\psi_{t})|\psi_{e}\rangle=F(\psi_{e},\mathcal{E}_{f}(\psi_{t}))$.
Since the fidelity measures how close two quantum states (density operators)
are, observe that if we choose $|\psi_{e}\rangle$ as the expected output state
$U|\psi_{t}\rangle$, 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(\psi_{e},\mathcal{E}_{f}(\psi_{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\pi/4}$), a vector
(e.g., pure state $|\psi\rangle$), a matrix (e.g., quantum gate $U$) and a set
of matrices (e.g. quantum noise $\mathcal{E}=\\{E_{k}\\}_{k\in\mathcal{K}}$),
respectively.
$e^{i\pi/4}$$\lvert\psi\rangle$$j$$U$$i$$j$$\mathcal{E}$$j$$i$$k$

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
$\langle\phi|U|\psi\rangle=\sum_{ij}a_{i}U_{ij}b_{j}$ for
$|\phi\rangle=(a_{1},\ldots,a_{2^{n}})^{\dagger}$ and
$|\psi\rangle=(b_{1},\ldots,b_{2^{n}})^{\top}$, and matrix-matrix product
$(AB)_{ik}=\sum_{j}A_{ij}B_{jk}$ are illustrated as the following two tensor
contractions:

$\begin{array}[]{lcl}\begin{array}[]{cc}\leavevmode\hbox to72.47pt{\vbox
to20.61pt{\pgfpicture\makeatletter\hbox{\hskip 45.18954pt\lower-7.31319pt\hbox
to0.0pt{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox
to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }
{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}}
{{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{0.0pt}{0.0pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {
{}{}{}}{}{}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{
{}{}} {{}{{}}}{{}{}}{}{{}{}}
{{}\pgfsys@rect{9.90399pt}{-7.11319pt}{17.1806pt}{14.22638pt}\pgfsys@stroke\pgfsys@invoke{
} }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{11.90399pt}{-2.5pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$\lvert\psi\rangle$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {
{}{}{}}{}{}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{
{}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-4.26791pt}{0.0pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {
{}{}{}}{}{}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{
{}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{3.3453pt}{3.36514pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$j$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} { {}{}{}}{}{ {}{}{}}
{{{{{}}{ {}{}}{}{}{{}{}}}}}{}{{{{{}}{
{}{}}{}{}{{}{}}}}}{{}}{}{}{}{}\pgfsys@moveto{9.704pt}{0.0pt}\pgfsys@lineto{-0.73491pt}{0.0pt}\pgfsys@stroke\pgfsys@invoke{
} {{{}{}}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{
{}{}} {{}{{}}}{{}{}}{}{{}{}}
{{}\pgfsys@rect{-15.64902pt}{-7.11319pt}{14.22638pt}{14.22638pt}\pgfsys@stroke\pgfsys@invoke{
} }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-12.49484pt}{-3.41666pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$U$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {
{}{}{}}{}{{}{}}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{
{}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} {
}{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-31.29803pt}{0.0pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {
{}{}{}}{}{{}{}}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{
{}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} {
}{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-23.06213pt}{2.39284pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$i$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} { {}{}{}}{}{ {}{}{}}
{{{{{}}{ {}{}}{}{}{{}{}}}}}{}{{{{{}}{
{}{}}{}{}{{}{}}}}}{{}}{}{}{}{}\pgfsys@moveto{-27.76503pt}{0.0pt}\pgfsys@lineto{-15.84901pt}{0.0pt}\pgfsys@stroke\pgfsys@invoke{
} { {}{}{}}{}{{}{}}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{
{}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}}
{{}\pgfsys@rect{-44.98955pt}{-7.11319pt}{18.8472pt}{14.22638pt}\pgfsys@stroke\pgfsys@invoke{
} }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-42.98955pt}{-2.5pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$\langle\phi|$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hbox
to0.0pt{}{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}\end{array}&=&\begin{array}[]{cc}\leavevmode\hbox
to42.57pt{\vbox
to14.63pt{\pgfpicture\makeatletter\hbox{\hskip-45.57999pt\lower-7.31319pt\hbox
to0.0pt{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox
to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ } {
{}{}{}{}{}}{}{}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{
{}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}}
{{}\pgfsys@rect{45.77998pt}{-7.11319pt}{42.168pt}{14.22638pt}\pgfsys@stroke\pgfsys@invoke{
} }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{47.77998pt}{-2.5pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\hbox{{$\langle\phi|U\lvert\psi\rangle$}} }}\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hbox
to0.0pt{}{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope
}\pgfsys<EMAIL_ADDRESS>\begin{array}[]{cc}\leavevmode\hbox to83.7pt{\vbox
to20.61pt{\pgfpicture\makeatletter\hbox{\hskip 54.8479pt\lower-7.31319pt\hbox
to0.0pt{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox
to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }
{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}}
{{}{{}}}{{}{}}{}{{}{}}
{{}\pgfsys@rect{-7.11319pt}{-7.11319pt}{14.22638pt}{14.22638pt}\pgfsys@stroke\pgfsys@invoke{
} }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-4.0434pt}{-3.41666pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$B$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {
{}{}{}}{}{}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{
{}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-22.7622pt}{0.0pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {
{}{}{}}{}{}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{
{}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-15.14899pt}{3.36514pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$j$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {
{}{}{}}{}{}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{
{}{}} {{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{20.00179pt}{-3.47221pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$k$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} { {}{}{}}{}{ {}{}{}}
{{{{{}}{ {}{}}{}{}{{}{}}}}}{}{{{{{}}{ {}{}}{}{}{{}{}}}}}{{}}{}{}{}{ {}{}{}}
{{{{{}}{ {}{}}{}{}{{}{}}}}}{}{{{{{}}{
{}{}}{}{}{{}{}}}}}{{}}{}{}{}{}\pgfsys@moveto{-19.2292pt}{0.0pt}\pgfsys@lineto{-7.31319pt}{0.0pt}\pgfsys@moveto{7.31319pt}{0.0pt}\pgfsys@lineto{16.46878pt}{0.0pt}\pgfsys@stroke\pgfsys@invoke{
} { {}{}{}}{}{}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{
{}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}}
{{}\pgfsys@rect{-34.14331pt}{-7.11319pt}{14.22638pt}{14.22638pt}\pgfsys@stroke\pgfsys@invoke{
} }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-30.78012pt}{-3.41666pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$A$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {
{}{}{}}{}{{}{}}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{
{}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} {
}{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-51.5149pt}{-3.29762pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$i$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} { {}{}{}}{}{ {}{}{}}
{{{{{}}{ {}{}}{}{}{{}{}}}}}{}{{{{{}}{
{}{}}{}{}{{}{}}}}}{{}}{}{}{}{}\pgfsys@moveto{-44.53676pt}{0.0pt}\pgfsys@lineto{-34.3433pt}{0.0pt}\pgfsys@stroke\pgfsys@invoke{
} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hbox
to0.0pt{}{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}\end{array}&=&\begin{array}[]{cc}\leavevmode\hbox
to56.67pt{\vbox
to14.63pt{\pgfpicture\makeatletter\hbox{\hskip-34.77827pt\lower-7.31319pt\hbox
to0.0pt{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox
to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ } {
{}{}{}{}{}}{}{}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{
{}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}}
{{}\pgfsys@rect{52.80264pt}{-7.11319pt}{19.58682pt}{14.22638pt}\pgfsys@stroke\pgfsys@invoke{
} }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{54.80264pt}{-3.41666pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$AB$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {
{}{}{}}{}{{}{}}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{
{}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} {
}{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{38.11128pt}{-3.29762pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$i$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} {
{}{}{}}{}{{}{}}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{
{}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}} {
}{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{82.59784pt}{-3.47221pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$k$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} { {}{}{}}{}{ {}{}{}}
{{{{{}}{ {}{}}{}{}{{}{}}}}}{}{{{{{}}{ {}{}}{}{}{{}{}}}}}{{}}{}{}{}{ {}{}{}}
{{{{{}}{ {}{}}{}{}{{}{}}}}}{}{{{{{}}{
{}{}}{}{}{{}{}}}}}{{}}{}{}{}{}\pgfsys@moveto{45.08942pt}{0.0pt}\pgfsys@lineto{52.60265pt}{0.0pt}\pgfsys@moveto{72.58946pt}{0.0pt}\pgfsys@lineto{79.06483pt}{0.0pt}\pgfsys@stroke\pgfsys@invoke{
} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hbox
to0.0pt{}{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}\end{array}\end{array}$

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
$T^{O(1)}\exp[O(qd)]$ [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, 9, 10, 11, 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(\psi_{e},\mathcal{E}_{f}(\psi_{t}))$ in the following way.

$\displaystyle F(\psi_{e},\mathcal{E}_{f}(\psi_{t}))$
$\displaystyle=\langle\psi_{e}|\mathcal{E}_{f}(\psi_{t})|\psi_{e}\rangle={\rm
tr}(\psi_{e}\mathcal{E}_{f}(\psi_{t}))$
$\displaystyle=\langle\Omega|[|\psi_{e}^{*}\rangle\langle\psi_{e}^{*}|\otimes\mathcal{E}_{f}(\psi_{t})]|\Omega\rangle$
$\displaystyle=\langle\Omega|[|\psi_{e}^{*}\rangle\langle\psi_{e}^{*}|\otimes\mathcal{E}_{d}\circ\cdots\circ\mathcal{E}_{1}(\psi_{t})]|\Omega\rangle$
$\displaystyle=\langle\psi_{e}^{*}|\otimes\langle\psi_{e}|(M_{\mathcal{E}_{d}}\cdots
M_{\mathcal{E}_{1}})|\psi_{t}^{*}\rangle\otimes|\psi_{t}\rangle$

where $|\psi_{t}^{*}\rangle$ is the entry-wise conjugate of
$|\psi_{t}\rangle$, $|\Omega\rangle$ is the (unnormalized) maximal entangled
state, i.e., $|\Omega\rangle=\sum_{j}|j\rangle\otimes|j\rangle$ with
$\\{|j\rangle\\}$ being an orthonormal basis of Hilbert space $\mathcal{H}$,
and $M_{\mathcal{E}}=\sum_{k}E_{k}\otimes E_{k}^{*}$ for
$\mathcal{E}=\\{E_{k}\\}$ is called the _matrix representation_ of
$\mathcal{E}$ [27].

Algorithm 1
FastFaultSimulation($\mathcal{E}_{f},|\psi_{t}\rangle,|\psi_{e}\rangle$)

1:A faulty quantum circuit
$\mathcal{E}_{f}=\mathcal{E}_{d}\circ\cdots\circ\mathcal{E}_{1}$ with
$\mathcal{E}_{i}=\\{E_{ik}\\}_{k\in\mathcal{K}_{i}}$ for $d\geq i\geq 1$, a
test state $|\psi_{t}\rangle$ and an expected output $|\psi_{e}\rangle$.

2:The fault effect $F(\psi_{e},\mathcal{E}_{f}(\psi_{t}))$

3:Computing
$X=\langle\psi_{e}^{*}|\otimes\langle\psi_{e}|(M_{\mathcal{E}_{d}}\cdots
M_{\mathcal{E}_{1}})|\psi_{t}^{*}\rangle\otimes|\psi_{t}\rangle$ by calling a
tool for tensor network contraction

4:return X

We observe that $M_{\mathcal{E}}=\sum_{k\in\mathcal{K}}E_{k}\otimes E_{k}^{*}$
can be represented by the following left tensor network. In particular, for a
unitary $\mathcal{U}=\\{U\\}$, $M_{\mathcal{U}}$ is depicted as the right
tensor network.

$\displaystyle M_{\mathcal{E}}=\sum_{k\in\mathcal{K}}E_{k}\otimes
E_{k}^{*}=\begin{aligned} \Qcircuit@C=1em@R=1em{&\gate{\mathcal{E}}&\qw\\\
&\gate{\mathcal{E}^{*}}\qwx&\qw}\end{aligned}\qquad M_{\mathcal{U}}=U\otimes
U^{*}=\begin{aligned} \Qcircuit@C=1em@R=1em{&\gate{U}&\qw\\\
&\gate{U^{*}}&\qw}\end{aligned}$

With this observation, we get a serial connection of the two tensor networks
representing $n$-qubit circuits $\mathcal{E}_{f}$ and $\mathcal{E}_{f}^{*}$.
Subsequently, we can compute
$\langle\psi_{e}^{*}|\otimes\langle\psi_{e}|(M_{\mathcal{E}_{d}}\cdots
M_{\mathcal{E}_{1}})|\psi_{t}^{*}\rangle\otimes|\psi_{t}\rangle$ 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(\psi_{e},\mathcal{E}_{f}(\psi_{t}))$. For calculating fidelity with input
test states $|\psi_{t}\rangle$ that have unknown expected output state
$|\psi_{e}\rangle$, since $|\psi_{e}\rangle=U|\psi_{t}\rangle$, we can append
the tensor network for calculating $U|\psi_{t}\rangle$ 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.

$\displaystyle\begin{array}[]{c}\Qcircuit@C=0.5em@R=0.5em@!R{\lstick{\begin{array}[]{cc}\leavevmode\hbox
to18.29pt{\vbox to14.63pt{\pgfpicture\makeatletter\hbox{\hskip
7.14442pt\lower-4.81319pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox
to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }
{{}}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor[named]{pgffillcolor}{rgb}{1,1,1}\pgfsys@color@gray@fill{1}\pgfsys@invoke{
}{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}}
{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor[named]{pgffillcolor}{rgb}{1,1,1}\pgfsys@color@gray@fill{1}\pgfsys@invoke{
}{}\pgfsys@rect{-6.94443pt}{-4.61319pt}{17.88885pt}{14.22638pt}\pgfsys@fillstroke\pgfsys@invoke{
} \pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope}{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-4.94443pt}{0.0pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$\langle 0|$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hbox
to0.0pt{}{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}\end{array}}&\gate{\mathrm{R_{Y}}}&\gate{\mathrm{R_{Z}}}&\ctrl{1}&\qw&\ctrl{1}&\gate{\mathrm{R_{Z}}\,(\mathrm{\frac{-\pi}{2}})}&\gate{\mathrm{R_{Y}}\,(\mathrm{\frac{\pi}{2}})}&\gate{|0\rangle}\\\
\lstick{\begin{array}[]{cc}\leavevmode\hbox to18.29pt{\vbox
to14.63pt{\pgfpicture\makeatletter\hbox{\hskip 7.14442pt\lower-4.81319pt\hbox
to0.0pt{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox
to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }
{{}}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor[named]{pgffillcolor}{rgb}{1,1,1}\pgfsys@color@gray@fill{1}\pgfsys@invoke{
}{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}}
{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor[named]{pgffillcolor}{rgb}{1,1,1}\pgfsys@color@gray@fill{1}\pgfsys@invoke{
}{}\pgfsys@rect{-6.94443pt}{-4.61319pt}{17.88885pt}{14.22638pt}\pgfsys@fillstroke\pgfsys@invoke{
} \pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope}{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-4.94443pt}{0.0pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$\langle 0|$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hbox
to0.0pt{}{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}\end{array}}&\gate{\mathrm{R_{Y}}}&\gate{\mathrm{R_{Z}}}&\control\qw&\gate{\leavevmode\hbox
to11.6pt{\vbox to8.75pt{\pgfpicture\makeatletter\hbox{\hskip
5.79872pt\lower-4.37332pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox
to0.0pt{\pgfsys@beginscope\pgfsys@invoke{
}{{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}}
{{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-5.79872pt}{-2.45999pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$\mathcal{E}_{D}$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} }
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hbox
to0.0pt{}{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}}\qwx[2]&\control\qw&\gate{\mathrm{R_{Z}}\,(\mathrm{\frac{-\pi}{2}})}&\gate{\mathrm{R_{Y}}\,(\mathrm{\frac{\pi}{2}})}&\gate{|0\rangle}\\\
\lstick{\begin{array}[]{cc}\leavevmode\hbox to18.29pt{\vbox
to14.63pt{\pgfpicture\makeatletter\hbox{\hskip 7.14442pt\lower-4.81319pt\hbox
to0.0pt{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox
to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }
{{}}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor[named]{pgffillcolor}{rgb}{1,1,1}\pgfsys@color@gray@fill{1}\pgfsys@invoke{
}{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}}
{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor[named]{pgffillcolor}{rgb}{1,1,1}\pgfsys@color@gray@fill{1}\pgfsys@invoke{
}{}\pgfsys@rect{-6.94443pt}{-4.61319pt}{17.88885pt}{14.22638pt}\pgfsys@fillstroke\pgfsys@invoke{
} \pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope}{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-4.94443pt}{0.0pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$\langle 0|$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hbox
to0.0pt{}{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}\end{array}}&\gate{\mathrm{R_{Y}}^{*}}&\gate{\mathrm{R_{Z}}^{*}}&\ctrl{1}&\qw&\ctrl{1}&\gate{\mathrm{R_{Z}}\,(\mathrm{\frac{-\pi}{2}})^{*}}&\gate{\mathrm{R_{Y}}\,(\mathrm{\frac{\pi}{2}})^{*}}&\gate{|0\rangle}\\\
\lstick{\begin{array}[]{cc}\leavevmode\hbox to18.29pt{\vbox
to14.63pt{\pgfpicture\makeatletter\hbox{\hskip 7.14442pt\lower-4.81319pt\hbox
to0.0pt{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox
to0.0pt{\pgfsys@beginscope\pgfsys@invoke{ }
{{}}{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor[named]{pgffillcolor}{rgb}{1,1,1}\pgfsys@color@gray@fill{1}\pgfsys@invoke{
}{{}{}{{ {}{}}}{ {}{}} {{}{{}}}{{}{}}{}{{}{}}
{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor[named]{pgffillcolor}{rgb}{1,1,1}\pgfsys@color@gray@fill{1}\pgfsys@invoke{
}{}\pgfsys@rect{-6.94443pt}{-4.61319pt}{17.88885pt}{14.22638pt}\pgfsys@fillstroke\pgfsys@invoke{
} \pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope}{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-4.94443pt}{0.0pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{ }\hbox{{$\langle 0|$}}
}}\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}}
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hbox
to0.0pt{}{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}\end{array}}&\gate{\mathrm{R_{Y}}}&\gate{\mathrm{R_{Z}}}&\control\qw&\gate{\leavevmode\hbox
to11.6pt{\vbox to10.05pt{\pgfpicture\makeatletter\hbox{\hskip
5.79872pt\lower-5.0247pt\hbox to0.0pt{\pgfsys@beginscope\pgfsys@invoke{
}\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\pgfsys@setlinewidth{0.4pt}\pgfsys@invoke{ }\nullfont\hbox
to0.0pt{\pgfsys@beginscope\pgfsys@invoke{
}{{{}}\hbox{\hbox{{\pgfsys@beginscope\pgfsys@invoke{ }{{}{}{{ {}{}}}{ {}{}}
{{}{{}}}{{}{}}{}{{}{}} { }{{{{}}\pgfsys@beginscope\pgfsys@invoke{
}\pgfsys@transformcm{1.0}{0.0}{0.0}{1.0}{-5.79872pt}{-3.11137pt}\pgfsys@invoke{
}\hbox{{\definecolor{pgfstrokecolor}{rgb}{0,0,0}\pgfsys@color@rgb@stroke{0}{0}{0}\pgfsys@invoke{
}\pgfsys@color@rgb@fill{0}{0}{0}\pgfsys@invoke{
}\hbox{{$\mathcal{E}_{D}^{*}$}} }}\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope}}} \pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope}}} }
\pgfsys@invoke{\lxSVG@closescope }\pgfsys@endscope\hbox
to0.0pt{}{}{}{}\hss}\pgfsys@discardpath\pgfsys@invoke{\lxSVG@closescope
}\pgfsys@endscope\hss}}\lxSVG@closescope\endpgfpicture}}}&\control\qw&\gate{\mathrm{R_{Z}}\,(\mathrm{\frac{-\pi}{2}})^{*}}&\gate{\mathrm{R_{Y}}\,(\mathrm{\frac{\pi}{2}})^{*}}&\gate{|0\rangle}}\end{array}$
Figure 2: Circuit for calculating fidelity of the 2-qubit QAOA circuit in
Section.II with decoherence noise $\mathcal{E}_{D}$ by appending
$|\psi_{e}\rangle=U|\psi_{t}\rangle$ to the end of circuit and redundant gates
are canceled out.

##  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.00\mathrm{GHz}\times 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\rangle\otimes\cdots\otimes|0\rangle$. To get fidelity results we append
the tensor network representing $U|0\rangle\otimes\cdots\otimes|0\rangle$, 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\leq
m\leq 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 matrix-
vector 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 $\theta$ of controlled-$R_{z}(\theta)$ is
chosen to be 0.1, the decoherent time is set to $T_{1}=100\mu s$ and
$T_{2}=20\mu s$.

The concrete benchmark circuits consist of $A$-qubit QAOA circuit (qaoa_$A$),
$B$x$C$-qubit _inst_ circuit with depth $D$ (inst_$B$x$C$_$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 ($\leq 6$), while, with the super-operator 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 5. 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 $\theta$, $T_{1}$, and
$T_{2}$, in Figs. 5 and 6. As a result, larger faulty rotation angles and
shorter decoherence time ($T_{1}$ and $T_{2})$ 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 $|\psi_{e}\rangle$ in this task is chosen to be
$|0\rangle\otimes\cdots\otimes|0\rangle$ 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-of-the-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.

$0$$2$$4$$6$$8$$10$$12$$14$$16$$0$$10$$20$$30$$40$$50$$60$$70$$80$Super-
operator Fault NumberTime(s)qaoa_100inst_6x6_20 Figure 3: Super-operator Fault
Number and Runtime.

$0$$2$$4$$6$$8$$10$$12$$14$$16$$0.9$$0.92$$0.94$$0.96$$0.98$$1$Super-operator
Fault NumberFidelityqaoa_100inst_6x6_20 Figure 4: Super-operator Fault Number

$0$$0.04$$0.08$$0.12$$0.16$$0.2$$0.5$$0.6$$0.7$$0.8$$0.9$$1$Controlled $R_{z}$
Rotation AngleFidelityqaoa_64inst_6x6_10 Figure 5: Unitary Fault Angle and
Fidelity

$100$$120$$140$$160$$180$$200$$0.89$$0.9$$0.91$$0.92$$0.93$$T_{1}$ Time($\mu
s$)Fidelityqaoa_100inst_6x6_20

$10$$12$$14$$16$$18$$20$$0.81$$0.84$$0.87$$0.9$$0.93$$T_{2}$ Time($\mu
s$)Fidelityqaoa_100inst_6x6_20

Figure 6: Decoherence Time and Fidelity TABLE II: Comparison with DDSIM Circuit | Qubits | Gates | Depth | Time(s)
---|---|---|---|---
Our | DDSIM
hf_10 | 10 | 461 | 142 | 0.38 | 0.20
hf_12 | 12 | 690 | 194 | 0.88 | 0.67
qaoa_20 | 20 | 188 | 33 | 0.09 | 129.51
qaoa_25 | 20 | 241 | 33 | 0.12 | TO
inst_4x4_60 | 16 | 579 | 61 | 7.18 | 26.70
inst_4x4_70 | 16 | 669 | 71 | 13.48 | 31.18
inst_4x4_80 | 16 | 764 | 81 | 18.89 | 36.69
inst_4x5_10 | 20 | 145 | 11 | 0.19 | 242.05
inst_4x5_20 | 20 | 261 | 21 | 0.27 | 1839.90
inst_4x5_30 | 20 | 378 | 31 | 26.98 | TO
inst_6x6_10 | 36 | 264 | 11 | 0.39 | TO
inst_6x6_20 | 36 | 483 | 21 | 3.75 | TO
inst_7x7_10 | 49 | 364 | 11 | 0.43 | TO
TABLE III: Hartree-Fock result Circuit | Qubits | Gates | Depth | Time(s)
---|---|---|---|---
Our | TDD | Qiskit
hf_6 | 6 | 155 | 72 | 0.095 | 1.2 | 0.17
hf_8 | 8 | 308 | 124 | 0.33 | 3.65 | 0.24
hf_10 | 10 | 461 | 142 | 0.37 | 7.59 | 26.91
hf_12 | 12 | 690 | 194 | 0.99 | 18.81 | 206.37
TABLE IV: QAOA Result Circuit | Qubits | Gates | Depth | Time(s)
---|---|---|---|---
Our | TDD
qaoa_64 | 64 | 1696 | 42 | 3.512039 | 58.33
qaoa_72 | 72 | 1922 | 42 | 4.412076 | 77.98
qaoa_80 | 80 | 2148 | 42 | 5.342694 | 95.34
qaoa_100 | 100 | 2720 | 42 | 11.64412 | 149.01
qaoa_121 | 121 | 3322 | 42 | 9.770204 | 225.76
qaoa_169 | 169 | 4706 | 42 | 18.46261 | 463.89
qaoa_196 | 196 | 5488 | 42 | 336.4724 | 617.16
qaoa_225 | 225 | 6330 | 42 | 925.8719 | MO
TABLE V: _inst_ Result Circuit | Qubits | Gates | Depth | Time(s)
---|---|---|---|---
Our | TDD
inst_4x4_10 | 16 | 115 | 11 | 0.07 | 0.88
inst_4x4_20 | 16 | 209 | 21 | 0.20 | 4.17
inst_4x4_30 | 16 | 299 | 31 | 5.76 | TO
inst_4x4_40 | 16 | 394 | 41 | 4.34 | TO
inst_4x4_50 | 16 | 485 | 51 | 4.80 | TO
inst_4x4_60 | 16 | 579 | 61 | 9.93 | TO
inst_4x4_70 | 16 | 669 | 71 | 21.72 | TO
inst_4x4_80 | 16 | 764 | 81 | 11.26 | TO
inst_4x5_10 | 20 | 145 | 11 | 0.10 | 1.52
inst_4x5_20 | 20 | 261 | 21 | 0.30 | TO
inst_4x5_30 | 20 | 378 | 31 | 30.98 | TO
inst_4x5_40 | 20 | 494 | 41 | 62.29 | TO
inst_4x5_50 | 20 | 610 | 51 | 123.83 | TO
inst_4x5_60 | 20 | 726 | 61 | 1587.82 | TO
inst_4x5_70 | 20 | 843 | 71 | 2027.34 | TO
inst_4x5_80 | 20 | 959 | 81 | TO(4132.89) | TO
inst_6x6_10 | 36 | 264 | 11 | 0.22 | 0.77
inst_6x6_20 | 36 | 483 | 21 | 4.85 | 21.41
inst_7x7_10 | 49 | 364 | 11 | 0.45 | 1.66

##  VI Conclusion

This paper presents a fast fault simulation algorithm for quantum
superconducting circuits. In particular, we employ tensor network 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, 23, 24]) for verifying and detecting design errors, manufacturing
defects, and quantum noise effects of large-size quantum (superconducting)
circuits.

## References

  * [1] Frank Arute et al.  “Quantum supremacy using a programmable superconducting processor”  In _Nature_ 574.7779 Nature Publishing Group, 2019, pp. 505–510
  * [2] Ming Gong et al.  “Quantum walks on a programmable two-dimensional 62-qubit superconducting processor”  In _Science_ 372.6545 American Association for the Advancement of Science, 2021, pp. 948–952
  * [3] John Preskill  “Quantum computing in the NISQ era and beyond”  In _Quantum_ 2 Verein zur Förderung des Open Access Publizierens in den Quantenwissenschaften, 2018, pp. 79
  * [4] Miron Abramovici, Melvin A Breuer and Arthur D Friedman  “Digital systems testing and testable design”  Computer science press New York, 1990
  * [5] Laung-Terng Wang, Cheng-Wen Wu and Xiaoqing Wen  “VLSI test principles and architectures: design for testability”  Elsevier, 2006
  * [6] X-D Cai et al.  “Experimental quantum computing to solve systems of linear equations”  In _Physical Review Letters_ 110.23 APS, 2013, pp. 230501
  * [7] Aram W Harrow, Avinatan Hassidim and Seth Lloyd  “Quantum algorithm for linear systems of equations”  In _Physical review letters_ 103.15 APS, 2009, pp. 150502
  * [8] Thomas Häner and Damian S Steiger  “5 petabyte simulation of a 45-qubit quantum circuit”  In _Proceedings of the International Conference for High Performance Computing, Networking, Storage and Analysis_ , 2017, pp. 1–10
  * [9] Cupjin Huang et al.  “Classical simulation of quantum supremacy circuits”  In _arXiv preprint arXiv:2005.06787_ , 2020
  * [10] Riling Li et al.  “Quantum supremacy circuit simulation on Sunway TaihuLight”  In _IEEE Transactions on Parallel and Distributed Systems_ 31.4 IEEE, 2019, pp. 805–816
  * [11] Edwin Pednault et al.  “Breaking the 49-qubit barrier in the simulation of quantum circuits”  In _arXiv preprint arXiv:1710.05867_ 15, 2017
  * [12] Benjamin Villalonga et al.  “A flexible high-performance simulator for verifying and benchmarking quantum circuits implemented on real hardware”  In _npj Quantum Information_ 5.1 Nature Publishing Group, 2019, pp. 1–16
  * [13] Feng Pan and Pan Zhang  “Simulation of Quantum Circuits Using the Big-Batch Tensor Network Method”  In _Phys. Rev. Lett._ 128 American Physical Society, 2022, pp. 030501  DOI: 10.1103/PhysRevLett.128.030501
  * [14] Yuan-Hung Tsai, Jie-Hong R. Jiang and Chiao-Shan Jhang  “Bit-Slicing the Hilbert Space: Scaling Up Accurate Quantum Circuit Simulation”  In _2021 58th ACM/IEEE Design Automation Conference (DAC)_ San Francisco, CA, USA: IEEE Press, 2021, pp. 439–444  DOI: 10.1109/DAC18074.2021.9586191
  * [15] Alwin Zulehner and Robert Wille  “Advanced simulation of quantum computations”  In _IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems_ 38.5 IEEE, 2018, pp. 848–859
  * [16] Stefan Hillmich, Richard Kueng, Igor L Markov and Robert Wille  “As accurate as needed, as efficient as possible: Approximations in dd-based quantum circuit simulation”  In _2021 Design, Automation & Test in Europe Conference & Exhibition (DATE)_, 2021, pp. 188–193  IEEE
  * [17] Thomas Grurl, Jürgen Fuß and Robert Wille  “Noise-aware Quantum Circuit Simulation With Decision Diagrams”  In _IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems_ , 2022, pp. 1–1  DOI: 10.1109/TCAD.2022.3182628
  * [18] Chase Roberts et al.  “TensorNetwork: A Library for Physics and Machine Learning”, 2019  arXiv:1905.01330 [physics.comp-ph]
  * [19] “Fault models in superconducting quantum circuits” unpublished
  * [20] Matthew Harrigan et al.  “Quantum Approximate Optimization of Non-Planar Graph Problems on a Planar Superconducting Processor”  In _Nature Physics_ , 2021  URL: https://www.nature.com/articles/s41567-020-01105-y
  * [21] Michael A Nielsen and Isaac L Chuang  “Quantum computation and quantum information”  Cambridge university press, 2010
  * [22] Xiao Fang-ying, Chen Han-wu, Liu Wen-jie and Li Zhi-giang  “Fault detection for single and multiple missing-gate faults in reversible circuits”  In _2008 IEEE Congress on Evolutionary Computation (IEEE World Congress on Computational Intelligence)_ , 2008, pp. 131–135  IEEE
  * [23] Alexandru Paler, Ilia Polian and John P Hayes  “Detection and diagnosis of faulty quantum circuits”  In _17th Asia and South Pacific Design Automation Conference_ , 2012, pp. 181–186  IEEE
  * [24] Debajyoti Bera  “Detection and diagnosis of single faults in quantum circuits”  In _IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems_ 37.3 IEEE, 2017, pp. 587–600
  * [25] Jacob Biamonte and Ville Bergholm  “Tensor networks in a nutshell”  In _arXiv preprint arXiv:1708.00006_ , 2017
  * [26] Igor L Markov and Yaoyun Shi  “Simulating quantum computation by contracting tensor networks”  In _SIAM Journal on Computing_ 38.3 SIAM, 2008, pp. 963–981
  * [27] Mingsheng Ying  “Foundations of Quantum Programming”  Morgan Kaufmann, 2016
  * [28] Google AI Quantum and Collaborators et al.  “Hartree-Fock on a superconducting qubit quantum computer”  In _Science_ 369.6507, 2020, pp. 1084–1089  DOI: 10.1126/science.abb9811
  * [29] Sergio Boixo et al.  “Characterizing Quantum Supremacy in Near-Term Devices”  In _Nature Physics_ 14, 2018, pp. 595–600  URL: https://www.nature.com/articles/s41567-018-0124-x
  * [30] Xin Hong et al.  “A Tensor Network Based Decision Diagram for Representation of Quantum Circuits”  In _ACM Trans. Des. Autom. Electron. Syst._ 27.6 New York, NY, USA: Association for Computing Machinery, 2022  DOI: 10.1145/3514355
  * [31] Xin Hong et al.  “Approximate Equivalence Checking of Noisy Quantum Circuits”  In _2021 58th ACM/IEEE Design Automation Conference (DAC)_ , 2021, pp. 637–642  DOI: 10.1109/DAC18074.2021.9586214