This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Quantum Circuit Tensors and Enumerators with Applications to Quantum Fault Tolerance

Alon Kukliansky and Brad Lackey A. Kukliansky is at the U.S. Naval Postgraduate School.B. Lackey is at Microsoft Quantum, Microsoft Corporation. 0009-0003-6743-9018 0000-0002-3823-8757
Abstract

We extend the recently introduced notion of tensor enumerator to the circuit enumerator. We provide a mathematical framework that offers a novel method for analyzing circuits and error models without resorting to Monte Carlo techniques. We introduce an analogue of the Poisson summation formula for stabilizer codes, facilitating a method for the exact computation of the number of error paths within the syndrome extraction circuit of the code that does not require direct enumeration. We demonstrate the efficacy of our approach by explicitly providing the number of error paths in a distance five surface code under various error models, a task previously deemed infeasible via simulation. We also show our circuit enumerator is related to the process matrix of a channel through a type of MacWilliams identity.

Index Terms:
Quantum codes, circuit tensors, weight enumerators, tensor enumerators, circuit enumerators, MacWilliams identity

I Introduction

Quantum error correction is an essential part of scalable quantum computation. A key component of this is the fault tolerance of the circuits used to extract syndromes of quantum codes [1, 2, 3, 4]. Typically, the analysis of such circuits relies on direct simulation using Monte Carlo trials [5, 6]. Often lower bounds of the fault tolerant threshold are obtained by counting error paths [7]. Otherwise, there are a few general methods for the analysis of fault tolerant protocols, see for example [8] for one.

Our approach is based on tensor enumerators of [9]. These provide a method to explicitly analyze circuits and error models without the use of Monte Carlo techniques. In particular, we have developed a formalism that can represent both unitary circuits and quantum channels as tensor objects, from which enumerators can be derived.

We provide an analogue of the Poisson summation formula for stabilizer codes that allows for rapid enumeration of error paths.

Generally, the computation of quantum weight enumerators and hence circuit enumerators, is exponential in the number of qubits. For small circuits this is feasible, however, for larger circuits, this is only tractable when the circuit is sparse or has a special structure, which is often the case for syndrome extraction circuits. In particular, we find we can explicitly count the error paths of a distance five surface code under a variety of error models, which would be impossible using simulation.

This paper is organized as follows: we provide the needed background and layout of our notation in §II. Next, in §III we formalize the circuit tensor and Choi state for a linear map, prove composition laws, and compute these for key examples. In §IV, we define the Choi matrix and circuit tensor for any quantum channel, and prove the circuit tensor composition laws at this level of generality. §V contains many circuit tensor constructions for common quantum circuits, with a final example of the teleportation circuit. We incorporate noise sources into the quantum circuit in §VI, and show how to analyze them using circuit enumerators. We extend the teleportation example to include quantum and classical noise sources, calculate its circuit enumerator, and generate the error model of the output state. §VII holds the Poisson summation theorem for circuit enumerators of stabilizer codes. Following, §VIII shows how to use circuit enumerators to analyze a noisy syndrome extraction circuit for a stabilizer code. Finally, in §IX we discuss our theory and its impact.

In an appendix, we show our circuit tensor is related to the process matrix of a channel through a type of MacWilliams identity.

II Background

Here we provide an accelerated presentation of the background material we need for this work. We discuss quantum and classical error bases on Hilbert spaces, the Pauli basis in particular, as a means for introducing circuit tensors and enumerators. We also present the Shor-Laflamme enumerators for stabilizer codes, as well as their tensor enumerators.

Much of this work holds in the context of a general error basis. However, as in [9], we restrict to “nice error bases” [10, 11] with Abelian index group [12], defined as follows.

Definition 1 (Hilbert space error basis).

An error basis on a Hilbert space \mathfrak{H} is a basis of unitary operators \mathcal{E}, which

  1. 1.

    contains the identity II\in\mathcal{E};

  2. 2.

    is trace-orthogonal Tr(EF)=0\operatorname{Tr}(E^{\dagger}F)=0 if EFE\not=F; and,

  3. 3.

    satisfies EF=ω(E,F)FEEF=\omega(E,F)FE for all E,FE,F\in\mathcal{E}.

Here, we take ω(E,F)\omega(E,F)\in\mathbb{C} to have ω(E,F)r=1\omega(E,F)^{r}=1 for some fixed rr.

Let \mathcal{E} be an error basis on a Hilbert space \mathfrak{H} of dimension qq. Fix any basis {|x}x=1q\{{|{x}\rangle}\}_{x=1}^{q} of \mathfrak{H}. We define the Bell state relative to \mathcal{E} to be |β=1qx|x|x{|{\beta}\rangle}=\frac{1}{\sqrt{q}}\sum_{x}{|{x}\rangle}\otimes{|{x}\rangle}\in\mathfrak{H}\otimes\mathfrak{H}. We have the following result from [9, Lemma VII.1].

Lemma 2.

|ββ|=1q2EEEL(){|{\beta}\rangle}\langle{\beta}|=\frac{1}{q^{2}}\sum_{E\in\mathcal{E}}E\otimes E^{*}\in L(\mathfrak{H}\otimes\mathfrak{H}).

Our goal is to analyze quantum circuits, particularly those used for quantum error correction, and so we focus on the Pauli basis 𝒫q\mathcal{P}_{q} of q\mathbb{C}^{q}, which for q>2q>2 is defined by

𝒫q={XqαZqβ:α,β=0,,q1},\mathcal{P}_{q}=\{X_{q}^{\alpha}Z_{q}^{\beta}\>:\>\alpha,\beta=0,\dots,q-1\}, (1)

where

Xq=x=0q1|x+1(mod q)x| and Zq=x=0q1ζqx|xx|,X_{q}=\sum_{x=0}^{q-1}{|{x+1\>\text{(mod $q$)}}\rangle}\langle{x}|\text{\ and\ }Z_{q}=\sum_{x=0}^{q-1}\zeta_{q}^{x}{|{x}\rangle}\langle{x}|, (2)

with ζq=e2πi/q\zeta_{q}=e^{2\pi i/q}. For q=2q=2 we instead take the usual Pauli operators 𝒫2={I,X,Y,Z}\mathcal{P}_{2}=\{I,X,Y,Z\}. When the local dimension qq is understood or is irrelevant, we drop it from our notation.

As is usual in quantum information, classical information is encoded as diagonal operators. In the case of states, these are density operators; in the case of our error bases, these will be powers of the Pauli ZZ-operator. For a classical system with data {0,,N1}\{0,\dots,N-1\}, we have the Hilbert space N\mathbb{C}^{N} with error bases {ZNα}α=0N1\{Z_{N}^{\alpha}\}_{\alpha=0}^{N-1} with

ZN=(1000ζN000ζNN1),Z_{N}=\begin{pmatrix}1&0&\cdots&0\\ 0&\zeta_{N}&\cdots&0\\ \vdots&\vdots&\ddots&\vdots\\ 0&0&\cdots&\zeta_{N}^{N-1}\end{pmatrix}, (3)

where, as above ζN=e2πi/N\zeta_{N}=e^{2\pi i/N}, and hence α{0,,N1}\alpha\in\{0,\dots,N-1\}:

ZNα=(1000ζNα000ζN(N1)α).Z_{N}^{\alpha}=\begin{pmatrix}1&0&\cdots&0\\ 0&\zeta_{N}^{\alpha}&\cdots&0\\ \vdots&\vdots&\ddots&\vdots\\ 0&0&\cdots&\zeta_{N}^{(N-1)\alpha}\end{pmatrix}. (4)

Systems that consist of multiple subsystems are obtained through the tensor product. For example, given a local system with Hilbert space \mathfrak{H} and error basis \mathcal{E}, a quantum code of length nn will have as its Hilbert space n\mathfrak{H}^{\otimes n}, for which we can take the error basis

n={E1En:E}.\mathcal{E}^{n}=\{E_{1}\otimes\cdots\otimes E_{n}\>:\>E\in\mathcal{E}\}. (5)

We will often be faced with the task of tracking phases introduced by commuting Pauli operators; to unify across local dimensions qq we introduce the notation, which is consistent with its use in Definition 1 for general error bases,

ω(P,Q)=1qTr(PQPQ).\omega(P,Q)=\tfrac{1}{q}\operatorname{Tr}(P^{\dagger}Q^{\dagger}PQ). (6)

In particular ω(P,Q)=1\omega(P,Q)=1 if and only if PP and QQ commute.

Definition 3 (Phase relative to the Pauli error basis).

For a nn-qubit Pauli operator PP, we define its phase relative to the Pauli error basis as μ\mu:

μ(P)={1P𝒫n1P𝒫niiP𝒫niiP𝒫n.\mu(P)=\begin{cases}1&P\in\mathcal{P}^{n}\\ -1&-P\in\mathcal{P}^{n}\\ -i&iP\in\mathcal{P}^{n}\\ i&-iP\in\mathcal{P}^{n}\end{cases}. (7)

Note that this also applies to hybrid quantum/classical systems. For example, when performing nondemolition measurement of a qubit state, the resulting system consist of the post-measurement quantum state and the classical bit obtain from the measurement readout. Hence the Hilbert space is 22\mathbb{C}^{2}\otimes\mathbb{C}^{2} with error basis

{PZα:P{I,X,Y,Z},α{0,1}}.\{P\otimes Z^{\alpha}\>:\>P\in\{I,X,Y,Z\},\ \alpha\in\{0,1\}\}. (8)

All of our examples will be qubit circuits, q=2q=2. In fact, these will mostly be Clifford circuits, built from the Hadamard HH, phase gate SS, and CNOT. But as mentioned in the introduction, the power of our methods will also allow us to treat the π8\frac{\pi}{8}-gate TT, as well as non-unitary operations such as state preparation 𝒮𝒫|ψ\mathcal{SP}_{{|{\psi}\rangle}} and destructive and nondemolition measurement, 𝒟P\mathcal{MD}_{P} and 𝒫P\mathcal{MP}_{P}, with respect to a Pauli operator PP.

Measurement is an example of a general quantum channel. Our notation for a quantum channel is 𝒜:𝔎\mathcal{A}:\mathfrak{H}\leadsto\mathfrak{K}, where it is important to recognize that 𝒜\mathcal{A} is not a function on the Hilbert space itself, but rather on operators on the Hilbert space. Applied on a density operator ρ\rho on \mathfrak{H}, the channel has operator sum, or Choi-Kraus, form

𝒜(ρ)=jAjρAj,\mathcal{A}(\rho)=\sum_{j}A_{j}\rho A_{j}^{\dagger}, (9)

where the Kraus operators {Aj}\{A_{j}\} need not be unique [13, §8.2]. The analysis of error models uses quantum channels; for example the decoherence channel is given by 𝒟(ρ)=P𝒫PρP\mathcal{D}(\rho)=\sum_{P\in\mathcal{P}}P\rho P^{\dagger}, which is closes related to the uniform Pauli error channel

𝒟p(ρ)=(13p4)ρ+p4(XρX+YρY+ZρZ).\mathcal{D}_{p}(\rho)=(1-\tfrac{3p}{4})\rho+\tfrac{p}{4}(X\rho X+Y\rho Y+Z\rho Z). (10)

Our main application is the fault-tolerance analysis of stabilizer codes. We will write \mathfrak{C} for such a code, with its stabilizer denoted as 𝒮=𝒮()=S1,,Snk\mathcal{S}=\mathcal{S}(\mathfrak{C})=\langle S_{1},\cdots,S_{n-k}\rangle where the generators SjS_{j} are assumed independent. As usual we call nn the length and kk the dimension of \mathfrak{C}. The syndrome s=(s1,,snk){±1}nks=(s_{1},\dots,s_{n-k})\in\{\pm 1\}^{n-k}, is the results of projective measurements of the stabilizer generators; for an error operator PP this means sj=ω(P,Sj)s_{j}=\omega(P,S_{j}).

The normalizer of \mathfrak{C} is defined as

𝒩=𝒩()={P𝒫n:ω(P,S)=1 for all S𝒮}.\mathcal{N}=\mathcal{N}(\mathfrak{C})=\{P\in\mathcal{P}^{n}\>:\>\omega(P,S)=1\text{ for all $S\in\mathcal{S}$}\}. (11)

Elements of the 𝒩\mathcal{N} preserve \mathfrak{C}, and so (when not in 𝒮\mathcal{S}) are naturally associated with logical errors. The definition (11) of 𝒩\mathcal{N} can also be viewed as stating that 𝒩\mathcal{N} is the dual to 𝒮\mathcal{S} where “orthogonality” in this context is commutativity. That is 𝒩\mathcal{N} is the set of all the Pauli operators that are orthogonal to 𝒮\mathcal{S} in this sense. While not obvious the converse holds,

𝒮={P𝒫n:ω(P,N)=1 for all N𝒩}.\mathcal{S}=\{P\in\mathcal{P}^{n}\>:\>\omega(P,N)=1\text{ for all $N\in\mathcal{N}$}\}. (12)

In particular, we will often make use of the relations

D𝒮()ω(D,E)={2nkif E𝒩(),0otherwise,\sum_{D\in\mathcal{S}(\mathfrak{C})}\omega(D,E)=\begin{cases}2^{n-k}&\text{if $E\in\mathcal{N}(\mathfrak{C})$,}\\ 0&\text{otherwise,}\end{cases} (13)

and

D𝒩()ω(D,E)={2n+kif E𝒮(),0otherwise.\sum_{D\in\mathcal{N}(\mathfrak{C})}\omega(D,E)=\begin{cases}2^{n+k}&\text{if $E\in\mathcal{S}(\mathfrak{C})$,}\\ 0&\text{otherwise.}\end{cases} (14)
Corollary 4.

Let |ψ(2)n{|{\psi}\rangle}\in(\mathbb{C}^{2})^{\otimes n} be a stabilizer state with stabilizer group 𝒮\mathcal{S}. Each element of 𝒮\mathcal{S} is a Pauli operator, but it need not be in the positive Pauli basis 𝒫n\mathcal{P}^{n} as it might include a nontrivial phase 1-1, ii, or i-i. Yet, we always have I𝒮-I\not\in\mathcal{S} as |ψ{|{\psi}\rangle} is a +1+1 eigenstate for all elements of 𝒮\mathcal{S}. It follows then ±iP𝒮\pm iP\not\in\mathcal{S} for any P𝒫nP\in\mathcal{P}^{n} as otherwise (±iP)2=I𝒮(\pm iP)^{2}=-I\in\mathcal{S}. Hence any element SS of 𝒮\mathcal{S} can only have phase ±1\pm 1 relative to 𝒫n\mathcal{P}^{n}, meaning μ(S){1,1}\mu(S)\in\{1,-1\}.

The quantum weight enumerators [14]

A(z;M1,M2)\displaystyle A(z;M_{1},M_{2}) =P𝒫nTr(PM1)Tr(PM2)zwt(P),\displaystyle=\sum_{P\in\mathcal{P}^{n}}\operatorname{Tr}(PM_{1})\operatorname{Tr}(PM_{2})z^{\mathrm{wt}(P)}, (15)
B(z;M1,M2)\displaystyle B(z;M_{1},M_{2}) =P𝒫nTr(PM1PM2)zwt(P)\displaystyle=\sum_{P\in\mathcal{P}^{n}}\operatorname{Tr}(PM_{1}PM_{2})z^{\mathrm{wt}(P)} (16)

capture information about errors; when M1=M2=ΠM_{1}=M_{2}=\Pi_{\mathfrak{C}}, the orthogonal projection onto \mathfrak{C}, these enumerate the Pauli operators in 𝒮()\mathcal{S}(\mathfrak{C}) and 𝒩()\mathcal{N}(\mathfrak{C}) respectively of each weight.

These weight enumerators AA and BB above are connected by a quantum MacWilliams transform [14]. After homogenizing A(w,z)=wnA(z/w)A(w,z)=w^{n}A(z/w), and similarly for BB, this reads:

B(w,z;M1,M2)=A(w+3z2,wz2;M1,M2).B(w,z;M_{1},M_{2})=A\left(\tfrac{w+3z}{2},\tfrac{w-z}{2};M_{1},M_{2}\right). (17)

This identity has been extended to local dimension q>2q>2 [15], the quantum analogue of the complete enumerator [16, 17], and vector and tensor enumerators over these [9].

In this work, our circuit tensor is related to the total tensor enumerators of [9],

A(z;M1,M2)\displaystyle A(z;M_{1},M_{2}) =P,Q𝒫nTr(PM1)Tr(QM2)eP,Q,\displaystyle=\sum_{P,Q\in\mathcal{P}^{n}}\operatorname{Tr}(PM_{1})\operatorname{Tr}(QM_{2})e_{P,Q}, (18)
B(z;M1,M2)\displaystyle B(z;M_{1},M_{2}) =P,Q𝒫nTr(PM1QM2)eP,Q.\displaystyle=\sum_{P,Q\in\mathcal{P}^{n}}\operatorname{Tr}(PM_{1}QM_{2})e_{P,Q}. (19)

Where eP,Qe_{P,Q} are formal basis elements of the vector space of 4n×4n4^{n}\times 4^{n} matrices indexed by a pair of Pauli operators, which is of dimension 42n4^{2n}. Here we are interested in the operational character of this matrix, so we write these as eQPe^{P}_{Q}.

As a final note, we will occasionally run into the trivial system. For example when preparing a quantum state, the initial system is trivial. The associated Hilbert space of this system is just \mathbb{C}, for which there is only a single error operator 11. We will usually suppress the notation of this Hilbert space and error basis for readability. Namely, for the case of state preparation, we will simply write ePe_{P} instead of eP1e^{1}_{P}.

III Circuit tensor of a linear map

To apply tensor enumerator methods to problems in fault-tolerance we will need to construct circuit tensors for general quantum channels. Nonetheless, we find it instructive to first define and analyze the analogous objects for just a single linear operator. In this section, we define the Choi state [18] and circuit tensor for a linear operator and prove composition laws for these. We also apply this formalism to some key examples such as state preparation and unitary operations.

Let \mathfrak{H} and 𝔎\mathfrak{K} be finite dimensional Hilbert spaces; we write L(,𝔎)L(\mathfrak{H},\mathfrak{K}) for the space of linear operators from \mathfrak{H} to 𝔎\mathfrak{K}.

Definition 5 (Choi state of a linear operator).

Let AL(,𝔎)A\in L(\mathfrak{H},\mathfrak{K}) be any linear operator, \mathcal{E} an error basis on \mathfrak{H}, and β\beta the Bell state of \mathcal{E}. Then the Choi state of AA is

|TA=(IA)|β=1dim()x|xA|x𝔎.{|{T_{A}}\rangle}=(I\otimes A){|{\beta}\rangle}=\tfrac{1}{\sqrt{\dim(\mathfrak{H})}}\sum_{x}{|{x}\rangle}\otimes A{|{x}\rangle}\in\mathfrak{H}\otimes\mathfrak{K}. (20)

Note that the Choi state need not be properly normalized. In particular, TA|TB=1dim()tr(AB){\langle{T_{A}}|{T_{B}}\rangle}=\frac{1}{\dim(\mathfrak{H})}\mathrm{tr}(A^{\dagger}B), and so orthonormality of Choi states is directly related to that of their underlying operators in the trace norm. In particular, a Choi state will be unit length if AA is an isometry.

Example 6 (States and effects).

Let |ψ{|{\psi}\rangle}\in\mathfrak{H} be a pure state. View this as the operation of state preparation: a linear map \mathbb{C}\to\mathfrak{H} given by αα|ψ\alpha\mapsto\alpha{|{\psi}\rangle}. Then under the identification of =\mathbb{C}\otimes\mathfrak{H}=\mathfrak{H}, one has |T|ψ=|ψ{|{T_{{|{\psi}\rangle}}}\rangle}={|{\psi}\rangle}.

Dually, the effect ψ|\langle{\psi}| is a linear map \mathfrak{H}\to\mathbb{C}. Operationally, this is interpreted as post-selection upon measuring |ψ{|{\psi}\rangle}. Then

|Tψ|=1dim()x|xψ|x.{|{T_{\langle{\psi}|}}\rangle}=\tfrac{1}{\sqrt{\mathrm{dim}(\mathfrak{H}})}\sum_{x}{|{x}\rangle}{\langle{\psi}|{x}\rangle}. (21)

The key link to tensor networks throughout what follows is that the composition of operators can be realized through the trace of tensors. This is of course already apparent in matrix-product states, see for example [19]. The following simple, yet central, result can be viewed as just expressing this from the perspective of the Jamiołkowski-Choi duality [20, 21].

Proposition 7 (Choi state for a compositaion of linear operator).

Let AL(,𝔎)A\in L(\mathfrak{H},\mathfrak{K}) and BL(𝔎,𝔏)B\in L(\mathfrak{K},\mathfrak{L}), and |β𝔎𝔎{|{\beta}\rangle}\in\mathfrak{K}\otimes\mathfrak{K} the Bell state. Then

(Iβ|I𝔏)(|TA|TB)=1dim(𝔎)|TBA.(I_{\mathfrak{H}}\otimes\langle{\beta}|\otimes I_{\mathfrak{L}})({|{T_{A}}\rangle}\otimes{|{T_{B}}\rangle})=\tfrac{1}{\dim(\mathfrak{K})}{|{T_{BA}}\rangle}. (22)
Proof.

We compute, albeit with some abuse of notation,

(Iβ|I)(|TA|TB)\displaystyle(I\otimes\langle{\beta}|\otimes I)({|{T_{A}}\rangle}\otimes{|{T_{B}}\rangle})
=dim()0.5dim(𝔎)xxx|2,3(y,z|yA|y|zB|z)\displaystyle=\tfrac{\dim(\mathfrak{H})^{-0.5}}{\dim(\mathfrak{K})}\sum_{x}\bigg{\langle}xx\bigg{|}_{2,3}\left(\sum_{y,z}{|{y}\rangle}\otimes A{|{y}\rangle}\otimes{|{z}\rangle}\otimes B{|{z}\rangle}\right)
=1dim(𝔎)dim()x,y,z|yx|A|yx|zB|z\displaystyle=\tfrac{1}{\dim(\mathfrak{K})\sqrt{\dim(\mathfrak{H})}}\sum_{x,y,z}{|{y}\rangle}\otimes\langle{x}|A{|{y}\rangle}\otimes{\langle{x}|{z}\rangle}\otimes B{|{z}\rangle}
=1dim(𝔎)dim()x,y|yB|xx|A|y\displaystyle=\tfrac{1}{\dim(\mathfrak{K})\sqrt{\dim(\mathfrak{H})}}\sum_{x,y}{|{y}\rangle}\otimes B{|{x}\rangle}\langle{x}|A{|{y}\rangle}
=1dim(𝔎)dim()y|yBA|y=1dim(𝔎)|TBA.\displaystyle=\tfrac{1}{\dim(\mathfrak{K})\sqrt{\dim(\mathfrak{H})}}\sum_{y}{|{y}\rangle}\otimes BA{|{y}\rangle}=\tfrac{1}{\dim(\mathfrak{K})}{|{T_{BA}}\rangle}. (23)

We introduce the circuit tensor of a linear operator by using its Choi state. One can view this object as a matrix representation of the operator using elements of error bases for indices. It has appeared in the literature under various names, for example the “channel representation” (of a unitary) in [22, §2.3].

Definition 8 (Circuit tensor of a linear operator).

Let AL(,𝔎)A\in L(\mathfrak{H},\mathfrak{K}), and let \mathcal{E} and \mathcal{E}^{\prime} be error bases of \mathfrak{H} and 𝔎\mathfrak{K} respectively. The circuit tensor of AA is

C(A)EE=Tr((EE)|TATA|),C({A})^{E}_{E^{\prime}}=\operatorname{Tr}((E^{*}\otimes E^{\prime}){|{T_{A}}\rangle}\langle{T_{A}}|), (24)

where EE\in\mathcal{E} and EE^{\prime}\in\mathcal{E}^{\prime}.

As above if \mathcal{E} and \mathcal{E}^{\prime} are error bases of \mathfrak{H} and 𝔎\mathfrak{K} respectively, we write eEEe^{E}_{E^{\prime}} for the matrix unit of (E,E)(E,E^{\prime}): the dim()2×dim(𝔎)2\dim(\mathfrak{H})^{2}\times\dim(\mathfrak{K})^{2} matrix, indexed by elements of \mathcal{E} and \mathcal{E}^{\prime}, with 11 in its (E,E)(E,E^{\prime})-entry and 0 elsewhere. We can then write the circuit tensor in component-free form:

𝐂(A)=E,ETr((EE)|TATA|)eEE.\mathbf{C}\left({A}\right)=\sum_{E\in\mathcal{E},E^{\prime}\in\mathcal{E}^{\prime}}\operatorname{Tr}((E^{*}\otimes E^{\prime}){|{T_{A}}\rangle}\langle{T_{A}}|)e^{E}_{E^{\prime}}. (25)
Example 9 (State and effects, continued).

In Example 6 above, we saw the Choi state associated with preparing or post-selected on a state is essentially that state itself. The domain of state preparation is \mathbb{C} whose only error basis is {1}\{1\}. The circuit tensor of state preparation then has only a single row, and so we suppress the use of 11 as its index. That is:

C(|ψ)E=Tr(E|T|ψT|ψ|)=ψ|E|ψ.C({{|{\psi}\rangle}})_{E}=\operatorname{Tr}(E{|{T_{{|{\psi}\rangle}}}\rangle}\langle{T_{{|{\psi}\rangle}}}|)=\langle{\psi}|E{|{\psi}\rangle}. (26)

In particular, state preparation of qubit state |ψ{|{\psi}\rangle} in the Pauli error basis has the circuit tensor

𝐂(|ψ)=eI+ψ|X|ψeX+ψ|Y|ψeY+ψ|Z|ψeZ.\mathbf{C}\left({{|{\psi}\rangle}}\right)=e_{I}+\langle{\psi}|X{|{\psi}\rangle}e_{X}+\langle{\psi}|Y{|{\psi}\rangle}e_{Y}+\langle{\psi}|Z{|{\psi}\rangle}e_{Z}. (27)

Preparation of Pauli eigenstates then have the circuit tensors

𝐂(|+)=eI+eX,𝐂(|)=eIeX,𝐂(|+i)=eI+eY,𝐂(|i)=eIeY,𝐂(|0)=eI+eZ,𝐂(|1)=eIeZ.\begin{array}[]{r@{\:}c@{\:}lr@{\:}c@{\:}l}\mathbf{C}\left({{|{+}\rangle}}\right)\>&=\hfil\>&e_{I}+e_{X},&\mathbf{C}\left({{|{-}\rangle}}\right)\>&=\hfil\>&e_{I}-e_{X},\\ \mathbf{C}\left({{|{+i}\rangle}}\right)\>&=\hfil\>&e_{I}+e_{Y},&\mathbf{C}\left({{|{-i}\rangle}}\right)\>&=\hfil\>&e_{I}-e_{Y},\\ \mathbf{C}\left({{|{0}\rangle}}\right)\>&=\hfil\>&e_{I}+e_{Z},&\mathbf{C}\left({{|{1}\rangle}}\right)\>&=\hfil\>&e_{I}-e_{Z}.\end{array} (28)

Dually, the range of post-selection on |ψ{|{\psi}\rangle} is \mathbb{C}, and so its circuit tensor has only a single column:

C(ψ|)E=Tr(E|Tψ|Tψ||)\displaystyle C({\langle{\psi}|})^{E}=\operatorname{Tr}(E^{*}{|{T_{\langle{\psi}|}}\rangle}\langle{T_{\langle{\psi}|}}|)
=1dimxyy|ψy|E|xψ|x\displaystyle\quad=\tfrac{1}{\dim{\mathfrak{H}}}\sum_{xy}{\langle{y}|{\psi}\rangle}\langle{y}|E^{*}{|{x}\rangle}{\langle{\psi}|{x}\rangle}
=1dimxyψ|xx|E|yy|ψ=1dimψ|E|ψ.\displaystyle\quad=\tfrac{1}{\dim{\mathfrak{H}}}\sum_{xy}{\langle{\psi}|{x}\rangle}\langle{x}|E{|{y}\rangle}{\langle{y}|{\psi}\rangle}=\tfrac{1}{\dim{\mathfrak{H}}}\langle{\psi}|E{|{\psi}\rangle}. (29)

And so for a qubit effect in the Pauli basis

𝐂(ψ|)=12(eI+ψ|X|ψeX+ψ|Y|ψeY+ψ|Z|ψeZ).\begin{split}&\mathbf{C}\left({\langle{\psi}|}\right)\\ &\quad=\frac{1}{2}\left(e^{I}+\langle{\psi}|X{|{\psi}\rangle}e^{X}+\langle{\psi}|Y{|{\psi}\rangle}e^{Y}+\langle{\psi}|Z{|{\psi}\rangle}e^{Z}\right).\end{split} (30)
Example 10 (Circuit tensor of a Bell state).

Preparation of the Bell state |β=12(|00+|11){|{\beta}\rangle}=\frac{1}{\sqrt{2}}({|{00}\rangle}+{|{11}\rangle}) has the circuit tensor

𝐂(|β)=eII+eXXeYY+eZZ.\mathbf{C}\left({{|{\beta}\rangle}}\right)=e_{II}+e_{XX}-e_{YY}+e_{ZZ}. (31)

Both of the previous two examples illustrate the circuit tensors of stabilizer states and indicate a link between the tensors and the stabilizers associated with the state. In generality, let |ψ(2)n{|{\psi}\rangle}\in(\mathbb{C}^{2})^{\otimes n} be an nn-qubit stabilizer state with stabilizer group 𝒮\mathcal{S}. As in Corollary 4, we have μ:𝒮{+1,1}\mu:\mathcal{S}\to\{+1,-1\} so that for each S𝒮S\in\mathcal{S} we have μ(S)S𝒫n\mu(S)S\in\mathcal{P}^{n}. Thus by writing |ψψ|=12nS𝒮S{|{\psi}\rangle}\langle{\psi}|=\frac{1}{2^{n}}\sum_{S\in\mathcal{S}}S, the circuit tensor for preparing |ψ{|{\psi}\rangle} is

C(|ψ)E\displaystyle C({{|{\psi}\rangle}})_{E} =Tr(E|ψψ|)=12nS𝒮Tr(ES)\displaystyle=\operatorname{Tr}(E{|{\psi}\rangle}\langle{\psi}|)=\frac{1}{2^{n}}\sum_{S\in\mathcal{S}}\operatorname{Tr}(ES)
={μ(E)if E𝒮,0otherwise,\displaystyle=\begin{cases}\mu(E)&\text{if $E\in\mathcal{S}$,}\\ 0&\text{otherwise,}\end{cases} (32)

as all nonidentity Pauli operators have trace zero. Therefore we have proven the following result:

Proposition 11 (Circuit tensor of a stabilizer state).

Let |ψ(2)n{|{\psi}\rangle}\in(\mathbb{C}^{2})^{\otimes n} be a stabilizer state with stabilizer group 𝒮\mathcal{S}, and μ:𝒮{+1,1}\mu:\mathcal{S}\to\{+1,-1\} be the phase relative to the Pauli basis, see Corollary 4. Then

𝐂(|ψ)=S𝒮μ(S)eS.\mathbf{C}\left({{|{\psi}\rangle}}\right)=\sum_{S\in\mathcal{S}}\mu(S)e_{S}. (33)

For a general linear operator AL(,𝔎)A\in L(\mathfrak{H},\mathfrak{K}), we can expand its circuit tensor as follows.

C(A)EE=TA|EE|TA\displaystyle C({A})^{E}_{E^{\prime}}=\langle{T_{A}}|E^{*}\otimes E^{\prime}{|{T_{A}}\rangle}
=1dim()xy(x|x|A)(EE)(|yA|y)\displaystyle\quad=\tfrac{1}{\dim(\mathfrak{H})}\sum_{xy}(\langle{x}|\otimes\langle{x}|A^{\dagger})(E^{*}\otimes E^{\prime})({|{y}\rangle}\otimes A{|{y}\rangle})
=1dim()xyx|E|yx|AEA|y\displaystyle\quad=\tfrac{1}{\dim(\mathfrak{H})}\sum_{xy}\langle{x}|E^{*}{|{y}\rangle}\langle{x}|A^{\dagger}E^{\prime}A{|{y}\rangle}
=1dim()xyy|E|xx|AEA|y\displaystyle\quad=\tfrac{1}{\dim(\mathfrak{H})}\sum_{xy}\langle{y}|E^{\dagger}{|{x}\rangle}\langle{x}|A^{\dagger}E^{\prime}A{|{y}\rangle}
=1dim()Tr(EAEA).\displaystyle\quad=\tfrac{1}{\dim(\mathfrak{H})}\operatorname{Tr}(E^{\dagger}A^{\dagger}E^{\prime}A). (34)

So, except for a different normalization, the circuit tensor has precisely the same form as the B\mathrm{B}-tensor enumerator of [9]. In that work however, the B\mathrm{B}-tensor enumerator is only defined for Hermitian operators; here we see the circuit tensor is the natural generalization to any linear map AA.

In Proposition 7 above, The composition of operators had a simple, yet slightly awkward, representation in terms of Choi states. However, this becomes entirely natural in the language of circuit tensors. From (III) we see that

𝐂(I)=EeEE,\mathbf{C}\left({I}\right)=\sum_{E\in\mathcal{E}}e^{E}_{E}, (35)

and hence the circuit tensor of the identity operator is the identity matrix. Moreover, the circuit tensor is multiplicative, albeit order-reversing, as shown by the following result.

Theorem 12 (Composition of circuit tensors).

For AL(,𝔎)A\in L(\mathfrak{H},\mathfrak{K}) and BL(𝔎,𝔏)B\in L(\mathfrak{K},\mathfrak{L}), we have 𝐂(BA)=𝐂(A)𝐂(B)\mathbf{C}\left({BA}\right)=\mathbf{C}\left({A}\right)\mathbf{C}\left({B}\right). That is,

C(BA)EE=FC(A)FEC(B)EF.C({BA})^{E}_{E^{\prime}}=\sum_{F}C({A})^{E}_{F}\>C({B})^{F}_{E^{\prime}}. (36)
Proof.

We simply compute, using Proposition 7 above:

FC(A)FEC(B)EF\displaystyle\sum_{F}C({A})^{E}_{F}\ C({B})^{F}_{E^{\prime}}
=FTr((EF)|TATA|)Tr((FE)|TBTB|)\displaystyle=\sum_{F}\operatorname{Tr}((E^{*}\otimes F){|{T_{A}}\rangle}\langle{T_{A}}|)\operatorname{Tr}((F^{*}\otimes E^{\prime}){|{T_{B}}\rangle}\langle{T_{B}}|)
=FTr((EFFE)(|TA|TB)(TA|TB|))\displaystyle=\sum_{F}\operatorname{Tr}((E^{*}\otimes F\otimes F^{*}\otimes E^{\prime})({|{T_{A}}\rangle}\otimes{|{T_{B}}\rangle})(\langle{T_{A}}|\otimes\langle{T_{B}}|))
=dim(𝔎)2Tr((E|ββ|E)\displaystyle=\dim(\mathfrak{K})^{2}\operatorname{Tr}((E^{*}\otimes{|{\beta}\rangle}\langle{\beta}|\otimes E^{\prime})
(|TA|TB)(TA|TB|))\displaystyle~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}~{}({|{T_{A}}\rangle}\otimes{|{T_{B}}\rangle})(\langle{T_{A}}|\otimes\langle{T_{B}}|))
=Tr((EE)|TBATBA|)=C(BA)EE,\displaystyle=\operatorname{Tr}((E^{*}\otimes E^{\prime}){|{T_{BA}}\rangle}\langle{T_{BA}}|)=C({BA})^{E}_{E^{\prime}}, (37)

where we have also used |ββ|=1dim2FFF{|{\beta}\rangle}\langle{\beta}|=\frac{1}{\dim^{2}}\sum_{F}F\otimes F^{*}. ∎

Example 13 (Circuit tensor of Pauli operators).

Any Pauli group has PQ=ω(P,Q)QPPQ=\omega(P,Q)QP. So Pauli operators have diagonal circuit tensors:

𝐂(P)\displaystyle\mathbf{C}\left({P}\right) =1dim()Q,Q𝒫nTr(QPQP)eQQ\displaystyle=\frac{1}{\dim(\mathfrak{H})}\sum_{Q,Q^{\prime}\in\mathcal{P}^{n}}\operatorname{Tr}(Q^{\dagger}P^{\dagger}Q^{\prime}P)e^{Q}_{Q^{\prime}}
=Q𝒫nω(Q,P)eQQ.\displaystyle=\sum_{Q\in\mathcal{P}^{n}}\omega(Q,P)e^{Q}_{Q}. (38)

In particular, for the single qubit Pauli operators:

𝐂(X)\displaystyle\mathbf{C}\left({X}\right) =eII+eXXeYYeZZ\displaystyle=e^{I}_{I}+e^{X}_{X}-e^{Y}_{Y}-e^{Z}_{Z} (39)
𝐂(Y)\displaystyle\mathbf{C}\left({Y}\right) =eIIeXX+eYYeZZ\displaystyle=e^{I}_{I}-e^{X}_{X}+e^{Y}_{Y}-e^{Z}_{Z} (40)
𝐂(Z)\displaystyle\mathbf{C}\left({Z}\right) =eIIeXXeYY+eZZ.\displaystyle=e^{I}_{I}-e^{X}_{X}-e^{Y}_{Y}+e^{Z}_{Z}. (41)

Examining equations (39,40,41), we see that the circuit tensor behaves similarly to how each of these operators acts on the Bloch sphere. For example, on the Bloch sphere, the action of XX is a π\pi-rotation about the xx-axis, which is precisely (39) except for the eIIe^{I}_{I} term.

Let us recall how the Bloch-sphere representation is constructed. Ordinarily, we would use the Pauli basis, but any error basis \mathcal{E} of a Hilbert space \mathfrak{H} suffices. Suppose we are given a unitary operator U𝒰()U\in\mathcal{U}(\mathfrak{H}). For each EE^{\prime}\in\mathcal{E} we conjugate by UU to get an operator UEUU^{\dagger}E^{\prime}U. We then expand this operator as a linear combination of operators in our error basis

UEU=EcEEE.U^{\dagger}E^{\prime}U=\sum_{E\in\mathcal{E}}c^{E}_{E^{\prime}}E. (42)

This defines a matrix cEE=cEE(U)c^{E}_{E^{\prime}}=c^{E}_{E^{\prime}}(U) which is our Bloch-sphere representation of UU.

Now, from (III) above we have

C(U)EE\displaystyle C({U})^{E}_{E^{\prime}} =1dim()Tr(EUEU)\displaystyle=\tfrac{1}{\dim(\mathfrak{H})}\operatorname{Tr}(E^{\dagger}U^{\dagger}E^{\prime}U)
=1dim()FcEFTr(EF)=cEE.\displaystyle=\tfrac{1}{\dim(\mathfrak{H})}\sum_{F\in\mathcal{E}}c^{F}_{E^{\prime}}\operatorname{Tr}(E^{\dagger}F)=c^{E}_{E^{\prime}}. (43)

Therefore the circuit tensor of a unitary operator is precisely its Bloch-sphere representation as defined above.

While II\in\mathcal{E}, we would not normally include this when building the Bloch-sphere representation of UU. Indeed II is exceptional in the construction, as can be seen in the following lemma.

Lemma 14.

For any unitary UU the coefficient cIEc^{E}_{I} in (42) equals 11 for E=IE=I and 0 for any E{X,Y,Z}E\in\{X,Y,Z\}.

Proof.

When setting E=IE^{\prime}=I in (43) we have:

cIE=1dim()Tr(EUIU)=1dim()Tr(E)={1E=I,0E{X,Y,Z}.\begin{split}c^{E}_{I}&=\tfrac{1}{\dim(\mathfrak{H})}\operatorname{Tr}(E^{\dagger}U^{\dagger}IU)\\ &=\tfrac{1}{\dim(\mathfrak{H})}\operatorname{Tr}(E^{\dagger})=\begin{cases}1&E=I,\\ 0&E\in\{X,Y,Z\}.\end{cases}\end{split} (44)

Therefore the circuit tensor of a unitary operator decomposes as 𝐂(U)=eII+E,EIcEEeEE\mathbf{C}\left({U}\right)=e^{I}_{I}+\sum_{E,E^{\prime}\not=I}c^{E}_{E^{\prime}}e^{E}_{E^{\prime}}, and it is only the second term we ordinarily call the Bloch-sphere representation of UU.

Example 15 (Circuit tensor of Clifford operators).

Clifford operators normalize the Pauli group, thus for any nn qubit Clifford GG and Pauli P𝒫nP\in\mathcal{P}^{n} we know that GPGGPG^{\dagger} is a Pauli operator, and hence in 𝒫n\mathcal{P}^{n} up to a phase. We can also write it as GP1𝒫nP2𝒫nGP1=μ(GP1G)P2G\forall_{G}\forall_{P_{1}\in\mathcal{P}^{n}}\exists_{P_{2}\in\mathcal{P}^{n}}GP_{1}=\mu(GP_{1}G^{\dagger})P_{2}G, see Defenitation 3. This relation leads the Clifford operators to have a signed permutation circuit tensor:

𝐂(G)=P𝒫nμ(GPG)e±GPGP\mathbf{C}\left({G}\right)=\sum_{P\in\mathcal{P}^{n}}\mu(GPG^{\dagger})e^{P}_{\pm GPG^{\dagger}} (45)

In particular, for the Hadamard gate we have [13, 4.18]:

HZ=XH,HX=ZH,HY=YH.\begin{array}[]{ccc}HZ=XH,&HX=ZH,&HY=-YH.\end{array} (46)

Hence it follows that

𝐂(H)=eII+eZX+eXZeYY.\mathbf{C}\left({H}\right)=e^{I}_{I}+e^{X}_{Z}+e^{Z}_{X}-e^{Y}_{Y}. (47)

The case is similar for the SS gate, and some combinations of it with the Hadammard gate. We leave the following computations to the reader:

𝐂(S)\displaystyle\mathbf{C}\left({S}\right) =eII+eYX+eZZeXY,\displaystyle=e^{I}_{I}+e^{X}_{Y}+e^{Z}_{Z}-e^{Y}_{X}, (48)
𝐂(S)\displaystyle\mathbf{C}\left({S^{\dagger}}\right) =eIIeYX+eZZ+eXY,\displaystyle=e^{I}_{I}-e^{X}_{Y}+e^{Z}_{Z}+e^{Y}_{X}, (49)
𝐂(SH)\displaystyle\mathbf{C}\left({S\circ H}\right) =eII+eZX+eYZ+eXY,\displaystyle=e^{I}_{I}+e^{X}_{Z}+e^{Z}_{Y}+e^{Y}_{X}, (50)
𝐂(HS)\displaystyle\mathbf{C}\left({H\circ S^{\dagger}}\right) =eII+eYX+eXZ+eZY.\displaystyle=e^{I}_{I}+e^{X}_{Y}+e^{Z}_{X}+e^{Y}_{Z}. (51)
Example 16 (Circuit tensor of CNOT).

To calculate the circuit tensor for the CNOT gate, denoted CXCX, we will look at how each error in our error basis applied to any of the input legs can be commuted to the other side of the CNOT, similarly to what was done in Example 15. We can use the CNOT commutation rules found in [23, Table 1], and expand them to include also YY. A circuit representation of the commutation rules can be seen in Fig. 1, and their mathematical representation is:

CX(IX)\displaystyle CX(I\otimes X) =(IX)CX\displaystyle=(I\otimes X)CX (52)
CX(ZI)\displaystyle CX(Z\otimes I) =(ZI)CX\displaystyle=(Z\otimes I)CX (53)
CX(IZ)\displaystyle CX(I\otimes Z) =(ZZ)CX\displaystyle=(Z\otimes Z)CX (54)
CX(YI)\displaystyle CX(Y\otimes I) =(YX)CX\displaystyle=(Y\otimes X)CX (55)
CX(IY)\displaystyle CX(I\otimes Y) =(ZY)CX\displaystyle=(Z\otimes Y)CX (56)
Refer to caption
Refer to caption
Refer to caption
Figure 1: Commutation rules between Paulis and CNOT

Using rules on Fig. 1 we can construct the full circuit tensor for the CNOT gate:

𝐂(CX)\displaystyle\mathbf{C}\left({CX}\right) =eIIII+eIXIX+eZYIY+eZZIZ\displaystyle=e^{I\otimes I}_{I\otimes I}+e^{I\otimes X}_{I\otimes X}+e^{I\otimes Y}_{Z\otimes Y}+e^{I\otimes Z}_{Z\otimes Z}
+eXXXI+eXIXX+eYZXYeYYXZ\displaystyle+e^{X\otimes I}_{X\otimes X}+e^{X\otimes X}_{X\otimes I}+e^{X\otimes Y}_{Y\otimes Z}-e^{X\otimes Z}_{Y\otimes Y}
+eYXYI+eYIYXeXZYY+eXYYZ\displaystyle+e^{Y\otimes I}_{Y\otimes X}+e^{Y\otimes X}_{Y\otimes I}-e^{Y\otimes Y}_{X\otimes Z}+e^{Y\otimes Z}_{X\otimes Y}
+eZIZI+eZXZX+eIYZY+eIZZZ\displaystyle+e^{Z\otimes I}_{Z\otimes I}+e^{Z\otimes X}_{Z\otimes X}+e^{Z\otimes Y}_{I\otimes Y}+e^{Z\otimes Z}_{I\otimes Z} (57)
Example 17 (Circuit tensor of TT).

It is straightforward to compute that TXT=12(X+Y)TXT^{\dagger}=\frac{1}{\sqrt{2}}(X+Y), TYT=12(YX)TYT^{\dagger}=\frac{1}{\sqrt{2}}(Y-X), and TZT=ZTZT^{\dagger}=Z. Therefore we can directly use (42) and (43) to write out the circuit tensor for the TT gate:

𝐂(T)=eII+eZZ+12(eXX+eYXeXY+eYY)\mathbf{C}\left({T}\right)=e^{I}_{I}+e^{Z}_{Z}+\frac{1}{\sqrt{2}}(e^{X}_{X}+e^{X}_{Y}-e^{Y}_{X}+e^{Y}_{Y}) (58)

In the above, we have focussed on the circuit tensor for quantum operations. Nonetheless, we can also compute circuit tensors for classical operations.

Proposition 18 (Choi state and circuit tensor of a classical function).

For any classical function f:{0,,N1}{0,,M1}f:\{0,\dots,N-1\}\to\{0,\dots,M-1\} define the operator

Af=x=0N1|f(x)x|L(N,M).A_{f}=\sum_{x=0}^{N-1}{|{f(x)}\rangle}\langle{x}|\in L(\mathbb{C}^{N},\mathbb{C}^{M}). (59)

The Choi state of this operator, which for simplicity we denote |Tf{|{T_{f}}\rangle}, is

|Tf=1Nx=0N1|xAf|x=1Nx=0N1|x|f(x),{|{T_{f}}\rangle}=\frac{1}{\sqrt{N}}\sum_{x=0}^{N-1}{|{x}\rangle}\otimes A_{f}{|{x}\rangle}=\frac{1}{\sqrt{N}}\sum_{x=0}^{N-1}{|{x}\rangle}\otimes{|{f(x)}\rangle}, (60)

and its circuit tensor, similarly with notation C(f)C({f}) , is

C(f)ZMβZNα=Tr[(ZNαZMβ)|TfTf|]=1Nx=0N1ζNαxζMβf(x),\begin{split}C({f})^{Z_{N}^{\alpha}}_{Z_{M}^{\beta}}&=\operatorname{Tr}\left[(Z_{N}^{-\alpha}\otimes Z_{M}^{\beta}){|{T_{f}}\rangle}\langle{T_{f}}|\right]\\ &=\frac{1}{N}\sum_{x=0}^{N-1}\zeta_{N}^{-\alpha x}\zeta_{M}^{\beta f(x)},\end{split} (61)

where ζN=e2πiN\zeta_{N}=e^{\tfrac{2\pi i}{N}} is the canonical NN-th root-of-unity.

Proof.
Tr[(ZNαZMβ)|TfTf|]=Tr[Tf|(ZNαZMβ)|Tf]=Tf|(ZNαZMβ)|Tf=1Nx=0N1[x|f(x)|][ZNαZMβ][y=0N1|y|f(y)]=1Nx=0N1y=0M1[x|ZNα|y][f(x)|ZMβ|f(y)]=1Nx=0N1y=0M1[x|ZNα|y][f(x)|ZMβ|f(y)]=1Nx=0N1[x|ZNα|x][f(x)|ZMβ|f(x)]=1Nx=0N1ζNαxζMβf(x)\begin{split}&\operatorname{Tr}\left[(Z_{N}^{-\alpha}\otimes Z_{M}^{\beta}){|{T_{f}}\rangle}\langle{T_{f}}|\right]=\operatorname{Tr}\left[\langle{T_{f}}|(Z_{N}^{-\alpha}\otimes Z_{M}^{\beta}){|{T_{f}}\rangle}\right]\\ &\quad=\langle{T_{f}}|(Z_{N}^{-\alpha}\otimes Z_{M}^{\beta}){|{T_{f}}\rangle}\\ &\quad=\frac{1}{N}\sum_{x=0}^{N-1}\left[\langle{x}|\otimes\langle{f(x)}|\right]\left[Z_{N}^{-\alpha}\otimes Z_{M}^{\beta}\right]\left[\sum_{y=0}^{N-1}{|{y}\rangle}\otimes{|{f(y)}\rangle}\right]\\ &\quad=\frac{1}{N}\sum_{x=0}^{N-1}\sum_{y=0}^{M-1}\left[\langle{x}|Z_{N}^{-\alpha}{|{y}\rangle}\right]\otimes\left[\langle{f(x)}|Z_{M}^{\beta}{|{f(y)}\rangle}\right]\\ &\quad=\frac{1}{N}\sum_{x=0}^{N-1}\sum_{y=0}^{M-1}\left[\langle{x}|Z_{N}^{-\alpha}{|{y}\rangle}\right]\cdot\left[\langle{f(x)}|Z_{M}^{\beta}{|{f(y)}\rangle}\right]\\ &\quad=\frac{1}{N}\sum_{x=0}^{N-1}\left[\langle{x}|Z_{N}^{-\alpha}{|{x}\rangle}\right]\cdot\left[\langle{f(x)}|Z_{M}^{\beta}{|{f(x)}\rangle}\right]\\ &\quad=\frac{1}{N}\sum_{x=0}^{N-1}\zeta_{N}^{-\alpha x}\zeta_{M}^{\beta f(x)}\end{split} (62)

Above we used the trace cyclic property, distributivity of the tensor product, and that ZNαZ_{N}^{-\alpha} is a diagonal matrix (4). ∎

Example 19 (Circuit tensor for classical identity and not).

To find the circuit tensor for the classical identity (IclassicalI_{classical}) and not(XclassicalX_{classical}), we will directly use Proposition 18. Using both NN and MM equal to 2, we have ζN=ζM=1\zeta_{N}=\zeta_{M}=-1:

C(Iclassical)ZβZα=12x=01(1)αx+βx={1if α=β,0otherwise.\begin{split}C({I_{classical}})^{Z^{\alpha}}_{Z^{\beta}}&=\tfrac{1}{2}\sum_{x=0}^{1}(-1)^{-\alpha x+\beta x}\\ &=\begin{cases}1&\text{if~{}}\alpha=\beta,\\ 0&otherwise.\end{cases}\end{split} (63)
𝐂(Iclassical)=eII+eZZ\mathbf{C}\left({I_{classical}}\right)=e^{I}_{I}+e^{Z}_{Z} (64)
C(Xclassical)ZβZα=12x=01(1)αx+β(1x)={(1)αif α=β,0otherwise.\begin{split}C({X_{classical}})^{Z^{\alpha}}_{Z^{\beta}}&=\tfrac{1}{2}\sum_{x=0}^{1}(-1)^{-\alpha x+\beta(1-x)}\\ &=\begin{cases}(-1)^{\alpha}&\text{if~{}}\alpha=\beta,\\ 0&otherwise.\end{cases}\end{split} (65)
𝐂(Xclassical)=eIIeZZ\mathbf{C}\left({X_{classical}}\right)=e^{I}_{I}-e^{Z}_{Z} (66)
Proposition 20 (Circut tensor for a multi-input multi-output classical function).

For every classical function that has nn inputs and mm outputs f:{{0,,Ni1}}i=1n{{0,,Mj1}}j=1mf:\left\{\{0,\dots,N_{i}-1\}\right\}_{i=1}^{n}\to\left\{\{0,\dots,M_{j}-1\}\right\}_{j=1}^{m}, its circuit tensor is:

C(f)j=1mZMjβji=1nZNiαi\displaystyle C({f})^{\otimes_{i=1}^{n}Z_{N_{i}}^{\alpha_{i}}}_{\otimes_{j=1}^{m}Z_{M_{j}}^{\beta_{j}}}
=1i=1nNi𝐱=(x1,,xn)i=1nζNiαixij=1mζMjβjf(j)(𝐱).\displaystyle\qquad=\frac{1}{\prod_{i=1}^{n}N_{i}}\sum_{\mathbf{x}=(x_{1},\dots,x_{n})}\prod_{i=1}^{n}\zeta_{N_{i}}^{-\alpha_{i}x_{i}}\prod_{j=1}^{m}\zeta_{M_{j}}^{\beta_{j}f_{(j)}(\mathbf{x})}. (67)

Above we used f(j)(𝐱)f_{(j)}(\mathbf{x}) as the jj-th output of function f.

The proof follows the same lines as the proof of Proposition 18, we leave the details for the reader.

We finish this section with a circuit tensor construction for the xor function. Examples of other primitive boolean operations that commonly appear in quantum fault-tolerance circuits can be found in Appenndix B.

Example 21 (Xor circuit tensor).

The operator for xor of two bits is:

Axor=x0,x1|x0x1x0,x1|L((2)2,2).A_{xor}=\sum_{x_{0},x_{1}}{|{x_{0}\oplus x_{1}}\rangle}\langle{x_{0},x_{1}}|\in L((\mathbb{C}^{2})^{\otimes 2},\mathbb{C}^{2}). (68)

Using the circuit tensor definition in Proposition 20 we get:

C(𝚡𝚘𝚛)ZβZα0Zα1\displaystyle C({\mathtt{xor}})^{Z^{\alpha_{0}}\otimes Z^{\alpha_{1}}}_{Z^{\beta}} =14x0,x1(1)α0x0α1x1+β(x0x1)\displaystyle=\tfrac{1}{4}\sum_{x_{0},x_{1}}(-1)^{-\alpha_{0}x_{0}-\alpha_{1}x_{1}+\beta(x_{0}\oplus x_{1})}
={1 if α0=α1=β,0otherwise.\displaystyle=\begin{cases}1&\text{ if $\alpha_{0}=\alpha_{1}=\beta$,}\\ 0&\text{otherwise.}\end{cases} (69)

Or using a tensor basis

𝐂(𝚡𝚘𝚛)=eIII+eZZZ.\mathbf{C}\left({\mathtt{xor}}\right)=e^{I\otimes I}_{I}+e^{Z\otimes Z}_{Z}. (70)

IV Circuit tensor of a quantum channel

In this section, we extend the results of the previous section to quantum channels. The linear operator in Section III is replaced by a Kraus operator of the quantum channel, from which we build the Choi matrix (generalizing the Choi state) and the circuit tensor. Note that while the selection of Kraus operators for a channel is not unique, the Choi matrix and circuit tensor we form from them will be. The composition laws for Choi matrices and circuit tensors for channels are analogous to those of a single linear operator. We also provided detailed examples of projective and destructive measurements viewed as a quantum channel.

Definition 22 (Choi matrix of a quantum channel).

Let 𝒜:𝔎\mathcal{A}:\mathfrak{H}\leadsto\mathfrak{K} be a quantum channel, and {Aj}L(,𝔎)\{A_{j}\}\subset L(\mathfrak{H},\mathfrak{K}) a set of Kraus operators for this channel. Then the Choi matrix of 𝒜\mathcal{A} is T𝒜=j|TAjTAj|T_{\mathcal{A}}=\sum_{j}{|{T_{A_{j}}}\rangle}\langle{T_{A_{j}}}|.

As the Kraus operators of a channel are not uniquely defined, it is not clear that the Choi matrix as defined is unique. Nonetheless, if as in the previous section we write each |TAj=x|xAj|x{|{T_{A_{j}}}\rangle}=\sum_{x}{|{x}\rangle}\otimes A_{j}{|{x}\rangle} for some orthonormal basis {|x}\{{|{x}\rangle}\} of \mathfrak{H}, we find

T𝒜\displaystyle T_{\mathcal{A}} =j(x|xAj|x)(yy|y|Aj)\displaystyle=\sum_{j}\left(\sum_{x}{|{x}\rangle}\otimes A_{j}{|{x}\rangle}\right)\left(\sum_{y}\langle{y}|\otimes\langle{y}|A_{j}^{\dagger}\right)
=jx,y|xy|Aj|xy|Aj\displaystyle=\sum_{j}\sum_{x,y}{|{x}\rangle}\langle{y}|\otimes A_{j}{|{x}\rangle}\langle{y}|A_{j}^{\dagger}
=x,y|xy|(|xy|),\displaystyle=\sum_{x,y}{|{x}\rangle}\langle{y}|\otimes\mathcal{M}({|{x}\rangle}\langle{y}|), (71)

and our Choi matrix coincides with the original formulation [24], and so is independent of the choice of Kraus operators.

Proposition 23 (Choi matrix for composition of quantum channels).

Let 𝒜:𝔎\mathcal{A}:\mathfrak{H}\leadsto\mathfrak{K} and :𝔎𝔏\mathcal{B}:\mathfrak{K}\leadsto\mathfrak{L} be quantum channels. Then

(Iβ|I𝔏)(T𝒜T)(I|βI𝔏)\displaystyle(I_{\mathfrak{H}}\otimes\langle{\beta}|\otimes I_{\mathfrak{L}})(T_{\mathcal{A}}\otimes T_{\mathcal{B}})(I_{\mathfrak{H}}\otimes{|{\beta}\rangle}\otimes I_{\mathfrak{L}})
=1dim(𝔎)2T𝒜\displaystyle\qquad=\tfrac{1}{\dim(\mathfrak{K})^{2}}T_{\mathcal{B}\circ\mathcal{A}} (72)
Proof.

Let {Aj}L(,𝔎)\{A_{j}\}\subset L(\mathfrak{H},\mathfrak{K}) and {Bk}L(𝔎,𝔏)\{B_{k}\}\subset L(\mathfrak{K},\mathfrak{L}) be Kraus operators for 𝒜\mathcal{A} and \mathcal{B} respectively. Then {BkAj}\{B_{k}A_{j}\} is a set of Kraus operators for 𝒜\mathcal{B}\circ\mathcal{A}, albeit not generally of minimal size. Nonetheless, from Proposition 7

(Iβ|I𝔏)(|TAj|TBk)=1dim(𝔎)|TBkAj,(I_{\mathfrak{H}}\otimes\langle{\beta}|\otimes I_{\mathfrak{L}})({|{T_{A_{j}}}\rangle}\otimes{|{T_{B_{k}}}\rangle})=\tfrac{1}{\dim(\mathfrak{K})}{|{T_{B_{k}A_{j}}}\rangle}, (73)

and hence

1dim(𝔎)2T𝒜=j,k|TBkAjTBkAj|\displaystyle\tfrac{1}{\dim(\mathfrak{K})^{2}}T_{\mathcal{B}\circ\mathcal{A}}=\sum_{j,k}{|{T_{B_{k}A_{j}}}\rangle}\langle{T_{B_{k}A_{j}}}|
=(Iβ|I𝔏)(T𝒜T)(I|βI𝔏).\displaystyle\quad=(I_{\mathfrak{H}}\otimes\langle{\beta}|\otimes I_{\mathfrak{L}})(T_{\mathcal{A}}\otimes T_{\mathcal{B}})(I_{\mathfrak{H}}\otimes{|{\beta}\rangle}\otimes I_{\mathfrak{L}}). (74)

The circuit tensor of a linear map was formed from the projector onto its Choi state, and hence the extension of circuit tensors to general quantum channels is natural.

Definition 24 (Circuit tensor of a quantum channel).

Let ,𝔎\mathfrak{H},\mathfrak{K} be Hilbert spaces with error bases ,\mathcal{E},\mathcal{E}^{\prime} respectively, and let 𝒜:𝔎\mathcal{A}:\mathfrak{H}\leadsto\mathfrak{K} be a quantum channel. Then the circuit tensor of 𝒜\mathcal{A} is C(𝒜)EE=Tr((EE)T𝒜)C({\mathcal{A}})^{E}_{E^{\prime}}=\operatorname{Tr}((E^{*}\otimes E^{\prime})T_{\mathcal{A}}) where EE\in\mathcal{E}, EE^{\prime}\in\mathcal{E}^{\prime}, and T𝒜T_{\mathcal{A}} is the Choi matrix of 𝒜\mathcal{A}.

By construction, for a choice of Kraus operators {Aj}\{A_{j}\} for the channel 𝒜\mathcal{A} we have T𝒜=j|TAjTAj|T_{\mathcal{A}}=\sum_{j}{|{T_{A_{j}}}\rangle}\langle{T_{A_{j}}}|, and hence

C(𝒜)EE\displaystyle C({\mathcal{A}})^{E}_{E^{\prime}} =jTr((EE)|TAjTAj|)\displaystyle=\sum_{j}\operatorname{Tr}((E^{*}\otimes E^{\prime}){|{T_{A_{j}}}\rangle}\langle{T_{A_{j}}}|)
=jC(Aj)EE.\displaystyle=\sum_{j}C({A_{j}})^{E}_{E^{\prime}}. (75)

That is, the circuit tensor of a quantum channel is just the sum of the circuit tensors of its constituent Kraus operators. As noted earlier, this would seem to indicate that the circuit tensor depends on the choice of Kraus operators. However as it is defined in terms of the Choi matrix, this is not the case.

Now, C(Aj)EE=1dim()Tr(EAjEAj)C({A_{j}})^{E}_{E^{\prime}}=\frac{1}{\dim(\mathfrak{H})}\operatorname{Tr}(E^{\dagger}A_{j}^{\dagger}E^{\prime}A_{j}), and so we can further write

𝐂(𝒜)=1dim()j,E,ETr(EAjEAj)eEE\mathbf{C}\left({\mathcal{A}}\right)=\tfrac{1}{\dim(\mathfrak{H})}\sum_{j,E,E^{\prime}}\operatorname{Tr}(E^{\dagger}A_{j}^{\dagger}E^{\prime}A_{j})e^{E}_{E^{\prime}} (76)

showing a further generalization of the BB-tensor enumerator of [9] to arbitrary quantum channels.

Example 25 (Destructive measurement).

Let {|ϕj}j=0q1\{{|{\phi_{j}}\rangle}\}_{j=0}^{q-1} be an orthonormal basis of a Hilbert space \mathfrak{H}, and consider the operation of measuring a quantum state in this basis. That is, we input a quantum state from \mathfrak{H} and output an element of {0,,q1}\{0,\dots,q-1\}. Recall that as classical information the output is represented as density operators |00|,,|q1q1|{|{0}\rangle}\langle{0}|,\dots,{|{q-1}\rangle}\langle{q-1}| on q\mathbb{C}^{q}. So as a quantum channel, this measurement operator is 𝒟{|ϕj}:q\mathcal{MD}_{\{{|{\phi_{j}}\rangle}\}}:\mathfrak{H}\leadsto\mathbb{C}^{q}. In particular,

(𝒟{|ϕj})(ρ)=j=0q1|jj|ϕj|ρ|ϕj.(\mathcal{MD}_{\{{|{\phi_{j}}\rangle}\}})(\rho)=\sum_{j=0}^{q-1}{|{j}\rangle}\langle{j}|\cdot\langle{\phi_{j}}|\rho{|{\phi_{j}}\rangle}. (77)

Therefore we may take {|jϕj|}j=0,,q1\{{|{j}\rangle}\langle{\phi_{j}}|\}_{j=0,\dots,q-1} as Kraus operators for this channel.

Suppose we have error basis \mathcal{E} of \mathfrak{H}; for q\mathbb{C}^{q} we take error basis {Zα}α=0q1\{Z^{\alpha}\}_{\alpha=0}^{q-1}. Then

C(𝒟{|ϕj})ZαE\displaystyle C({\mathcal{MD}_{\{{|{\phi_{j}}\rangle}\}}})^{E}_{Z^{\alpha}} =1qj=0q1Tr(E|ϕjj|Zα|jϕj|)\displaystyle=\frac{1}{q}\sum_{j=0}^{q-1}\operatorname{Tr}(E^{\dagger}{|{\phi_{j}}\rangle}\langle{j}|Z^{\alpha}{|{j}\rangle}\langle{\phi_{j}}|)
=1qj=0q1ζqαjϕj|E|ϕj,\displaystyle=\frac{1}{q}\sum_{j=0}^{q-1}\zeta_{q}^{\alpha j}\langle{\phi_{j}}|E^{\dagger}{|{\phi_{j}}\rangle}, (78)

where ζq\zeta_{q} is the primitive qq-th root-of-unity. We see that owing to our choice of error basis of q\mathbb{C}^{q}, the circuit tensor is encoding information about the measurement in the Fourier domain.

Example 26 (Destructive Pauli measurement).

Let us specialize the above example to measuring a qubit with respect to a Pauli eigenbasis. We will consider XX, with eigenbasis {|+,|}\{{|{+}\rangle},{|{-}\rangle}\}, the cases of YY and ZZ being similar. For compactness, let us simply write 𝒟X=𝒟{|+,|}\mathcal{MD}_{X}=\mathcal{MD}_{\{{|{+}\rangle},{|{-}\rangle}\}}. Then by (78),

C(𝒟X)ZαP=12(+|P|++(1)α|P|).C({\mathcal{MD}_{X}})^{P}_{Z^{\alpha}}=\tfrac{1}{2}\left(\langle{+}|P{|{+}\rangle}+(-1)^{\alpha}\langle{-}|P{|{-}\rangle}\right). (79)

Now, we have Y|+=i|Y{|{+}\rangle}=-i{|{-}\rangle} and Z|+=|Z{|{+}\rangle}={|{-}\rangle} and so (79) reduces to

𝐂(𝒟X)=eII+eZX.\mathbf{C}\left({\mathcal{MD}_{X}}\right)=e^{I}_{I}+e^{X}_{Z}. (80)

Let us use the notation of 𝒟Z=𝒟{|0,|1}\mathcal{MD}_{Z}=\mathcal{MD}_{\{{|{0}\rangle},{|{1}\rangle}\}} and 𝒟Y=𝒟{|i,|i}\mathcal{MD}_{Y}=\mathcal{MD}_{\{{|{i}\rangle},{|{-i}\rangle}\}}, then we can similarly get 𝐂(𝒟Y)=eII+eZY\mathbf{C}\left({\mathcal{MD}_{Y}}\right)=e^{I}_{I}+e^{Y}_{Z} and 𝐂(𝒟Z)=eII+eZZ\mathbf{C}\left({\mathcal{MD}_{Z}}\right)=e^{I}_{I}+e^{Z}_{Z}, and so in short

𝐂(𝒟P)=eII+eZP\mathbf{C}\left({\mathcal{MD}_{P}}\right)=e^{I}_{I}+e^{P}_{Z} (81)

for any P{X,Y,Z}P\in\{X,Y,Z\}.

Let us now consider the slightly more complex example of non-demolition measurement. For simplicity, consider a binary projective measurement. As a quantum channel, this inputs a quantum state on the Hilbert space \mathfrak{H} and outputs both a classical bit and the post-measurement state. Recall a classical bit is viewed as |00|{|{0}\rangle}\langle{0}| or |11|{|{1}\rangle}\langle{1}|, density operators on 2\mathbb{C}^{2}. Hence the signature of this measurement as a quantum channel is 2\mathfrak{H}\leadsto\mathbb{C}^{2}\otimes\mathfrak{H}.

Example 27 (Projective measurement).

Let 𝒫𝐑:2\mathcal{MP}_{\mathbf{R}}:\mathfrak{H}\leadsto\mathbb{C}^{2}\otimes\mathfrak{H} be the quantum channel for measurement with respect to a binary projective-valued measure 𝐑={Π0,Π1}\mathbf{R}=\{\Pi_{0},\Pi_{1}\}. We may write

(𝒫𝐑)(ρ)=|00|Π0ρΠ0+|11|Π1ρΠ1(\mathcal{MP}_{\mathbf{R}})(\rho)={|{0}\rangle}\langle{0}|\otimes\Pi_{0}\rho\Pi_{0}+{|{1}\rangle}\langle{1}|\otimes\Pi_{1}\rho\Pi_{1} (82)

and so use as Kraus operators {|0Π0,|1Π1}\{{|{0}\rangle}\otimes\Pi_{0},{|{1}\rangle}\otimes\Pi_{1}\}. If \mathcal{E} is our error basis for \mathfrak{H}, then for 2\mathbb{C}^{2}\otimes\mathfrak{H} we take the error basis {ZαE:α{0,1},E}\{Z^{\alpha}\otimes E\>:\>\alpha\in\{0,1\},\>E\in\mathcal{E}\}. Then

C(𝒫𝐑)ZαEE\displaystyle C({\mathcal{MP}_{\mathbf{R}}})^{E}_{Z^{\alpha}\otimes E^{\prime}}
=1dim()j{0,1}Tr(E(j|Πj)(ZαE)(|jΠj)\displaystyle=\tfrac{1}{\dim(\mathfrak{H})}\sum_{j\in\{0,1\}}\operatorname{Tr}(E^{\dagger}(\langle{j}|\otimes\Pi_{j})(Z^{\alpha}\otimes E^{\prime})({|{j}\rangle}\otimes\Pi_{j})
=1dim()j{0,1}(1)αjTr(EΠjEΠj).\displaystyle=\tfrac{1}{\dim(\mathfrak{H})}\sum_{j\in\{0,1\}}(-1)^{\alpha j}\operatorname{Tr}(E^{\dagger}\Pi_{j}E^{\prime}\Pi_{j}). (83)
Example 28 (Projective Pauli measurement).

Let us specialize Example 27 to an nn-qubit Pauli operator measurement, Πj=12(I+(1)jS)\Pi_{j}=\frac{1}{2}(I+(-1)^{j}S) where S𝒫nS\in\mathcal{P}^{n}. Write 𝒫S\mathcal{MP}_{S} for this channel. Taking α=0\alpha=0 in (27),

C(𝒫S)IPP\displaystyle C({\mathcal{MP}_{S}})^{P}_{I\otimes P^{\prime}} =12n(Tr(PΠ0PΠ0)+Tr(PΠ1PΠ1))\displaystyle=\tfrac{1}{2^{n}}\left(\operatorname{Tr}(P\Pi_{0}P^{\prime}\Pi_{0})+\operatorname{Tr}(P\Pi_{1}P^{\prime}\Pi_{1})\right)
=12n{Tr(PP)ω(P,S)=1,0otherwise,\displaystyle=\frac{1}{2^{n}}\begin{cases}\operatorname{Tr}(P^{\dagger}P^{\prime})&\omega(P^{\prime},S)=1,\\ 0&\text{otherwise,}\end{cases} (84)

and for α=1\alpha=1 in (27),

C(𝒫S)ZPP\displaystyle C({\mathcal{MP}_{S}})^{P}_{Z\otimes P^{\prime}} =12n(Tr(PΠ0PΠ0)Tr(PΠ1PΠ1))\displaystyle=\tfrac{1}{2^{n}}\left(\operatorname{Tr}(P\Pi_{0}P^{\prime}\Pi_{0})-\operatorname{Tr}(P\Pi_{1}P^{\prime}\Pi_{1})\right)
=12n{Tr(PPS)ω(P,S)=1,0otherwise,\displaystyle=\frac{1}{2^{n}}\begin{cases}\operatorname{Tr}(P^{\dagger}P^{\prime}S)&\omega(P^{\prime},S)=1,\\ 0&\text{otherwise,}\end{cases} (85)

In particular, we can write the circuit tensor as

𝐂(𝒫S)=P:ω(P,S)=1eIPP+μ(PS)eZμ(PS)PSP\mathbf{C}\left({\mathcal{MP}_{S}}\right)=\sum_{P\>:\>\omega(P,S)=1}e^{P}_{I\otimes P}+\mu(PS)e^{P}_{Z\otimes\mu(PS)PS} (86)

where as in Defenition 3, we have used μ(PS)\mu(PS) to represent the phase of PSPS relative to the positve Pauli basis 𝒫n\mathcal{P}^{n}. Additionally, we write μ(PS)PS\mu(PS)PS as the positive basis element.

Theorem 29 (Circuit tensor for quantum channels composition).

Let 𝒜:𝔎\mathcal{A}:\mathfrak{H}\leadsto\mathfrak{K} and :𝔎𝔏\mathcal{B}:\mathfrak{K}\leadsto\mathfrak{L} be quantum channels. Then 𝐂(𝒜)=𝐂(𝒜)𝐂()\mathbf{C}\left({\mathcal{B}\circ\mathcal{A}}\right)=\mathbf{C}\left({\mathcal{A}}\right)\mathbf{C}\left({\mathcal{B}}\right). That is,

C(𝒜)EE=FC(𝒜)FEC()EF.C({\mathcal{B}\circ\mathcal{A}})^{E}_{E^{\prime}}=\sum_{F}C({\mathcal{A}})^{E}_{F}\>C({\mathcal{B}})^{F}_{E^{\prime}}. (87)
Proof.

We expand

F\displaystyle\sum_{F} C(𝒜)FEC()EF\displaystyle C({\mathcal{A}})^{E}_{F}\>C({\mathcal{B}})^{F}_{E^{\prime}}
=FTr((EF)T𝒜)Tr((FE)T)\displaystyle=\sum_{F}\operatorname{Tr}((E^{*}\otimes F)T_{\mathcal{A}})\operatorname{Tr}((F^{*}\otimes E^{\prime})T_{\mathcal{B}})
=FTr(((EF)T𝒜)((FE)T))\displaystyle=\sum_{F}\operatorname{Tr}\left(\left((E^{*}\otimes F)T_{\mathcal{A}}\right)\otimes\left((F^{*}\otimes E^{\prime})T_{\mathcal{B}}\right)\right)
=dim(𝔎)2Tr((E|ββ|E)(T𝒜T)).\displaystyle=\dim(\mathfrak{K})^{2}\cdot\operatorname{Tr}\left(\left(E^{*}\otimes{|{\beta}\rangle}\langle{\beta}|\otimes E^{\prime}\right)\left(T_{\mathcal{A}}\otimes T_{\mathcal{B}}\right)\right). (88)

where we have used Lemma 2. Now manipulating the trace,

Tr((E|ββ|E)(T𝒜T))\displaystyle\operatorname{Tr}\left(\left(E^{*}\otimes{|{\beta}\rangle}\langle{\beta}|\otimes E^{\prime}\right)\left(T_{\mathcal{A}}\otimes T_{\mathcal{B}}\right)\right)
=Tr((EI𝔎E)(I|βI𝔎)\displaystyle\qquad=\operatorname{Tr}\left(\left(E^{*}\otimes I_{\mathfrak{K}}\otimes E^{\prime}\right)\left(I_{\mathfrak{H}}\otimes{|{\beta}\rangle}\otimes I_{\mathfrak{K}}\right)\cdot\right.
(T𝒜T)(Iβ|I𝔎))\displaystyle\qquad\qquad\qquad\left.(T_{\mathcal{A}}\otimes T_{\mathcal{B}})\left(I_{\mathfrak{H}}\otimes\langle{\beta}|\otimes I_{\mathfrak{K}}\right)\right)
=Tr((EE)(Iβ|I𝔎)\displaystyle\qquad=\operatorname{Tr}\left(\left(E^{*}\otimes E^{\prime}\right)\left(I_{\mathfrak{H}}\otimes\langle{\beta}|\otimes I_{\mathfrak{K}}\right)\right.\cdot
(T𝒜T)(I|βI𝔎))\displaystyle\qquad\qquad\qquad\left.(T_{\mathcal{A}}\otimes T_{\mathcal{B}})\left(I_{\mathfrak{H}}\otimes{|{\beta}\rangle}\otimes I_{\mathfrak{K}}\right)\right)
=1dim(𝔎)2Tr((EE)T𝒜),\displaystyle\qquad=\tfrac{1}{\dim(\mathfrak{K})^{2}}\operatorname{Tr}\left((E^{*}\otimes E^{\prime})T_{\mathcal{B}\circ\mathcal{A}}\right), (89)

where we have used Proposition 23 above. Hence

FC(𝒜)FEC()EF\displaystyle\sum_{F}C({\mathcal{A}})^{E}_{F}\>C({\mathcal{B}})^{F}_{E^{\prime}} =Tr((EE)T𝒜)\displaystyle=\operatorname{Tr}\left((E^{*}\otimes E^{\prime})T_{\mathcal{B}\circ\mathcal{A}}\right)
=C(𝒜)EE.\displaystyle=C({\mathcal{B}\circ\mathcal{A}})^{E}_{E^{\prime}}. (90)

V Examples of quantum circuits

In this section, we provide constructions of circuit tensors for common quantum circuits that build upon the circuit tensors of quantum gates and measurements developed §§III - IV. We start the section with an example showing how to construct a circuit tensor of a projective Pauli measurement, being one of the most common sub-circuits in fault tolerant quantum computing, using destructive measurements and Clifford operations. Next, we develop the circuit tensor for a classically controlled quantum gate, essential for post-measurement feedback. We end the section with a large example, the teleportation circuit, that exhibits many of the basic blocks forming quantum circuits: state preparation, entangling gate, measurements, and classically controlled operations.

In Example 28 above, we derived the circuit tensor for a projective Pauli measurement, 𝒫S\mathcal{M}\mathcal{P}_{S} where S𝒫nS\in\mathcal{P}^{n}, by treating it as a general quantum channel. For our first example, we rederive this by composing the circuit tensors of a quantum circuit that implements the projective Pauli measurement with CNOTs, single-qubit Clifford gates, and a single-qubit destructive measurement. While projective Pauli measurement is native to, say, surface codes [25], other architectures do not have this as a native gate. Fig. 2 shows circuits performing single qubit projective Z, X, and Y measurements.

Refer to caption
Figure 2: Projective Pauli measurements: (a) projective Z measurement, (b) projective X measurement, (c) projective Y measurement.

In the simplest case of S=ZS=Z, and illustrated in Fig. 2(a), the circuit tensor of this circuit can be written, with a slight abuse of notation, as

𝐂(𝒫Z)=𝐂(𝒟Z(2))𝐂(CX)𝐂(𝒮𝒫|0(2)).\mathbf{C}\left({\mathcal{MP}_{Z}}\right)=\mathbf{C}\left({\mathcal{MD}^{(2)}_{Z}}\right)\circ\mathbf{C}\left({CX}\right)\circ\mathbf{C}\left({\mathcal{SP}^{(2)}_{{|{0}\rangle}}}\right). (91)

Here, the state preparation 𝒮𝒫|0(2)\mathcal{SP}^{(2)}_{{|{0}\rangle}} occurs as the second qubit with an identity operation on the first qubit whose notation we suppress. Similarly, the destructive measurement 𝒟Z(2)\mathcal{MD}^{(2)}_{Z} refers to the measurement of the second qubit, with the identity operation on the first.

In particular, from (28) we have 𝐂(𝒮𝒫|0)=eI+eZ\mathbf{C}\left({\mathcal{SP}_{{|{0}\rangle}}}\right)=e_{I}+e_{Z} and so:

𝐂(𝒮𝒫|0(2))\displaystyle\mathbf{C}\left({\mathcal{SP}^{(2)}_{{|{0}\rangle}}}\right) =𝐂(I)𝐂(𝒮𝒫|0)\displaystyle=\mathbf{C}\left({I}\right)\otimes\mathbf{C}\left({\mathcal{SP}_{{|{0}\rangle}}}\right)
=eIII+eXIX+eYIY+eZIZ\displaystyle=e^{I}_{I\otimes I}+e^{X}_{X\otimes I}+e^{Y}_{Y\otimes I}+e^{Z}_{Z\otimes I}
+eIZI+eXZX+eYZY+eZZZ.\displaystyle\qquad+e^{I}_{I\otimes Z}+e^{X}_{X\otimes Z}+e^{Y}_{Y\otimes Z}+e^{Z}_{Z\otimes Z}. (92)

Then from (57), the application of the CNOT yields

𝐂(CX)𝐂(𝒮𝒫|0(2))=eIII+eXXX+eYXY+eZIZ\displaystyle\mathbf{C}\left({CX}\right)\circ\mathbf{C}\left({\mathcal{SP}^{(2)}_{{|{0}\rangle}}}\right)=e^{I}_{I\otimes I}+e^{X}_{X\otimes X}+e^{Y}_{Y\otimes X}+e^{Z}_{Z\otimes I}
+eZZIeYYX+eXYY+eIZZ.\displaystyle\qquad+e^{I}_{Z\otimes Z}-e^{X}_{Y\otimes Y}+e^{Y}_{X\otimes Y}+e^{Z}_{I\otimes Z}. (93)

Now, from (81), 𝐂(𝒟Z)=eII+eZZ\mathbf{C}\left({\mathcal{MD}_{Z}}\right)=e^{I}_{I}+e^{Z}_{Z} and

𝐂(𝒟Z(2))\displaystyle\mathbf{C}\left({\mathcal{MD}^{(2)}_{Z}}\right) =𝐂(I)𝐂(𝒟Z)\displaystyle=\mathbf{C}\left({I}\right)\otimes\mathbf{C}\left({\mathcal{MD}_{Z}}\right)
=eIIII+eXIXI+eYIYI+eZIZI\displaystyle=e^{I\otimes I}_{I\otimes I}+e^{X\otimes I}_{X\otimes I}+e^{Y\otimes I}_{Y\otimes I}+e^{Z\otimes I}_{Z\otimes I}
+eIZIZ+eXZXZ+eYZYZ+eZZZZ.\displaystyle\qquad+e^{I\otimes Z}_{I\otimes Z}+e^{X\otimes Z}_{X\otimes Z}+e^{Y\otimes Z}_{Y\otimes Z}+e^{Z\otimes Z}_{Z\otimes Z}. (94)

Composing (93) with (94) gives

𝐂(𝒫Z)=eIII+eZIZ+eZZI+eIZZ,\mathbf{C}\left({\mathcal{MP}_{Z}}\right)=e^{I}_{I\otimes I}+e^{Z}_{Z\otimes I}+e^{I}_{Z\otimes Z}+e^{Z}_{I\otimes Z}, (95)

which aligns with (86).

Only slightly more complicated are the XX-basis and YY-basis projective measurement of Fig. 2(b,c). Here we need to add Clifford operations to our first qubit before and after the CNOT. We leave the full derivation for the reader, referring to (47, 50, 51):

𝐂(𝒫X)\displaystyle\mathbf{C}\left({\mathcal{MP}_{X}}\right) =[𝐂(H)𝐂(𝒟Z)]𝐂(CX)\displaystyle=\left[\mathbf{C}\left({H}\right)\otimes\mathbf{C}\left({\mathcal{MD}_{Z}}\right)\right]\circ\mathbf{C}\left({CX}\right)
[𝐂(H)𝐂(𝒮𝒫|0)]\displaystyle\quad\qquad\circ\left[\mathbf{C}\left({H}\right)\otimes\mathbf{C}\left({\mathcal{SP}_{{|{0}\rangle}}}\right)\right]
=eIII+eXIX+eXZI+eIZX,\displaystyle\quad=e^{I}_{I\otimes I}+e^{X}_{X\otimes I}+e^{I}_{X\otimes Z}+e^{X}_{I\otimes Z}, (96)

and

𝐂(𝒫Y)\displaystyle\mathbf{C}\left({\mathcal{MP}_{Y}}\right) =[𝐂(SH)𝐂(𝒟Z)]𝐂(CX)\displaystyle=\left[\mathbf{C}\left({S\circ H}\right)\otimes\mathbf{C}\left({\mathcal{MD}_{Z}}\right)\right]\circ\mathbf{C}\left({CX}\right)
[𝐂(HS)𝐂(𝒮𝒫|0)]\displaystyle\quad\qquad\circ\left[\mathbf{C}\left({H\circ S^{\dagger}}\right)\otimes\mathbf{C}\left({\mathcal{SP}_{{|{0}\rangle}}}\right)\right]
=eIII+eYIY+eYZI+eIZX.\displaystyle\quad=e^{I}_{I\otimes I}+e^{Y}_{Y\otimes I}+e^{I}_{Y\otimes Z}+e^{X}_{I\otimes Z}. (97)

From the above, it is easy to see how to construct a general projective Pauli measurement. To that end, we will note the pre and post-entanglement operations as follows:

𝐂(pre-en(P))={𝐂(I)P{I,Z},𝐂(H)P=X,𝐂(𝒮)P=Y,\displaystyle\mathbf{C}\left({\textit{pre-en}(P)}\right)=\begin{cases}\mathbf{C}\left({I}\right)&P\in\{I,Z\},\\ \mathbf{C}\left({H}\right)&P=X,\\ \mathbf{C}\left({\mathcal{S\circ H}}\right)&P=Y,\\ \end{cases} (98)
𝐂(post-en(P))={𝐂(I)P{I,Z},𝐂(H)P=X,𝐂(𝒮)P=Y.\displaystyle\mathbf{C}\left({\textit{post-en}(P)}\right)=\begin{cases}\mathbf{C}\left({I}\right)&P\in\{I,Z\},\\ \mathbf{C}\left({H}\right)&P=X,\\ \mathbf{C}\left({\mathcal{H\circ S^{\dagger}}}\right)&P=Y.\\ \end{cases} (99)

We will also note the entanglement operation between qubit ii and jj, while all the other qubits are idle as:

𝐂(entangle(i,j)(P))={𝐂(I)𝐂(I)P=I,𝐂(CX)PI.\mathbf{C}\left({\textit{entangle}^{(i,j)}(P)}\right)=\begin{cases}\mathbf{C}\left({I}\right)\otimes\mathbf{C}\left({I}\right)&P=I,\\ \mathbf{C}\left({CX}\right)&P\neq I.\\ \end{cases} (100)

Then for any Pauli operator P𝒫nP\in\mathcal{P}^{n} we have:

𝐂(𝒫P)\displaystyle\mathbf{C}\left({\mathcal{MP}_{P}}\right)
=𝐂(𝒟Z(n+1))[i=1n𝐂(post-en(Pi))𝐂(I)]\displaystyle\quad=\mathbf{C}\left({\mathcal{MD}^{(n+1)}_{Z}}\right)\circ\left[\bigotimes_{i=1}^{n}\mathbf{C}\left({\textit{post-en}(P_{i})}\right)\otimes\mathbf{C}\left({I}\right)\right]
i=1n𝐂(entangle(i,n+1)(Pi))\displaystyle\qquad\circ\bigcirc_{i=1}^{n}\mathbf{C}\left({\textit{entangle}^{(i,n+1)}(P_{i})}\right)
[i=1n𝐂(pre-en(Pi))𝐂(I)]𝐂(𝒮𝒫|0(n+1)).\displaystyle\qquad\circ\left[\bigotimes_{i=1}^{n}\mathbf{C}\left({\textit{pre-en}(P_{i})}\right)\otimes\mathbf{C}\left({I}\right)\right]\circ\mathbf{C}\left({\mathcal{SP}^{(n+1)}_{{|{0}\rangle}}}\right). (101)

For our second example we consider post-measurement feedback, a common construction in quantum algorithms and protocols: perform one of a selection of operations based on the outcome of a measurement. Some examples include gate injection [13, §10.6.2]; repeat-until-success circuits [26, 27]; and quantum state teleportation [13, §1.3.7]. The last of these we will treat in detail below.

At this stage we only consider selecting between one of two operations; we will consider the general case in §VI below. To keep a high level of generality, let us suppose each of our operations are quantum channels with signature 𝔎\mathfrak{H}\leadsto\mathfrak{K}. Our selector bit provides an addition classical input, whose associated Hilbert space is 2\mathbb{C}^{2}, hence our overall circuit will be a quantum channel with signature 2𝔎\mathbb{C}^{2}\otimes\mathfrak{H}\leadsto\mathfrak{K}.

Proposition 30 (Classical selection between two quantum channels).

Let (0),(1):𝔎\mathcal{M}^{(0)},\mathcal{M}^{(1)}:\mathfrak{H}\leadsto\mathfrak{K} be quantum channels, and let :2𝔎\mathcal{M}:\mathbb{C}^{2}\otimes\mathfrak{H}\leadsto\mathfrak{K} be the channel that selects (0),(1)\mathcal{M}^{(0)},\mathcal{M}^{(1)} given the input bit. Then the circuit tensor of \mathcal{M} is:

C()EZαE=12(C((0))EE+(1)αC((1))EE).C({\mathcal{M}})^{Z^{\alpha}\otimes E}_{E^{\prime}}=\frac{1}{2}\left(C({\mathcal{M}^{(0)}})^{E}_{E^{\prime}}+(-1)^{\alpha}C({\mathcal{M}^{(1)}})^{E}_{E^{\prime}}\right). (102)
Proof.

Let {Aj(0)}\{A^{(0)}_{j}\} and {Ak(1)}\{A^{(1)}_{k}\} be sets of Kraus operators for (0)\mathcal{M}^{(0)} and (1)\mathcal{M}^{(1)} respectively. Then {0|Aj(0),1|Ak(1)}\left\{\langle{0}|\otimes A^{(0)}_{j},\langle{1}|\otimes A^{(1)}_{k}\right\} is a set of Kraus operators for \mathcal{M}. Now, for example,

|T0|Aj(0)\displaystyle{|{T_{\langle{0}|\otimes A^{(0)}_{j}}}\rangle} =12dimb,x|b,x(0|Aj(0))|b,x\displaystyle=\tfrac{1}{\sqrt{2\dim\mathfrak{H}}}\sum_{b,x}{|{b,x}\rangle}\otimes\left(\langle{0}|\otimes A^{(0)}_{j}\right){|{b,x}\rangle}
=12|0|TAj(0).\displaystyle=\tfrac{1}{\sqrt{2}}{|{0}\rangle}\otimes{|{T_{A^{(0)}_{j}}}\rangle}. (103)

and so

T=12(|00|T(0)+|11|T(1))T_{\mathcal{M}}=\tfrac{1}{2}\left({|{0}\rangle}\langle{0}|\otimes T_{\mathcal{M}^{(0)}}+{|{1}\rangle}\langle{1}|\otimes T_{\mathcal{M}^{(1)}}\right) (104)

Therefore, we compute:

C()EZαE=Tr((ZαEE)T)\displaystyle C({\mathcal{M}})^{Z^{\alpha}\otimes E}_{E^{\prime}}=\operatorname{Tr}((Z^{\alpha}\otimes E^{*}\otimes E)T_{\mathcal{M}})
=12(Tr((ZαEE)(|00|T(0)))\displaystyle\quad=\frac{1}{2}(\operatorname{Tr}((Z^{\alpha}\otimes E^{*}\otimes E)({|{0}\rangle}\langle{0}|\otimes T_{\mathcal{M}^{(0)}}))
+Tr((ZαEE)(|11|T(1))))\displaystyle\qquad\qquad+\operatorname{Tr}((Z^{\alpha}\otimes E^{*}\otimes E)({|{1}\rangle}\langle{1}|\otimes T_{\mathcal{M}^{(1)}})))
=12(Tr((EE)T(0))+(1)αTr((EE)T(1)))\displaystyle\quad=\frac{1}{2}\left(\operatorname{Tr}((E^{*}\otimes E)T_{\mathcal{M}^{(0)}})+(-1)^{\alpha}\operatorname{Tr}((E^{*}\otimes E)T_{\mathcal{M}^{(1)}})\right)
=12(C((0))EE+(1)αC((1))EE).\displaystyle\quad=\frac{1}{2}\left(C({\mathcal{M}^{(0)}})^{E}_{E^{\prime}}+(-1)^{\alpha}C({\mathcal{M}^{(1)}})^{E}_{E^{\prime}}\right). (105)

Next, we will show a simple example of a classically controlled Pauli operation.

Example 31 (Classically controlled Pauli operation).

In a classically controlled nn-qubit Pauli operation, we have nn qubits that go through a quantum channel controlled by a classical wire. The two possible channels are the nn-qubit identity with the circuit tensor C()EE=12nTr(EE)C({\mathcal{I}})^{E}_{E^{\prime}}=\tfrac{1}{2^{n}}\operatorname{Tr}(E^{\dagger}E^{\prime}) or the nn-qubit Pauli PP channel, with the circuit tensor C(P)EE=12nTr(EPEP)C({P})^{E}_{E^{\prime}}=\tfrac{1}{2^{n}}\operatorname{Tr}(E^{\dagger}P^{\dagger}E^{\prime}P). Therefore, using Proposition 30 the circuit tensor of the classically controlled nn-qubit PP operations is:

C(cntl-P)EZαE\displaystyle C({\text{cntl-}P})^{Z^{\alpha}\otimes E}_{E^{\prime}} =12n+1[Tr(EE)+(1)αTr(EPEP)]\displaystyle=\tfrac{1}{2^{n+1}}\left[\operatorname{Tr}(E^{\dagger}E^{\prime})+(-1)^{\alpha}\operatorname{Tr}(E^{\dagger}P^{\dagger}E^{\prime}P)\right]
={12(1+(1)αω(E,P))E=E0EE.\displaystyle=\begin{cases}\tfrac{1}{2}\left(1+(-1)^{\alpha}\omega(E,P)\right)&E=E^{\prime}\\ 0&E\neq E^{\prime}.\end{cases} (106)

And using the tensor basis, we get

𝐂(cntl-P)= E𝒫nω(E,P)=1eEIE+ E𝒫nω(E,P)=1eEZE.\mathbf{C}\left({\text{cntl-}P}\right)=\sum_{\text{ \tiny$\begin{matrix}E\in\mathcal{P}^{n}\\ \omega(E,P)=1\end{matrix}$}}e^{I\otimes E}_{E}+\sum_{\text{ \tiny$\begin{matrix}E\in\mathcal{P}^{n}\\ \omega(E,P)=-1\end{matrix}$}}e^{Z\otimes E}_{E}\ . (107)

We specify the Pauli to be ZZ or XX for example, then in the component-free form we get:

𝐂(cntl-Z)=eIII+eXZX+eYZY+eZIZ,\mathbf{C}\left({\text{cntl-}Z}\right)=e^{I\otimes I}_{I}+e^{Z\otimes X}_{X}+e^{Z\otimes Y}_{Y}+e^{I\otimes Z}_{Z}\ , (108)
𝐂(cntl-X)=eIII+eXIX+eYZY+eZZZ.\mathbf{C}\left({\text{cntl-}X}\right)=e^{I\otimes I}_{I}+e^{I\otimes X}_{X}+e^{Z\otimes Y}_{Y}+e^{Z\otimes Z}_{Z}\ . (109)

We will conclude this section with a construction of the circuit tensor for the teleportation circuit. It consists of many building blocks we developed in the paper, and can act as a cookbook on how to construct circuit tensors for complicated circuits.

Refer to caption
Figure 3: Teleportion circuit composed of a Bell-state preparation (including the creation of two new qubits - 𝒮𝒫β\mathcal{S}\mathcal{P}_{\beta}), an entangling operation, X and Z destructive measurements, and classically controlled Pauli corrections for the output qubit. In the paper we refer to the full circuit as TEL.
Example 32 (Circuit tensor for the teleportation circuit).

We will show how to construct the circuit tensor of the teleportation circuit. Fig. 3 presents the teleportation circuit, it has an input of one qubit and an output of one qubit. Internally it creates a Bell State (31), entangels the input qubit to one half of the Bell State (57), then it performs the destructive XX and ZZ measurements (81) and applies the classically controlled Pauli corrections (108) (109). To create the teleportation circuit tensor We also use the circuit tensor of the quantum and classical identity (35) (64).

𝐂(TEL)=𝐂(cntl-Z)[𝐂(Iclassical)𝐂(cntl-X)][𝐂(𝒟X)𝐂(𝒟Z)𝐂(I)][𝐂(CX)𝐂(I)][𝐂(I)𝐂(𝒮𝒫β)].\begin{split}\mathbf{C}\left({TEL}\right)&=\mathbf{C}\left({\text{cntl-}Z}\right)\circ[\mathbf{C}\left({I_{classical}}\right)\otimes\mathbf{C}\left({\text{cntl-}X}\right)]\\ &\circ[\mathbf{C}\left({\mathcal{MD}_{X}}\right)\otimes\mathbf{C}\left({\mathcal{MD}_{Z}}\right)\otimes\mathbf{C}\left({I}\right)]\\ &\circ[\mathbf{C}\left({CX}\right)\otimes\mathbf{C}\left({I}\right)]\circ[\mathbf{C}\left({I}\right)\otimes\mathbf{C}\left({\mathcal{SP}_{\beta}}\right)]\ .\end{split} (110)

For ease of presentation, we will derive the above in parts:

𝐂(𝒟X)𝐂(𝒟Z)𝐂(I)=(eII+eZX)(eII+eZZ)𝐂(I)=eIIIIII+eZIIXII+eIZIIZI+eZZIXZI+eIIXIIX+eZIXXIX+eIZXIZX+eZZXXZX+eIIYIIY+eZIYXIY+eIZYIZY+eZZYXZY+eIIZIIZ+eZIZXIZ+eIZZIZZ+eZZZZXZ\begin{split}&\mathbf{C}\left({\mathcal{MD}_{X}}\right)\otimes\mathbf{C}\left({\mathcal{MD}_{Z}}\right)\otimes\mathbf{C}\left({I}\right)\\ &\quad=(e^{I}_{I}+e^{X}_{Z})\otimes(e^{I}_{I}+e^{Z}_{Z})\otimes\mathbf{C}\left({I}\right)\\ &\quad=\quad e^{I\otimes I\otimes I}_{I\otimes I\otimes I}+~{}e^{X\otimes I\otimes I}_{Z\otimes I\otimes I}+e^{I\otimes Z\otimes I}_{I\otimes Z\otimes I}~{}+e^{X\otimes Z\otimes I}_{Z\otimes Z\otimes I}\\ &\qquad+e^{I\otimes I\otimes X}_{I\otimes I\otimes X}+e^{X\otimes I\otimes X}_{Z\otimes I\otimes X}+e^{I\otimes Z\otimes X}_{I\otimes Z\otimes X}+e^{X\otimes Z\otimes X}_{Z\otimes Z\otimes X}\\ &\qquad+e^{I\otimes I\otimes Y}_{I\otimes I\otimes Y}+e^{X\otimes I\otimes Y}_{Z\otimes I\otimes Y}+e^{I\otimes Z\otimes Y}_{I\otimes Z\otimes Y}~{}+e^{X\otimes Z\otimes Y}_{Z\otimes Z\otimes Y}\\ &\qquad+e^{I\otimes I\otimes Z}_{I\otimes I\otimes Z}+e^{X\otimes I\otimes Z}_{Z\otimes I\otimes Z}+e^{I\otimes Z\otimes Z}_{I\otimes Z\otimes Z}~{}+e^{Z\otimes X\otimes Z}_{Z\otimes Z\otimes Z}\end{split} (111)
𝐂(cntl-Z)[𝐂(Iclassical)𝐂(cntl-X)]=(eIII+eXZX+eYZY+eZIZ)(eIIIII+eIXIIX+eIYIZY+eIZIZZ+eZIZII+eZXZIX+eZYZZY+eZZZZZ)=eIIII+eZIZZ+eXZIX+eYZZY\begin{split}&\mathbf{C}\left({\text{cntl-}Z}\right)\circ[\mathbf{C}\left({I_{classical}}\right)\otimes\mathbf{C}\left({\text{cntl-}X}\right)]\\ &~{}=(e^{I\otimes I}_{I}+e^{Z\otimes X}_{X}+e^{Z\otimes Y}_{Y}+e^{I\otimes Z}_{Z})\\ &\quad\circ(\quad e^{I\otimes I\otimes I}_{I\otimes I}+e^{I\otimes I\otimes X}_{I\otimes X}+e^{I\otimes Z\otimes Y}_{I\otimes Y}+e^{I\otimes Z\otimes Z}_{I\otimes Z}\\ &\qquad+e^{Z\otimes I\otimes I}_{Z\otimes I}+e^{Z\otimes I\otimes X}_{Z\otimes X}+e^{Z\otimes Z\otimes Y}_{Z\otimes Y}+e^{Z\otimes Z\otimes Z}_{Z\otimes Z})\\ &~{}=e^{I\otimes I\otimes I}_{I}+e^{I\otimes Z\otimes Z}_{Z}+e^{Z\otimes I\otimes X}_{X}+e^{Z\otimes Z\otimes Y}_{Y}\end{split} (112)
[𝐂(CX)𝐂(I)][𝐂(I)𝐂(𝒮𝒫β)]=[𝐂(CX)𝐂(I)](eIIII+eIXXIeIYYI+eIZZI+eXIIX+eXXXXeXYYX+eXZZX+eYIIY+eYXXYeYYYY+eYZZY+eZIIZ+eZXXZeZYYZ+eZZZZ)=eIIII+eIXXIeZYYI+eZZZI+eXXIX+eXIXXeYZYXeYYZX+eYXIY+eYIXY+eXZYY+eXYZY+eZIIZ+eZXXZeIYYZ+eIZZZ\begin{split}&[\mathbf{C}\left({CX}\right)\otimes\mathbf{C}\left({I}\right)]\circ[\mathbf{C}\left({I}\right)\otimes\mathbf{C}\left({\mathcal{SP}_{\beta}}\right)]\\ &\quad=[\mathbf{C}\left({CX}\right)\otimes\mathbf{C}\left({I}\right)]\\ &\qquad\circ(\quad e^{I}_{I\otimes I\otimes I}+e^{I}_{I\otimes X\otimes X}~{}-e^{I}_{I\otimes Y\otimes Y}~{}+e^{I}_{I\otimes Z\otimes Z}\\ &\qquad\quad+e^{X}_{X\otimes I\otimes I}+e^{X}_{X\otimes X\otimes X}-e^{X}_{X\otimes Y\otimes Y}+e^{X}_{X\otimes Z\otimes Z}\\ &\qquad\quad+e^{Y}_{Y\otimes I\otimes I}+e^{Y}_{Y\otimes X\otimes X}-e^{Y}_{Y\otimes Y\otimes Y}+e^{Y}_{Y\otimes Z\otimes Z}\\ &\qquad\quad+e^{Z}_{Z\otimes I\otimes I}+e^{Z}_{Z\otimes X\otimes X}-e^{Z}_{Z\otimes Y\otimes Y}+e^{Z}_{Z\otimes Z\otimes Z})\\ &\quad=e^{I}_{I\otimes I\otimes I}+e^{I}_{I\otimes X\otimes X}-e^{I}_{Z\otimes Y\otimes Y}+e^{I}_{Z\otimes Z\otimes Z}\\ &\qquad+e^{X}_{X\otimes X\otimes I}+e^{X}_{X\otimes I\otimes X}-e^{X}_{Y\otimes Z\otimes Y}-e^{X}_{Y\otimes Y\otimes Z}\\ &\qquad+e^{Y}_{Y\otimes X\otimes I}+e^{Y}_{Y\otimes I\otimes X}+e^{Y}_{X\otimes Z\otimes Y}+e^{Y}_{X\otimes Y\otimes Z}\\ &\qquad+e^{Z}_{Z\otimes I\otimes I}+e^{Z}_{Z\otimes X\otimes X}-e^{Z}_{I\otimes Y\otimes Y}+e^{Z}_{I\otimes Z\otimes Z}\end{split} (113)

Composing (112) with (111) we get:

eIIII+eZIZZ+eXXIX+eYXZY.e^{I\otimes I\otimes I}_{I}+e^{I\otimes Z\otimes Z}_{Z}+e^{X\otimes I\otimes X}_{X}+e^{X\otimes Z\otimes Y}_{Y}\ . (114)

Further composing (114) and (113) results with:

𝐂(TEL)=eII+eXX+eYY+eZZ=𝐂(I).\mathbf{C}\left({TEL}\right)=e^{I}_{I}+e^{X}_{X}+e^{Y}_{Y}+e^{Z}_{Z}=\mathbf{C}\left({I}\right). (115)

As expected, we got the identity circuit tensor (35). This might seem meaningless, but next, we will show how to add noise sources to circuit tensors, enabling an easy way to analyze a noisy circuit.

VI Noise Analysis in quantum circuits

In this section, we show how to incorporate noise sources into circuits and analyze these using the circuit tensor. Here, we will only treat models that depend on a finite number of noise modes, which we index as m=0,,M1m=0,\dots,M-1 (where implicitly, mode m=0m=0 denotes no error). Given a quantum channel for each noise mode, we form the composite quantum channel that takes mm as a classical input selecting the error mode. We then define a “trace” akin to [9, Lemma IV.1] that attaches a formal variable to this classical input, which may also be interpreted as a weight of the corresponding error mode. This defines a “circuit enumerator” that we will use extensively in later sections to count error paths in syndrome extraction circuits of quantum codes.

Setting notation, for a given quantum circuit let us write 𝒰:𝔎\mathcal{U}:\mathfrak{H}\leadsto\mathfrak{K} for the quantum channel of that circuit with no errors. We then write 𝒰~(m):𝔎\widetilde{\mathcal{U}}(m):\mathfrak{H}\leadsto\mathfrak{K} for the analogous noisy circuit operating under noise mode mm (so 𝒰~(0)=𝒰\widetilde{\mathcal{U}}(0)=\mathcal{U}). We combine these channels into a channel, 𝒰~:M𝔎\widetilde{\mathcal{U}}:\mathbb{C}^{M}\otimes\mathfrak{H}\leadsto\mathfrak{K}, as illustrated in Fig. 4a, where the first factor in the domain is the (classical) selection for the noise mode. Formally,

𝒰~(|mm|ρ)=𝒰~(m)(ρ).\widetilde{\mathcal{U}}({|{m}\rangle}\langle{m}|\otimes\rho)=\widetilde{\mathcal{U}}(m)(\rho). (116)
Refer to caption
Figure 4: (a) An error channel accepts a classical input to select the error mode. (b) The trace (represented by the open circle) creates the circuit enumerator of the channel, whose variables track occurrences of error modes.
Lemma 33.

𝐂(𝒰~)=m,E,EζMαmC(𝒰~(m))EEeEZαE\mathbf{C}\left({\widetilde{\mathcal{U}}}\right)=\sum_{m,E,E^{\prime}}\zeta_{M}^{-\alpha m}C({\widetilde{\mathcal{U}}(m)})^{E}_{E^{\prime}}\>e^{Z^{\alpha}\otimes E}_{E^{\prime}}, where ζM=e2πi/M\zeta_{M}=e^{2\pi i/M} is the canonical MM-th root-of-unity.

Proof.

Just as in the Proposition 30 above, the Choi matrix of the composite channel has

T𝒰~=1Mm=0M1|mm|T𝒰~(m).T_{\widetilde{\mathcal{U}}}=\frac{1}{M}\sum_{m=0}^{M-1}{|{m}\rangle}\langle{m}|\otimes T_{\widetilde{\mathcal{U}}(m)}. (117)

Thus by definition

C(𝒰~)EZαE\displaystyle C({\widetilde{\mathcal{U}}})^{Z^{\alpha}\otimes E}_{E^{\prime}} =Tr((ZαEE)T𝒰~)\displaystyle=\operatorname{Tr}((Z^{-\alpha}\otimes E^{*}\otimes E^{\prime})T_{\widetilde{\mathcal{U}}})
=m=0M1m|Zα|mTr((EE)T𝒰~(m))\displaystyle=\sum_{m=0}^{M-1}\langle{m}|Z^{-\alpha}{|{m}\rangle}\operatorname{Tr}((E^{*}\otimes E^{\prime})T_{\widetilde{\mathcal{U}}(m)})
=m=0M1ζMαmC(𝒰~(m))EE.\displaystyle=\sum_{m=0}^{M-1}\zeta_{M}^{-\alpha m}C({\widetilde{\mathcal{U}}(m)})^{E}_{E^{\prime}}\ . (118)

Note that this single channel is merely an encoding of all the different error modes of the circuit; there is yet no assignment of weight or likelihood attached to each mode. As the factor M\mathbb{C}^{M} supports only classical information, a density operator σ𝒮(M)\sigma\in\mathcal{S}(\mathbb{C}^{M}) must be of the form σ=m=0M1wm|mm|\sigma=\sum_{m=0}^{M-1}w_{m}{|{m}\rangle}\langle{m}|. So 𝒰~(σρ)\widetilde{\mathcal{U}}(\sigma\otimes\rho) is the result of the noisy channel on ρ𝒮()\rho\in\mathcal{S}(\mathfrak{H}) where each error mode mm is selected with probability wmw_{m}.

We want to treat the wmw_{m} as formal variables, and so create a “circuit enumerator” that tracks the occurrence of each error mode. We can achieve that with a trace-like operation Tr~:𝒮(M)[w0,,wM1]\widetilde{\operatorname{Tr}}:\mathcal{S}(\mathbb{C}^{M})\to\mathbb{R}[w_{0},\dots,w_{M-1}], as illustrated in Fig. 4b, by Tr~(|mm|)=wm\widetilde{\operatorname{Tr}}({|{m}\rangle}\langle{m}|)=w_{m} extended linearly to all density operators–compare to [9, Definition IV.2].

But, at the level of circuit tensors, we instead define Fourier variables uα=m=0M1ζMαmwmu_{\alpha}=\sum_{m=0}^{M-1}\zeta_{M}^{\alpha m}w_{m}, where, as above ζM=e2πi/M\zeta_{M}=e^{2\pi i/M}, and extend this trace to tensors, for which we do not introduce new notation, as

Tr~(eEZαE)=uαeEE.\widetilde{\operatorname{Tr}}(e^{Z^{\alpha}\otimes E}_{E^{\prime}})=u_{\alpha}e^{E}_{E^{\prime}}\ . (119)

The link between the two above notions of trace is given as follows.

Proposition 34.

Let 𝒰~(m):𝔎\widetilde{\mathcal{U}}(m):\mathfrak{H}\leadsto\mathfrak{K} be quantum channels for m=0,,M1m=0,\dots,M-1, each with an asssociated variable wmw_{m}. Define 𝒰~:M𝔎\widetilde{\mathcal{U}}:\mathbb{C}^{M}\otimes\mathfrak{H}\leadsto\mathfrak{K} as in (116). If as above, Tr~(eEZαE)=uαeEE\widetilde{\operatorname{Tr}}(e^{Z^{\alpha}\otimes E}_{E^{\prime}})=u_{\alpha}e^{E}_{E^{\prime}} with uα=mζMαmwmu_{\alpha}=\sum_{m}\zeta_{M}^{\alpha m}w_{m} we then have

Tr~[𝐂(𝒰~)]=m=0M1wm𝐂(𝒰~(m)).\widetilde{\operatorname{Tr}}\left[\mathbf{C}\left({\widetilde{\mathcal{U}}}\right)\right]=\sum_{m=0}^{M-1}w_{m}\mathbf{C}\left({\widetilde{\mathcal{U}}(m)}\right). (120)
Proof.

We apply the trace definition (119) to the circuit tensor as given in Lemma 33, yielding

Tr~[𝐂(𝒰~)]\displaystyle\widetilde{\operatorname{Tr}}\left[\mathbf{C}\left({\widetilde{\mathcal{U}}}\right)\right] =α,m,E,E1MζMαmuαC(𝒰~(m))EEeEE\displaystyle=\sum_{\alpha,m,E,E^{\prime}}\frac{1}{M}\zeta_{M}^{-\alpha m}u_{\alpha}C({\widetilde{\mathcal{U}}(m)})^{E}_{E^{\prime}}\>e^{E}_{E^{\prime}}
=m,E,EwmC(𝒰~(m))EEeEE\displaystyle=\sum_{m,E,E^{\prime}}w_{m}C({\widetilde{\mathcal{U}}(m)})^{E}_{E^{\prime}}\>e^{E}_{E^{\prime}}
=mwm𝐂(𝒰~(m)).\displaystyle=\sum_{m}w_{m}\mathbf{C}\left({\widetilde{\mathcal{U}}(m)}\right). (121)

We can consider (120) as a definition for the circuit enumerator of the noisy circuit 𝒰~\widetilde{\mathcal{U}}. However, to utilize the machinery developed in [9] we instead attach a weight function to an error model. Then the circuit enumerator is constructed analogously to the tensor enumerators of that work.

Definition 35 (Circuit enumerator).

Let \mathcal{E} be an error basis. A weight function is any function wt:0k\mathrm{wt}:\mathcal{E}\to\mathbb{Z}^{k}_{\geq 0}. If u=(u0,,uk)u=(u_{0},\dots,u_{k}) is a tuple of indeterminates, we write uwt(E)=u0wt(E)0ukwt(E)ku^{\mathrm{wt}(E)}=u_{0}^{\mathrm{wt}(E)_{0}}\cdots u_{k}^{\mathrm{wt}(E)_{k}}. The circuit enumerator of an error channel 𝒰~\widetilde{\mathcal{U}} (as in (116)) with associated weight function wt\mathrm{wt} is defined by

Tr~[𝐂(𝒰~)]=α,E,EC(𝒰~)EZαEuwt(Zα)eEE.\widetilde{\operatorname{Tr}}\left[\mathbf{C}\left({\widetilde{\mathcal{U}}}\right)\right]=\sum_{\alpha,E,E^{\prime}}C({\widetilde{\mathcal{U}}})^{Z^{\alpha}\otimes E}_{E^{\prime}}u^{\mathrm{wt}(Z^{\alpha})}e^{E}_{E^{\prime}}. (122)

We hasten to note that the trace on the left side of (122) is purely notational, but from (119) it is consistent with the trace used in the previous Proposition. We also note that our definition of a weight function differs from that in [9]; using the terminology of that paper, we only have need of scalar weight functions and so restrict to that case.

Example 36 (Bit flip error).

We begin with a very simple classical error model: the bit flip error. We view the bit flip as a classical xor operation of an input bit with the bit that controls whether the error occurs, as illustrated in Fig. 5. In Example 21 we found 𝐂(𝚡𝚘𝚛)=eIII+eZZZ\mathbf{C}\left({\mathtt{xor}}\right)=e^{I\otimes I}_{I}+e^{Z\otimes Z}_{Z}, and so performing the trace (119) we find

Tr~[𝐂(𝚡𝚘𝚛)]=u0eII+u1eZZ.\widetilde{\operatorname{Tr}}\left[\mathbf{C}\left({\mathtt{xor}}\right)\right]=u_{0}e^{I}_{I}+u_{1}e^{Z}_{Z}. (123)

From this equation, we can deduce the weight function of our error model: wt(I)=(1,0)\mathrm{wt}(I)=(1,0) and wt(Z)=(0,1)\mathrm{wt}(Z)=(0,1). For purposes of enumerating bit-flip errors, we take weight variables w0=1w_{0}=1 (no bit-flip) and w1=rw_{1}=r (one bit-flip), so that rr becomes the variable in the associated weight enumerator. Using the relationship u0=w0+w1u_{0}=w_{0}+w_{1} and u1=w0w1u_{1}=w_{0}-w_{1} we have

Tr~[𝐂(𝚡𝚘𝚛)]=(1+r)eII+(1r)eZZ.\widetilde{\operatorname{Tr}}[\mathbf{C}\left({\mathtt{xor}}\right)]=(1+r)e^{I}_{I}+(1-r)e^{Z}_{Z}. (124)
Refer to caption
Figure 5: Modeling a bit-flip on a (classical) measurement result. Here, rr is its weight enumerator variable.
Example 37 (Pauli readout assignment error).

In Example 28, we found the circuit tensor for the projective measurement of a Pauli operator S𝒫nS\in\mathcal{P}^{n} is given by 𝐂(𝒫S)=P:ω(P,S)=1eIPP+μ(PS)eZμ(PS)PSP\mathbf{C}\left({\mathcal{MP}_{S}}\right)=\sum_{P\>:\>\omega(P,S)=1}e^{P}_{I\otimes P}+\mu(PS)e^{P}_{Z\otimes\mu(PS)PS}. Now consider the quantum channel where this measurement may suffer from a readout assignment error. We compose the above circuit tensor with (124) to obtain the circuit weight enumerator of this channel:

𝐂(𝒫~S)=P:ω(P,S)=1(1+r)eIPP+(1r)μ(PS)eZμ(PS)PSP.\begin{split}&\mathbf{C}\left({\widetilde{\mathcal{MP}}_{S}}\right)\\ &=\sum_{P\>:\>\omega(P,S)=1}(1+r)e^{P}_{I\otimes P}+(1-r)\mu(PS)e^{P}_{Z\otimes\mu(PS)PS}.\end{split} (125)

Note: as rr indicates the occurrence of a readout assignment error, one sees that neither of terms eIPPe^{P}_{I\otimes P} nor eZμ(PS)PSPe^{P}_{Z\otimes\mu(PS)PS} can be associated with an assignment error, just as neither can be associated to measuring +1+1 versus 1-1.

In the above, we had wmw_{m} and uαu_{\alpha} related by the Fourier transform as implicitly we identified the error modes as elements of the integers modulo MM. However, in some cases, this is not what we want to do. For example, consider the (qq-ary) Pauli error channel 𝒟~:q2\widetilde{\mathcal{D}}:\mathbb{C}^{q^{2}}\otimes\mathfrak{H}\leadsto\mathfrak{H}, where 𝒟~(|mm|ρ)=PmρPm\widetilde{\mathcal{D}}\left({|{m}\rangle}\langle{m}|\otimes\rho\right)=P_{m}\rho P_{m}^{\dagger}. Here, we want our error modes to be a pair m=(m1,m2)q2m=(m_{1},m_{2})\in\mathbb{Z}_{q}^{2}, which indexes our Pauli operators Pm=Xm1Zm2P_{m}=X^{m_{1}}Z^{m_{2}} (except when q=2q=2 where P(1,1)=YP_{(1,1)}=Y).

Based on this recognition, we take classical error basis of q2\mathbb{C}^{q^{2}} to be {Zβ=Zβ1Zβ2}\{Z^{\beta}=Z^{\beta_{1}}\otimes Z^{\beta_{2}}\}. Recall that

PmPn=ζqm2n1m1n2PnPm=ζqc(m)nPnPm,P_{m}P_{n}=\zeta_{q}^{m_{2}n_{1}-m_{1}n_{2}}P_{n}P_{m}=\zeta_{q}^{c(m)\cdot n}P_{n}P_{m}, (126)

where ζq=e2πi/q\zeta_{q}=e^{2\pi i/q} and c(m)=(m2,m1)c(m)=(m_{2},-m_{1}). Then the circuit tensor of the Pauli error channel is

C(𝒟~)PmZβPm\displaystyle C({\widetilde{\mathcal{D}}})^{Z^{\beta}\otimes P_{m}}_{P_{m^{\prime}}}
=1q3nq2Tr((PmZβ)(Pn|n)Pm(Pnn|))\displaystyle=\frac{1}{q^{3}}\sum_{n\in\mathbb{Z}_{q}^{2}}\operatorname{Tr}((P_{m}^{\dagger}\otimes Z^{-\beta})(P^{\dagger}_{n}\otimes{|{n}\rangle})P_{m^{\prime}}(P_{n}\otimes\langle{n}|))
=1q3nq2ζqnβTr(PmPnPmPn)\displaystyle=\frac{1}{q^{3}}\sum_{n\in\mathbb{Z}_{q}^{2}}\zeta_{q}^{-n\cdot\beta}\operatorname{Tr}(P_{m}^{\dagger}P_{n}^{\dagger}P_{m^{\prime}}P_{n})
=1q3nq2ζqn(c(m)β)Tr(PmPm)\displaystyle=\frac{1}{q^{3}}\sum_{n\in\mathbb{Z}_{q}^{2}}\zeta_{q}^{n\cdot(c(m^{\prime})-\beta)}\operatorname{Tr}(P_{m}^{\dagger}P_{m^{\prime}})
={1if m=m and β=c(m)0otherwise.\displaystyle=\begin{cases}1&\text{if $m=m^{\prime}$ and $\beta=c(m)$}\\ 0&\text{otherwise.}\end{cases} (127)

That is 𝐂(𝒟~)=mePmZc(m)Pm\mathbf{C}\left({\widetilde{\mathcal{D}}}\right)=\sum_{m}e^{Z^{c(m)}\otimes P_{m}}_{P_{m}}, and hence the trace has

Tr~[𝐂(𝒟~)]=muc(m)ePmPm.\widetilde{\operatorname{Tr}}\left[\mathbf{C}\left({\widetilde{\mathcal{D}}}\right)\right]=\sum_{m}u_{c(m)}e^{P_{m}}_{P_{m}}. (128)

Now, the relationship between our formal variables uβu_{\beta} and the weight of a Pauli error wmw_{m} is uβ=mq2ζqβmwmu_{\beta}=\sum_{m\in\mathbb{Z}_{q}^{2}}\zeta_{q}^{\beta\cdot m}w_{m}, the Fourier transform over q2\mathbb{Z}_{q}^{2}.

In the case of a uniform Pauli error model, we take our weights as w(0,0)=ww_{(0,0)}=w and wm=zw_{m}=z when m(0,0)m\not=(0,0). In particular, our weight function is wt(I)=(1,0)\mathrm{wt}(I)=(1,0) and wt(Zβ)=(0,1)\mathrm{wt}(Z^{\beta})=(0,1) for all β(0,0)\beta\not=(0,0). Then our Fourier transform reduces to

u(0,0)=mq2wm=w+(q21)z,u_{(0,0)}=\sum_{m\in\mathbb{Z}_{q}^{2}}w_{m}=w+(q^{2}-1)z, (129)

and for β(0,0)\beta\not=(0,0),

uβ\displaystyle u_{\beta} =w+m0ζqβmz\displaystyle=w+\sum_{m\not=0}\zeta_{q}^{\beta\cdot m}z
=wz+zmq2ζqβm=wz.\displaystyle=w-z+z\sum_{m\in\mathbb{Z}_{q}^{2}}\zeta_{q}^{\beta\cdot m}=w-z. (130)

This is of course the usual MacWilliams transform for quantum codes [14, 15]. Hence we have shown the following result.

Proposition 38 (Circuit enumerator of a uniform Pauli error channel).

Let 𝒟~\widetilde{\mathcal{D}} be the uniform (qq-ary) Pauli error channel, where no error occurs with weight ww and each nontrivial Pauli error occurs with weight zz. Then its circuit weight enumerator is

Tr~[𝐂(𝒟~)]=(w+(q21)z)eII+(wz)PIePP.\widetilde{\operatorname{Tr}}\left[\mathbf{C}\left({\widetilde{\mathcal{D}}}\right)\right]=(w+(q^{2}-1)z)e^{I}_{I}+(w-z)\sum_{P\not=I}e^{P}_{P}. (131)
Example 39 (State preparation error).

In Example 9 we found that the circuit tensor for preparing a state |ψ{|{\psi}\rangle} is given by (26): C(|ψ)E=ψ|E|ψC({{|{\psi}\rangle}})_{E}=\langle{\psi}|E{|{\psi}\rangle}. A common model for state preparation error of a nn-qubit state is to apply the uniform Pauli error channel to the prepared state. That is, the noisy state preparation circuit is 𝒟~|ψ\widetilde{\mathcal{D}}\circ{|{\psi}\rangle}. Composing (26) and (131) gives

Tr~[𝐂(𝒟~|ψ)]=(w+(q21)z)eI+(wz)PIψ|P|ψeE.\begin{split}\widetilde{\operatorname{Tr}}&\left[\mathbf{C}\left({\widetilde{\mathcal{D}}\circ{|{\psi}\rangle}}\right)\right]\\ &=(w+(q^{2}-1)z)e_{I}+(w-z)\sum_{P\not=I}\langle{\psi}|P{|{\psi}\rangle}e_{E}.\end{split} (132)
Example 40 (A coherent error).

As a very simple example of a coherent error, consider the qubit error model 𝒮~\widetilde{\mathcal{S}} that applies II, with weight ww, or SS, ZZ, or SS^{\dagger}, each with equal weight zz. Indexing our error channels in this order, from Example 15 we have

𝐂(𝒮~(0))\displaystyle\mathbf{C}\left({\widetilde{\mathcal{S}}(0)}\right) =eII+eXX+eYY+eZZ,\displaystyle=e^{I}_{I}+e^{X}_{X}+e^{Y}_{Y}+e^{Z}_{Z}, (133)
𝐂(𝒮~(1))\displaystyle\mathbf{C}\left({\widetilde{\mathcal{S}}(1)}\right) =eII+eYXeXY+eZZ,\displaystyle=e^{I}_{I}+e^{X}_{Y}-e^{Y}_{X}+e^{Z}_{Z}, (134)
𝐂(𝒮~(2))\displaystyle\mathbf{C}\left({\widetilde{\mathcal{S}}(2)}\right) =eIIeXXeYY+eZZ,\displaystyle=e^{I}_{I}-e^{X}_{X}-e^{Y}_{Y}+e^{Z}_{Z}, (135)
𝐂(𝒮~(3))\displaystyle\mathbf{C}\left({\widetilde{\mathcal{S}}(3)}\right) =eIIeYX+eXY+eZZ.\displaystyle=e^{I}_{I}-e^{X}_{Y}+e^{Y}_{X}+e^{Z}_{Z}. (136)

Directly applying Proposition 34 we have

Tr~[𝐂(𝒮~)]\displaystyle\widetilde{\operatorname{Tr}}\left[\mathbf{C}\left({\widetilde{\mathcal{S}}}\right)\right] =(w+3z)eII+(wz)eXX\displaystyle=(w+3z)e^{I}_{I}+(w-z)e^{X}_{X}
+(wz)eYY+(w+3z)eZZ.\displaystyle\qquad+(w-z)e^{Y}_{Y}+(w+3z)e^{Z}_{Z}. (137)

We will close out this section with an example of a noisy quantum teleportation. In Example 32 we have seen how the circuit tensor of a noise-less teleportation circuit (110) simplifies into the identity circuit tensor (35). Now, we will add noise sources to create the circuit enumerator and utilize it to calculate the complete error model.

Refer to caption
Figure 6: Noisy teleportation circuit — D~z\widetilde{D}_{z} represents a uniform Pauli error channel with zz as its formal weight vriable. ~r\widetilde{\oplus}_{r} is a classical bit-flip error channel with rr as its formal weight vriable. A classicaly controled error channel, is a noie less identity when the control bit is zero. See Fig. 3 for the noiseless teleportation circuit.
Example 41 (Noisy teleportation circuit analysis).

Using the teleportation circuit given in Fig. 3 we will add the quantum errors in the following locations: Bell-State preparation with weight variable mm, CNOT gate with weight variable c2c_{2}, and the two classically controlled Pauli operations with weight variable c1c_{1}. To model the quantum noise, we add a uniform Pauli error channel after each location. We will also consider classical error sources, specifically a bit flip error in both measurements, with rr as their weight enumeration variable. To be more precise, after the state preparation we add a 2-qubit Pauli error channel, after the CNOT we add two 1-qubit error channels one on each output leg, the noise after the classical correction is also a 1-qubit Pauli error channel but it is only applied if the classical bit is one. The noisy teleportation circuit can be seen in Fig. 6.

The resulting circuit enumerator is:

Tr~[𝐂(TEL~)]=P𝒫uP(c1,c2,r,m)ePP,\widetilde{\operatorname{Tr}}\left[\mathbf{C}\left({\widetilde{TEL}}\right)\right]=\sum_{P\in\mathcal{P}}u_{P}(c_{1},c_{2},r,m)e^{P}_{P}, (138)

where: uI=1u_{I}=1, and

uX=uZ=123c11415c22r1415m+19c12+2845c1c2+43c1r+2845c1m+2815c2r+196225c2m+2815rm14135c12c229c12r14135c12m5645c1c2r392675c1c2m5645c1rm392225c2rm+28135c12c2r+1962025c12c2m+28135c12rm+784675c1c2rm3922025c12c2rm,\begin{split}u_{X}=u_{Z}=&1-\tfrac{2}{3}c_{1}-\tfrac{14}{15}c_{2}-2r-\tfrac{14}{15}m+\tfrac{1}{9}c_{1}^{2}+\tfrac{28}{45}c_{1}c_{2}\\ &+\tfrac{4}{3}c_{1}r+\tfrac{28}{45}c_{1}m+\tfrac{28}{15}c_{2}r+\tfrac{196}{225}c_{2}m+\tfrac{28}{15}rm\\ &-\tfrac{14}{135}c_{1}^{2}c_{2}-\tfrac{2}{9}c_{1}^{2}r-\tfrac{14}{135}c_{1}^{2}m-\tfrac{56}{45}c_{1}c_{2}r\\ &-\tfrac{392}{675}c_{1}c_{2}m-\tfrac{56}{45}c_{1}rm-\tfrac{392}{225}c_{2}rm+\tfrac{28}{135}c_{1}^{2}c_{2}r\\ &+\tfrac{196}{2025}c_{1}^{2}c_{2}m+\tfrac{28}{135}c_{1}^{2}rm+\tfrac{784}{675}c_{1}c_{2}rm\\ &-\tfrac{392}{2025}c_{1}^{2}c_{2}rm,\end{split} (139)

and

uY=123c11415c24r1415m+19c12+2845c1c2+83c1r+2845c1m+5615c2r+196225c2m+4r2+5615rm14135c12c249c12r14135c12m11245c1c2r392675c1c2m83c1r211245c1rm5615c2r2784225c2rm5615r2m+56135c12c2r+1962025c12c2m+49c12r2+56135c12rm+11245c1c2r2+1568675c1c2rm+11245c1r2m+784225c2r2m56135c12c2r27842025c12c2rm56135c12r2m1568675c1c2r2m+7842025c12c2r2m.\begin{split}u_{Y}=&1-\tfrac{2}{3}c_{1}-\tfrac{14}{15}c_{2}-4r-\tfrac{14}{15}m+\tfrac{1}{9}c_{1}^{2}+\tfrac{28}{45}c_{1}c_{2}+\tfrac{8}{3}c_{1}r\\ &+\tfrac{28}{45}c_{1}m+\tfrac{56}{15}c_{2}r+\tfrac{196}{225}c_{2}m+4r^{2}+\tfrac{56}{15}rm-\tfrac{14}{135}c_{1}^{2}c_{2}\\ &-\tfrac{4}{9}c_{1}^{2}r-\tfrac{14}{135}c_{1}^{2}m-\tfrac{112}{45}c_{1}c_{2}r-\tfrac{392}{675}c_{1}c_{2}m-\tfrac{8}{3}c_{1}r^{2}\\ &-\tfrac{112}{45}c_{1}rm-\tfrac{56}{15}c_{2}r^{2}-\tfrac{784}{225}c_{2}rm-\tfrac{56}{15}r^{2}m+\tfrac{56}{135}c_{1}^{2}c_{2}r\\ &+\tfrac{196}{2025}c_{1}^{2}c_{2}m+\tfrac{4}{9}c_{1}^{2}r^{2}+\tfrac{56}{135}c_{1}^{2}rm+\tfrac{112}{45}c_{1}c_{2}r^{2}\\ &+\tfrac{1568}{675}c_{1}c_{2}rm+\tfrac{112}{45}c_{1}r^{2}m+\tfrac{784}{225}c_{2}r^{2}m-\tfrac{56}{135}c_{1}^{2}c_{2}r^{2}\\ &-\tfrac{784}{2025}c_{1}^{2}c_{2}rm-\tfrac{56}{135}c_{1}^{2}r^{2}m-\tfrac{1568}{675}c_{1}c_{2}r^{2}m\\ &+\tfrac{784}{2025}c_{1}^{2}c_{2}r^{2}m\ .\end{split} (140)

With these circuit enumerator coefficients, we can construct an error model for the overall circuit. In this case, as we only introduce Pauli error and utilize Clifford operations, the resulting error model will be a Pauli error model. We transform the coefficient above into probabilities pI,pX,pY,pZp_{I},p_{X},p_{Y},p_{Z} that satisfy

Pauli PpP𝐂(P)=Tr~[𝐂(TEL~)].\sum_{\text{Pauli $P$}}p_{P}\mathbf{C}\left({P}\right)=\widetilde{\operatorname{Tr}}\left[\mathbf{C}\left({\widetilde{TEL}}\right)\right]. (141)

Then from (35, 39-41) we construct a set of linear equations,

(1111111111111111)(pIpXpYpZ)=(uIuXuYuZ).\begin{pmatrix}1&1&1&1\\ 1&1&-1&-1\\ 1&-1&1&-1\\ 1&-1&-1&1\\ \end{pmatrix}\begin{pmatrix}p_{I}\\ p_{X}\\ p_{Y}\\ p_{Z}\end{pmatrix}=\begin{pmatrix}u_{I}\\ u_{X}\\ u_{Y}\\ u_{Z}\end{pmatrix}. (142)

Solving these we get,

pI=112c1710c22r710m+112c12+715c1c2+43c1r+715c1m+2815c2r+4975c2m+r2+2815rm790c12c229c12r790c12m5645c1c2r98225c1c2m23c1r25645c1rm1415c2r2392225c2rm1415r2m+28135c12c2r+49675c12c2m+19c12r2+28135c12rm+2845c1c2r2+784675c1c2rm+2845c1r2m+196225c2r2m14135c12c2r23922025c12c2rm14135c12r2m392675c1c2r2m+1962025c12c2r2m,\begin{split}p_{I}=&1-\tfrac{1}{2}c_{1}-\tfrac{7}{10}c_{2}-2r-\tfrac{7}{10}m+\tfrac{1}{12}c_{1}^{2}+\tfrac{7}{15}c_{1}c_{2}+\tfrac{4}{3}c_{1}r\\ &+\tfrac{7}{15}c_{1}m+\tfrac{28}{15}c_{2}r+\tfrac{49}{75}c_{2}m+r^{2}+\tfrac{28}{15}rm-\tfrac{7}{90}c_{1}^{2}c_{2}\\ &-\tfrac{2}{9}c_{1}^{2}r-\tfrac{7}{90}c_{1}^{2}m-\tfrac{56}{45}c_{1}c_{2}r-\tfrac{98}{225}c_{1}c_{2}m-\tfrac{2}{3}c_{1}r^{2}\\ &-\tfrac{56}{45}c_{1}rm-\tfrac{14}{15}c_{2}r^{2}-\tfrac{392}{225}c_{2}rm-\tfrac{14}{15}r^{2}m+\tfrac{28}{135}c_{1}^{2}c_{2}r\\ &+\tfrac{49}{675}c_{1}^{2}c_{2}m+\tfrac{1}{9}c_{1}^{2}r^{2}+\tfrac{28}{135}c_{1}^{2}rm+\tfrac{28}{45}c_{1}c_{2}r^{2}\\ &+\tfrac{784}{675}c_{1}c_{2}rm+\tfrac{28}{45}c_{1}r^{2}m+\tfrac{196}{225}c_{2}r^{2}m-\tfrac{14}{135}c_{1}^{2}c_{2}r^{2}\\ &-\tfrac{392}{2025}c_{1}^{2}c_{2}rm-\tfrac{14}{135}c_{1}^{2}r^{2}m-\tfrac{392}{675}c_{1}c_{2}r^{2}m\\ &+\tfrac{196}{2025}c_{1}^{2}c_{2}r^{2}m\ ,\end{split} (143)
pX=pZ=16c1+730c2+r+730m136c12745c1c223c1r745c1m1415c2r49225c2mr21415rm+7270c12c2+19c12r+7270c12m+2845c1c2r+98675c1c2m+23c1r2+2845c1rm+1415c2r2+196225c2rm+1415r2m14135c12c2r492025c12c2m19c12r214135c12rm2845c1c2r2392675c1c2rm2845c1r2m196225c2r2m+14135c12c2r2+1962025c12c2rm+14135c12r2m+392675c1c2r2m1962025c12c2r2m,\begin{split}p_{X}=p_{Z}=&\tfrac{1}{6}c_{1}+\tfrac{7}{30}c_{2}+r+\tfrac{7}{30}m-\tfrac{1}{36}c_{1}^{2}-\tfrac{7}{45}c_{1}c_{2}\\ &-\tfrac{2}{3}c_{1}r-\tfrac{7}{45}c_{1}m-\tfrac{14}{15}c_{2}r-\tfrac{49}{225}c_{2}m-r^{2}\\ &-\tfrac{14}{15}rm+\tfrac{7}{270}c_{1}^{2}c_{2}+\tfrac{1}{9}c_{1}^{2}r+\tfrac{7}{270}c_{1}^{2}m\\ &+\tfrac{28}{45}c_{1}c_{2}r+\tfrac{98}{675}c_{1}c_{2}m+\tfrac{2}{3}c_{1}r^{2}+\tfrac{28}{45}c_{1}rm\\ &+\tfrac{14}{15}c_{2}r^{2}+\tfrac{196}{225}c_{2}rm+\tfrac{14}{15}r^{2}m-\tfrac{14}{135}c_{1}^{2}c_{2}r\\ &-\tfrac{49}{2025}c_{1}^{2}c_{2}m-\tfrac{1}{9}c_{1}^{2}r^{2}-\tfrac{14}{135}c_{1}^{2}rm-\tfrac{28}{45}c_{1}c_{2}r^{2}\\ &-\tfrac{392}{675}c_{1}c_{2}rm-\tfrac{28}{45}c_{1}r^{2}m-\tfrac{196}{225}c_{2}r^{2}m\\ &+\tfrac{14}{135}c_{1}^{2}c_{2}r^{2}+\tfrac{196}{2025}c_{1}^{2}c_{2}rm+\tfrac{14}{135}c_{1}^{2}r^{2}m\\ &+\tfrac{392}{675}c_{1}c_{2}r^{2}m-\tfrac{196}{2025}c_{1}^{2}c_{2}r^{2}m\ ,\end{split} (144)

and

pY=16c1+730c2+730m136c12745c1c2745c1m49225c2m+r2+7270c12c2+7270c12m+98675c1c2m23c1r21415c2r21415r2m492025c12c2m+19c12r2+2845c1c2r2+2845c1r2m+196225c2r2m14135c12c2r214135c12r2m392675c1c2r2m+1962025c12c2r2m.\begin{split}p_{Y}=&\tfrac{1}{6}c_{1}+\tfrac{7}{30}c_{2}+\tfrac{7}{30}m-\tfrac{1}{36}c_{1}^{2}-\tfrac{7}{45}c_{1}c_{2}-\tfrac{7}{45}c_{1}m\\ &-\tfrac{49}{225}c_{2}m+r^{2}+\tfrac{7}{270}c_{1}^{2}c_{2}+\tfrac{7}{270}c_{1}^{2}m+\tfrac{98}{675}c_{1}c_{2}m\\ &-\tfrac{2}{3}c_{1}r^{2}-\tfrac{14}{15}c_{2}r^{2}-\tfrac{14}{15}r^{2}m-\tfrac{49}{2025}c_{1}^{2}c_{2}m+\tfrac{1}{9}c_{1}^{2}r^{2}\\ &+\tfrac{28}{45}c_{1}c_{2}r^{2}+\tfrac{28}{45}c_{1}r^{2}m+\tfrac{196}{225}c_{2}r^{2}m-\tfrac{14}{135}c_{1}^{2}c_{2}r^{2}\\ &-\tfrac{14}{135}c_{1}^{2}r^{2}m-\tfrac{392}{675}c_{1}c_{2}r^{2}m+\tfrac{196}{2025}c_{1}^{2}c_{2}r^{2}m.\end{split} (145)

VII Poisson summation for stabilizer codes

In the previous section, we saw how various error models can be attached to circuit elements, which produce weight functions and circuit enumerators. Composing several such circuit elements together, these enumerators count, or when properly normalized compute the probability of, all error paths through the circuit. The principle of fault-tolerance is that an error mitigation strategy must also deal with errors that arise from applying error correction circuitry itself. To that end, we provide in this section a powerful computational tool for stabilizer codes akin to the Poisson Summation Formula.

Like Poisson summation, our formula arises through a duality of the convolution and pointwise product. However, in our case this duality is provided by the MacWilliams transform. Specifically, consider a Hilbert space \mathfrak{H} of dimension qq, with error basis \mathcal{E}. Recall from [9, §VI], that given a weight function wt\mathrm{wt}, an algebraic mapping Φ(𝐮)=(Φ1(𝐮),,Φk(𝐮))\Phi(\mathbf{u})=(\Phi_{1}(\mathbf{u}),\dots,\Phi_{k}(\mathbf{u})) is a MacWilliams transform for that weight function if

Φ(𝐮)wt(D)=1qEω(D,E)𝐮wt(E).\Phi(\mathbf{u})^{\mathrm{wt}(D)}=\frac{1}{q}\sum_{E\in\mathcal{E}}\omega(D,E)\mathbf{u}^{\mathrm{wt}(E)}. (146)
Example 42 (Uniform Pauli errors).

Continuing from Proposition 38, consider the uniform Pauli error model. The weight function for this model that tracks whether a nontrivial error occurs:

wt(E)={(1,0)if E=I,(0,1)otherwise.\mathrm{wt}(E)=\begin{cases}(1,0)&\text{if $E=I$,}\\ (0,1)&\text{otherwise.}\end{cases} (147)

As there, take 𝐮=(w,z)\mathbf{u}=(w,z) for a tuple of indeterminates so that

𝐮wt(E)={wif E=I,zotherwise.\mathbf{u}^{\mathrm{wt}(E)}=\begin{cases}w&\text{if $E=I$,}\\ z&\text{otherwise.}\end{cases} (148)

For Φ\Phi to be a MacWilliams transform for this weight function, equation (146) must hold. First taking D=ID=I in (146) we must have

Φ0(w,z)=12E𝐮wt(E)=w+3z2.\Phi_{0}(w,z)=\frac{1}{2}\sum_{E\in\mathcal{E}}\mathbf{u}^{\mathrm{wt}(E)}=\frac{w+3z}{2}. (149)

On the other hand, if DID\not=I then on the left side of (146) we have Φ1(w,z)\Phi_{1}(w,z), irrespective of DD. On the right side (146), when E=IE=I we have ω(D,I)=1\omega(D,I)=1 and hence contributes w2\frac{w}{2} to the sum. Yet, as we sum E{X,Y,Z}E\in\{X,Y,Z\}, precisely one has ω(D,E)=1\omega(D,E)=1, while two have ω(D,E)=1\omega(D,E)=-1. For example, if D=YD=Y then ω(Y,X)=1\omega(Y,X)=-1, ω(Y,Y)=1\omega(Y,Y)=1, and ω(Y,Z)=1\omega(Y,Z)=-1. So regardless of DD the sum of the three terms with EIE\not=I contributes z2-\frac{z}{2}, and hence irrespective of DD we find

Φ1(w,z)=wz2.\Phi_{1}(w,z)=\frac{w-z}{2}. (150)

Therefore we find a unique MacWilliams transform given by

Φ(w,z)=(w+3z2,wz2).\Phi(w,z)=\left(\frac{w+3z}{2},\frac{w-z}{2}\right). (151)

Given a tuple 𝐰𝐭=(wt1,,wtn)\mathbf{wt}=(\mathrm{wt}_{1},\dots,\mathrm{wt}_{n}) of weight functions, where each weight function takes values in 0k\mathbb{Z}_{\geq 0}^{k}, we define

𝐰𝐭(E1En)=j=1nwtj(Ej).\mathbf{wt}(E_{1}\otimes\cdots\otimes E_{n})=\sum_{j=1}^{n}\mathrm{wt}_{j}(E_{j}). (152)
Theorem 43 (Poisson summation for stabilizer codes).

Let \mathfrak{C} be a [[n,k,d]]q[[n,k,d]]_{q} stabilizer code with stabilizer group 𝒮()\mathcal{S}(\mathfrak{C}) and normalizer 𝒩()\mathcal{N}(\mathfrak{C}). Let 𝐰𝐭1\mathbf{wt}_{1} and 𝐰𝐭2\mathbf{wt}_{2} be scalar weight functions that have MacWilliams transforms Φ1\Phi_{1} and Φ2\Phi_{2} respectively. Then

D𝒩()Φ1(𝐮1)𝐰𝐭1(D)Φ2(𝐮2)𝐰𝐭2(D)\displaystyle\sum_{D\in\mathcal{N}(\mathfrak{C})}\Phi_{1}(\mathbf{u}_{1})^{\mathbf{wt}_{1}(D)}\Phi_{2}(\mathbf{u}_{2})^{\mathbf{wt}_{2}(D)}
=1qnkE1,E2nE1E2𝒮()𝐮1𝐰𝐭1(E1)𝐮2𝐰𝐭2(E2)\displaystyle\qquad=\frac{1}{q^{n-k}}\sum_{\text{\tiny$\begin{array}[]{c}E_{1},E_{2}\in\mathcal{E}^{n}\\ E_{1}E_{2}\in\mathcal{S}(\mathfrak{C})\end{array}$}}\mathbf{u}_{1}^{\mathbf{wt}_{1}(E_{1})}\mathbf{u}_{2}^{\mathbf{wt}_{2}(E_{2})} (155)

and

D𝒮()Φ1(𝐮1)𝐰𝐭1(D)Φ2(𝐮2)𝐰𝐭2(D)\displaystyle\sum_{D\in\mathcal{S}(\mathfrak{C})}\Phi_{1}(\mathbf{u}_{1})^{\mathbf{wt}_{1}(D)}\Phi_{2}(\mathbf{u}_{2})^{\mathbf{wt}_{2}(D)}
=1qn+k E1,E2nE1E2𝒩()𝐮1𝐰𝐭1(E1)𝐮2𝐰𝐭2(E2).\displaystyle\qquad=\frac{1}{q^{n+k}}\sum_{\text{ \tiny$\begin{array}[]{c}E_{1},E_{2}\in\mathcal{E}^{n}\\ E_{1}E_{2}\in\mathcal{N}(\mathfrak{C})\end{array}$}}\mathbf{u}_{1}^{\mathbf{wt}_{1}(E_{1})}\mathbf{u}_{2}^{\mathbf{wt}_{2}(E_{2})}. (158)
Proof.

Starting with the left summand, we use (146) to write

Φ1(𝐮1)𝐰𝐭1(D)Φ2(𝐮2)𝐰𝐭2(D)\displaystyle\Phi_{1}(\mathbf{u}_{1})^{\mathbf{wt}_{1}(D)}\Phi_{2}(\mathbf{u}_{2})^{\mathbf{wt}_{2}(D)}
=1q2nE1,E2ω(D,E1)ω(D,E2)𝐮1𝐰𝐭1(E1)𝐮2𝐰𝐭2(E2)\displaystyle\quad=\frac{1}{q^{2n}}\sum_{E_{1},E_{2}}\omega(D,E_{1})\omega(D,E_{2})\mathbf{u}_{1}^{\mathbf{wt}_{1}(E_{1})}\mathbf{u}_{2}^{\mathbf{wt}_{2}(E_{2})}
=1q2nE1,E2ω(D,E1E2)𝐮1𝐰𝐭1(E1)𝐮2𝐰𝐭2(E2).\displaystyle\quad=\frac{1}{q^{2n}}\sum_{E_{1},E_{2}}\omega(D,E_{1}E_{2})\mathbf{u}_{1}^{\mathbf{wt}_{1}(E_{1})}\mathbf{u}_{2}^{\mathbf{wt}_{2}(E_{2})}. (159)

Now summing this equation over D𝒮()D\in\mathcal{S}(\mathfrak{C}) we note

D𝒮()ω(D,E1E2)={qnkif E1E2𝒩(),0otherwise,\sum_{D\in\mathcal{S}(\mathfrak{C})}\omega(D,E_{1}E_{2})=\begin{cases}q^{n-k}&\text{if $E_{1}E_{2}\in\mathcal{N}(\mathfrak{C})$,}\\ 0&\text{otherwise,}\end{cases} (160)

from whence (43) follows. Similarly, for 𝒩()\mathcal{N}(\mathfrak{C}) we have

D𝒩()ω(D,E1E2)={qn+kif E1E2𝒮(),0otherwise,\sum_{D\in\mathcal{N}(\mathfrak{C})}\omega(D,E_{1}E_{2})=\begin{cases}q^{n+k}&\text{if $E_{1}E_{2}\in\mathcal{S}(\mathfrak{C})$,}\\ 0&\text{otherwise,}\end{cases} (161)

and so (43) also follows. ∎

The crux of the above argument is (VII) where we used the fact that ω\omega is a bicharacter. Clearly, this extends to arbitrary finite products,

j=1mΦj(𝐮j)𝐰𝐭j(D)\displaystyle\prod_{j=1}^{m}\Phi_{j}(\mathbf{u}_{j})^{\mathbf{wt}_{j}(D)}
=1qmnE1,,Emω(D,E1Em)j=1m𝐮j𝐰𝐭j(Ej).\displaystyle\quad=\frac{1}{q^{mn}}\sum_{E_{1},\dots,E_{m}}\omega(D,E_{1}\cdots E_{m})\prod_{j=1}^{m}\mathbf{u}_{j}^{\mathbf{wt}_{j}(E_{j})}. (162)

Then by applying the duality relations (160) and (161), we have thus proven the following extension of the theorem to arbitrary products.

Corollary 44 (Generalized Poisson summation for stabilizer codes).

Let \mathfrak{C} be a [[n,k,d]]q[[n,k,d]]_{q} stabilizer code with stabilizer group 𝒮()\mathcal{S}(\mathfrak{C}) and normalizer 𝒩()\mathcal{N}(\mathfrak{C}). Let {𝐰𝐭j}j=1m\{\mathbf{wt}_{j}\}_{j=1}^{m} be scalar weight functions with MacWilliams transforms {Φj}j=1m\{\Phi_{j}\}_{j=1}^{m} respectively. Then

D𝒩()j=1mΦj(𝐮j)𝐰𝐭j(D)\displaystyle\sum_{D\in\mathcal{N}(\mathfrak{C})}\prod_{j=1}^{m}\Phi_{j}(\mathbf{u}_{j})^{\mathbf{wt}_{j}(D)}
=1q(m1)nkE1,,EmnE1Em𝒮()j=1m𝐮j𝐰𝐭j(Ej)\displaystyle\quad=\frac{1}{q^{(m-1)n-k}}\sum_{\text{\tiny$\begin{array}[]{c}E_{1},\dots,E_{m}\in\mathcal{E}^{n}\\ E_{1}\cdots E_{m}\in\mathcal{S}(\mathfrak{C})\end{array}$}}\prod_{j=1}^{m}\mathbf{u}_{j}^{\mathbf{wt}_{j}(E_{j})} (165)

and

D𝒮()j=1mΦj(𝐮j)𝐰𝐭j(D)\displaystyle\sum_{D\in\mathcal{S}(\mathfrak{C})}\prod_{j=1}^{m}\Phi_{j}(\mathbf{u}_{j})^{\mathbf{wt}_{j}(D)}
=1q(m1)n+kE1,,EmnE1Em𝒩()j=1m𝐮j𝐰𝐭j(Ej).\displaystyle\quad=\frac{1}{q^{(m-1)n+k}}\sum_{\text{\tiny$\begin{array}[]{c}E_{1},\dots,E_{m}\in\mathcal{E}^{n}\\ E_{1}\cdots E_{m}\in\mathcal{N}(\mathfrak{C})\end{array}$}}\prod_{j=1}^{m}\mathbf{u}_{j}^{\mathbf{wt}_{j}(E_{j})}. (168)

We can extend Theorem 43 in a different direction. Given a logical operator LL on our code \mathfrak{C} we “twist” the left sum by introducing ω(D,L)\omega(D,L^{\dagger}) into the summand. As we show in the following result, this will allow us to count error paths whose product lies in the LL-coset of the stabilizer 𝒮()\mathcal{S}(\mathfrak{C}).

Corollary 45.

Let L𝒩()L\in\mathcal{N}(\mathfrak{C}) be any logical operator. Then

D𝒩()ω(D,L)Φ1(𝐮1)𝐰𝐭1(D)Φ2(𝐮2)𝐰𝐭2(D)\displaystyle\sum_{D\in\mathcal{N}(\mathfrak{C})}\omega(D,L^{\dagger})\Phi_{1}(\mathbf{u}_{1})^{\mathbf{wt}_{1}(D)}\Phi_{2}(\mathbf{u}_{2})^{\mathbf{wt}_{2}(D)}
=1qnE1,E2nE1E2L𝒮()𝐮1𝐰𝐭1(E1)𝐮2𝐰𝐭2(E2).\displaystyle=\frac{1}{q^{n}}\sum_{\text{\tiny$\begin{array}[]{c}E_{1},E_{2}\in\mathcal{E}^{n}\\ E_{1}E_{2}\in L\mathcal{S}(\mathfrak{C})\end{array}$}}\mathbf{u}_{1}^{\mathbf{wt}_{1}(E_{1})}\mathbf{u}_{2}^{\mathbf{wt}_{2}(E_{2})}. (171)
Proof.

Twisting (VII) as described above we have

ω(D,L)Φ1(𝐮1)𝐰𝐭1(D)Φ2(𝐮2)𝐰𝐭2(D)\displaystyle\omega(D,L^{\dagger})\Phi_{1}(\mathbf{u}_{1})^{\mathbf{wt}_{1}(D)}\Phi_{2}(\mathbf{u}_{2})^{\mathbf{wt}_{2}(D)}
=1q2nE1,E2ω(D,LE1E2)𝐮1𝐰𝐭1(E1)𝐮2𝐰𝐭2(E2).\displaystyle\quad=\frac{1}{q^{2n}}\sum_{E_{1},E_{2}}\omega(D,L^{\dagger}E_{1}E_{2})\mathbf{u}_{1}^{\mathbf{wt}_{1}(E_{1})}\mathbf{u}_{2}^{\mathbf{wt}_{2}(E_{2})}. (172)

Then just as in (161) we have

D𝒩()ω(D,LE1E2)={qn+kif E1E2L𝒮(),0otherwise,\sum_{D\in\mathcal{N}(\mathfrak{C})}\omega(D,L^{\dagger}E_{1}E_{2})=\begin{cases}q^{n+k}&\text{if $E_{1}E_{2}\in L\mathcal{S}(\mathfrak{C})$,}\\ 0&\text{otherwise,}\end{cases} (173)

from which the result follows immediately. ∎

This corollary can also be extended to arbitrary products like in Corollary 44. We leave the details of this to the reader.

VIII Application to Fault-tolerance

The concept of quantum fault-tolerance addresses the issue that quantum operations designed to remove noise from a quantum computation are themselves noisy. Even for well designed circuits, only if the noise in these operations lies below some threshold can one guarantee that enough error correction will ultimately suppress errors and allow robust quantum computation. A critical part of this is understanding how errors accumulate circuits, with the potential of reducing the distance of the code [7, 28, 8, 29]. Such “hook” errors can, with a single error event, produce multiple errors in the domain of a logical operation and so reduce the effective distance that a code can detect.

In many cases hook errors are rare, and so while they may reduce the effective distance of the code, they may not have a large impact on the code’s error correction capability. By that same token, it is often challenging to identify when hook errors exist, how many there are, and their relative severity, particularly with Monte Carlo methods.

In this section, we show how to use circuit enumerators to analyze a syndrome extraction circuit for a stabilizer code, and provide quantitive examples for the perfect code [30] and the distance three and five rotated surface code [31, 32]. Namely, we will count and characterize the error paths that generate a normalizer or a stabilizer in the syndrome extraction circuit. This method enables the quantification of all hook errors within a specific syndrome extraction circuit, along with assessing their severity, under a specified error model.

To validate the method, we have also developed a simulation tool that enumerates all possible error combinations, up to weight 3 errors, and counts all the paths that lead to the same output state as the input state (up to a global phase). When performing this simulation with different logical input states {|0L,|+L,|iL}\{{|{0}\rangle}_{L},{|{+}\rangle}_{L},{|{i}\rangle}_{L}\}, it tallies the error paths leading to a logical II, along with those leading to a logical ZZ, XX, or YY, dependent on the initial input state. See Fig. 7 for an illustration of the simulated circuit.

Refer to caption
Figure 7: An illustration of the simulated circuit used to verify the enumerators’ calculation result. For a distance 3 surface code, we initialize the 9 physical qubits to a logical state |ψL{|{\psi}\rangle}_{L}, then apply Pauli noise to those qubits, following are the noisy projective Pauli measurements (𝒫~P\widetilde{\mathcal{M}\mathcal{P}}_{P}) forming the syndrome extraction. We don’t illustrate the measurement results, as we ignore them during the simulation. Then we count the number of different error paths that output the original input |ψL{|{\psi}\rangle}_{L} state, which are exactly the number of error paths that generate a logical II plus the number of error paths that generate a logical Z,X,Z,X, or YY depending whether |ψL{|{\psi}\rangle}_{L} is |0L{|{0}\rangle}_{L}, |+L{|{+}\rangle}_{L}, or |iL{|{i}\rangle}_{L}.

The rest of this section is organized as follows: we start by developing the circuit tensor for a composition of noisy stabilizer measurements and using Theorem 43 (or more precisely Corollary 44) we show that its trace leads to the enumeration of all the error paths that generate a stabilizer. Next, we simplify the calculation and show how when using only a simple relation between the stabilizers and normalizers we can directly count the error paths that generate a stabilizer or a normalizer. Finally, we provide more information about our validation simulation framework.

Let \mathfrak{C} be a [[n,k]][[n,k]] stabilizer code with stabilizer group 𝒮=𝒮()=S1,Snk\mathcal{S}=\mathcal{S}(\mathfrak{C})=\langle S_{1}\cdots,S_{n-k}\rangle. From Example 28, the circuit tensor of projective measurement of stabilizer SjS_{j} is:

𝐂(𝒫Sj)=E:ω(E,Sj)=1(eEIE+αj(E)e(±ESj)Z(j)E),\mathbf{C}\left({\mathcal{MP}_{S_{j}}}\right)=\sum_{E\>:\>\omega(E,S_{j})=1}(e^{E}_{E\otimes I}+\alpha_{j}(E)e^{E}_{(\pm ES_{j})\otimes Z^{(j)}}), (174)

where Z(j)=IIIZIIZ^{(j)}=I\otimes\cdots\otimes I\otimes I\otimes Z\otimes I\otimes\cdots\otimes I is supported only in the jj-th factor, and as in that example αj(E)={±1}\alpha_{j}(E)=\{\pm 1\} according to whether ESj𝒫nES_{j}\in\mathcal{P}^{n} or ESj𝒫-ES_{j}\in\mathcal{P}.

A syndrome extraction circuit is a composition of stabilizer measurements. For example, the circuit tensor for two consecutive stabilizer measurements is given by:

𝐂(𝒫S1𝒫S2)\displaystyle\mathbf{C}\left({\mathcal{MP}_{S_{1}}\circ\mathcal{MP}_{S_{2}}}\right)
=[ES1(eEIE+α1(E)e(±ES1)Z(1)E)]\displaystyle=\left[\sum_{E\in S_{1}^{\perp}}\left(e^{E}_{E\otimes I}+\alpha_{1}(E)e^{E}_{(\pm ES_{1})\otimes Z^{(1)}}\right)\right]
[ES2(eEIE+α2(E)e(±ES2)Z(2)E)]\displaystyle\qquad\cdot\left[\sum_{E\in S_{2}^{\perp}}\left(e^{E}_{E\otimes I}+\alpha_{2}(E)e^{E}_{(\pm ES_{2})\otimes Z^{(2)}}\right)\right]
=ES1S2α1(E)e(±ES1)Z(1)E+α2(E)e(±ES2)Z(2)E\displaystyle=\sum_{E\in S_{1}^{\perp}\cap S_{2}^{\perp}}\alpha_{1}(E)e^{E}_{(\pm ES_{1})\otimes Z^{(1)}}+\alpha_{2}(E)e^{E}_{(\pm ES_{2})\otimes Z^{(2)}}
+eEIE+α(1,2)(E)e(±ES1S2)Z(1)Z(2)E.\displaystyle\qquad+e^{E}_{E\otimes I}+\alpha_{(1,2)}(E)e^{E}_{(\pm ES_{1}S_{2})\otimes Z^{(1)}Z^{(2)}}. (175)

Here, for simplicty we write α(1,2)(E)=α1(E)α2(E)\alpha_{(1,2)}(E)=\alpha_{1}(E)\alpha_{2}(E) and Sj={E𝒫n:ω(E,Sj)=1}S_{j}^{\perp}=\{E\in\mathcal{P}^{n}\>:\>\omega(E,S_{j})=1\}.

If we recursively perform the concatenation on all of the stabilizer measurements, we get the circuit tensor of the syndrome extraction circuit:

𝐂(𝒫S1𝒫Snk)=i=1nkESi(eEIE+αi(E)e(±ESi)Z(i)E)=i=1nkE𝒩()(eEIE+αi(E)e(±ESi)Z(i)E)=E𝒩()i=1nk(eEIE+αi(E)e(±ESi)Z(i)E)=E𝒩()S𝒮()αS(E)e±ESZ𝚐𝚎𝚗(S)E.\begin{split}&\mathbf{C}\left({\mathcal{MP}_{S_{1}}\circ\cdots\circ\mathcal{MP}_{S_{n-k}}}\right)\\ &\quad=\prod_{i=1}^{n-k}\sum_{E\in S_{i}^{\perp}}(e^{E}_{E\otimes I}+\alpha_{i}(E)e^{E}_{(\pm ES_{i})\otimes Z^{(i)}})\\ &\quad=\prod_{i=1}^{n-k}\sum_{E\in\mathcal{N}(\mathfrak{C})}(e^{E}_{E\otimes I}+\alpha_{i}(E)e^{E}_{(\pm ES_{i})\otimes Z^{(i)}})\\ &\quad=\sum_{E\in\mathcal{N}(\mathfrak{C})}\prod_{i=1}^{n-k}(e^{E}_{E\otimes I}+\alpha_{i}(E)e^{E}_{(\pm ES_{i})\otimes Z^{(i)}})\\ &\quad=\sum_{E\in\mathcal{N}(\mathfrak{C})}\sum_{S\in\mathcal{S}(\mathfrak{C})}\alpha_{S}(E)e^{E}_{\pm ES\otimes Z^{\mathtt{gen}(S)}}.\end{split} (176)

Above we write αS(E)=αj1(E)αj(E)\alpha_{S}(E)=\alpha_{j_{1}}(E)\cdots\alpha_{j_{\ell}}(E) and Z𝚐𝚎𝚗(S)=Z(j1)Z(j)Z^{\mathtt{gen}(S)}=Z^{(j_{1})}\cdots Z^{(j_{\ell})} when S=Sj1SjS=S_{j_{1}}\cdot\cdots\cdot S_{j_{\ell}}.

Recall that for a stabilizer code, the Shor-Laflamme AA-enumerator (15), when evaluated at the projection onto the code, counts the number of stabilizers at each weight. The following result shows that the trace of the circuit tensor of its syndrome extraction circuit composed with a Pauli error channel also performs this enumeration.

Proposition 46.

Let \mathfrak{C} have stabilizer 𝒮()=S1,Snk\mathcal{S}(\mathfrak{C})=\langle S_{1}\cdots,S_{n-k}\rangle and 𝒟~n\widetilde{\mathcal{D}}^{\otimes n} to be the nn-qubit Pauli error channel. Then

Tr[𝐂(𝒫S1𝒫Snk𝒟~n)]=A(w,z;Π)eI.\operatorname{Tr}\left[\mathbf{C}\left({\mathcal{MP}_{S_{1}}\circ\cdots\circ\mathcal{MP}_{S_{n-k}}\circ\widetilde{\mathcal{D}}^{\otimes n}}\right)\right]=A(w,z;\Pi_{\mathfrak{C}})e_{I}. (177)
Proof.

Expanding Proposition 38 we have:

𝐂(𝒟~n)=EPnΦ(𝐮)𝐰𝐭(E)eEE.\mathbf{C}\left({\widetilde{\mathcal{D}}^{\otimes n}}\right)=\sum_{E\in P^{n}}\Phi(\mathbf{u})^{\mathbf{wt}(E)}e^{E}_{E}. (178)

Composing (178) with (176) we get:

𝐂(𝒫S1𝒫Snk𝒟~n)=E𝒩()S𝒮()Φ(𝐮)𝐰𝐭(E)αS(E)e±ESZ𝚐𝚎𝚗(S)E=E𝒩()Φ(𝐮)𝐰𝐭(E)eEIE+ off-diagonal terms.\begin{split}&\mathbf{C}\left({\mathcal{MP}_{S_{1}}\circ\cdots\circ\mathcal{MP}_{S_{n-k}}\circ\widetilde{\mathcal{D}}^{\otimes n}}\right)\\ &=\sum_{E\in\mathcal{N}(\mathfrak{C})}\sum_{S\in\mathcal{S}(\mathfrak{C})}\Phi(\mathbf{u})^{\mathbf{wt}(E)}\alpha_{S}(E)e^{E}_{\pm ES\otimes Z^{\mathtt{gen}(S)}}\\ &=\sum_{E\in\mathcal{N}(\mathfrak{C})}\Phi(\mathbf{u})^{\mathbf{wt}(E)}e^{E}_{E\otimes I}+\text{ off-diagonal terms.}\end{split} (179)

Where the first part of the summation is for S=IS=I. Therefore, when we take the trace we take the trace and keep only the diagonal terms we get:

Tr[𝐂(S1Snk𝒟~n)]=E𝒩()Φ(𝐮)𝐰𝐭(E)eI.\begin{split}&\operatorname{Tr}\left[\mathbf{C}\left({\mathcal{M}_{S_{1}}\circ\cdots\circ\mathcal{M}_{S_{n-k}}\circ\widetilde{\mathcal{D}}^{\otimes n}}\right)\right]\\ &\quad=\sum_{E\in\mathcal{N}(\mathfrak{C})}\Phi(\mathbf{u})^{\mathbf{wt}(E)}e_{I}.\end{split} (180)

Now we turn to the case where each operation in the circuit tensor of the syndrome extraction circuit (176) is noisy. In this work, we focus on a simple error model, where each syndrome measurement 𝒫Sj\mathcal{MP}_{S_{j}} suffers from a uniform Pauli error 𝒟~j\widetilde{\mathcal{D}}_{j} on its support. Let us write 𝒫~Sj=𝒟~j𝒫Sj\widetilde{\mathcal{MP}}_{S_{j}}=\widetilde{\mathcal{D}}_{j}\circ\mathcal{MP}_{S_{j}}, and the associated variables and weight function to be (𝐰𝐭j,𝐮j)(\mathbf{wt}_{j},\mathbf{u}_{j}). We can develop the following for a single syndrome measurement:

𝐂(𝒫~Sj)\displaystyle\mathbf{C}\left({\widetilde{\mathcal{MP}}_{S_{j}}}\right) =ESjΦ(𝐮j)𝐰𝐭j(E)eEIE\displaystyle=\sum_{E\in S_{j}^{\perp}}\Phi(\mathbf{u}_{j})^{\mathbf{wt}_{j}(E)}e^{E}_{E\otimes I}
+αj(E)Φ(𝐮j)𝐰𝐭j(ES)e(±ESj)Z(j)E.\displaystyle\quad\quad+\alpha_{j}(E)\Phi(\mathbf{u}_{j})^{\mathbf{wt}_{j}(ES)}e^{E}_{(\pm ES_{j})\otimes Z^{(j)}}. (181)

By concatenating all the noisy syndrome measurements together with an initial decoherence channel, for which we specify (𝐰𝐭,𝐮)(\mathbf{wt},\mathbf{u}), we get:

𝐂(~S1~Snk𝒟~n)=\displaystyle\mathbf{C}\left({\widetilde{\mathcal{M}}_{S_{1}}\circ\cdots\circ\widetilde{\mathcal{M}}_{S_{n-k}}\circ\widetilde{\mathcal{D}}^{\otimes n}}\right)=
E𝒩()Φ(𝐮1)𝐰𝐭1(E)Φ(𝐮nk)𝐰𝐭nk(E)Φ(𝐮)𝐰𝐭(E)eEIE\displaystyle\sum_{E\in\mathcal{N}(\mathfrak{C})}\Phi(\mathbf{u}_{1})^{\mathbf{wt}_{1}(E)}\cdots\Phi(\mathbf{u}_{n-k})^{\mathbf{wt}_{n-k}(E)}\Phi(\mathbf{u})^{\mathbf{wt}(E)}e^{E}_{E\otimes I}
+ off-diagonal terms.\displaystyle\qquad+\text{ off-diagonal terms.} (182)

The derivation of (VIII) follows the same path as the derivation of (176) and the proof of Proposition 46.

Next, we will provide two examples (47) and (48) showcasing the steps needed to take starting from the stabilizers group to get the ApathA_{\text{path}} and BpathB_{\text{path}} enumerators. Rather than creating and tracing the appropriate circuit tensor, as suggested by Proposition 46, we will use Therom 43 and perform a simple weighted counting procedure. The noise model we will consider will be a decoherence channel before the syndrome extraction circuit, a Pauli error on the qubits that take part in a projective measurement, and Pauli idling errors for qubits outside the measurement.

To facilitate the enumeration we will use the following variables, weight functions, and MacWilliams transforms:

  • Initial decoherence channel will use the zz variable— 𝐮=(wz,z)\mathbf{u}=(w_{z},z), the weight function

    𝚠𝚝(P)={(1,0)P=I(0,1)P{X,Y,Z},\mathtt{wt}(P)=\begin{cases}(1,0)&P=I\\ (0,1)&P\in\{X,Y,Z\}\end{cases}, (183)

    and the MacWilliams transform of

    Φ(wz,z)=(wz+3z2,wzz2).\Phi(w_{z},z)=(\tfrac{w_{z}+3z}{2},\tfrac{w_{z}-z}{2}). (184)
  • Pauli errors on rr measured qubits for the stabilizer SiS_{i} will use the mim_{i} variable— 𝐮mi=(wmi,mi)\mathbf{u}_{m_{i}}=(w_{m_{i}},m_{i}), the weight function

    𝚠𝚝mi(P)={(1,0)jsupp(Si)Pj=Ir(0,1)jsupp(Si)PjIr,\mathtt{wt}_{m_{i}}(P)=\begin{cases}(1,0)&\bigotimes_{j\in\mathrm{supp}(S_{i})}P_{j}=I^{\otimes r}\\ (0,1)&\bigotimes_{j\in\mathrm{supp}(S_{i})}P_{j}\neq I^{\otimes r}\end{cases}, (185)

    and the MacWilliams transform of

    Φ(wmi,mi)=(wmi+(4r1)mi2r,wmimi2r).\Phi(w_{m_{i}},m_{i})=(\tfrac{w_{m_{i}}+(4^{r}-1)m_{i}}{2^{r}},\tfrac{w_{m_{i}}-m_{i}}{2^{r}}). (186)
  • Pauli errors on the idling qubit during the measurement of SiS_{i} stabilizer will use the cic_{i} variable — 𝐮ci=(wci,ci)\mathbf{u}_{c_{i}}=(w_{c_{i}},c_{i}), the weight function

    𝚠𝚝ci(P)\displaystyle\mathtt{wt}_{c_{i}}(P) =(a,b) where\displaystyle=(a,b)\text{ where}
    a=|{Pj|Pj=I}joff_supp(Si)|\displaystyle a=|\{P_{j}|P_{j}=I\}_{j\in\mathrm{off\_supp}(S_{i})}|
    b=|{Pj|PjI}joff_supp(Si)|,\displaystyle b=|\{P_{j}|P_{j}\neq I\}_{j\in\mathrm{off\_supp}(S_{i})}|, (187)

    and the MacWilliams transform of

    Φ(wci,ci)=(wci+3ci2,wcici2).\Phi(w_{c_{i}},c_{i})=(\tfrac{w_{c_{i}}+3c_{i}}{2},\tfrac{w_{c_{i}}-c_{i}}{2}). (188)

We would like to emphasize that this is a worst-case error model, where a single measurement error can affect all of the measured qubits.

Just to illustrate how to apply the weight functions (185) (VIII), consider the Pauli string S1=𝚇𝚉𝚉𝚇𝙸S_{1}=\mathtt{XZZXI}. This operator has support on the first four qubits, hence when we are to calculate the weight function 𝚠𝚝m1\mathtt{wt}_{m_{1}} on any Pauli string, we first choose the first four factors (the indexes that S1S_{1} supports) and check if that is the identity I4I^{\otimes 4}. For example, for the Pauli string 𝙸𝚇𝚉𝚉𝚇\mathtt{IXZZX}, the supported substring is 𝙸𝚇𝚉𝚉I4\mathtt{IXZZ}\neq I^{\otimes 4} hence 𝚠𝚝m1(𝙸𝚇𝚉𝚉𝚇)=(0,1)\mathtt{wt}_{m_{1}}(\mathtt{IXZZX})=(0,1).

In a similar vein, if measuring S1S_{1} only the fifth qubit is idle, and so we can compute 𝚠𝚝c1\mathtt{wt}_{c_{1}} on a Pauli string by checking if its fifth factor is II. For example, we get 𝚠𝚝c1(𝙸𝚇𝚉𝚉𝚇)=(0,1)\mathtt{wt}_{c_{1}}(\mathtt{IXZZX})=(0,1) while 𝚠𝚝c1(𝚈𝚇𝚇𝚈𝙸)=(1,0)\mathtt{wt}_{c_{1}}(\mathtt{YXXYI})=(1,0).

Example 47 (Analysis of a noisy syndrome extraction for the perfect code).

Let us consider the generating set of 𝒮=𝚇𝚉𝚉𝚇𝙸,𝙸𝚇𝚉𝚉𝚇,𝚇𝙸𝚇𝚉𝚉,𝚉𝚇𝙸𝚇𝚉\mathcal{S}=\langle\mathtt{XZZXI},\mathtt{IXZZX},\mathtt{XIXZZ},\mathtt{ZXIXZ}\rangle. Just as above, we can calculate the appropriate weight functions for each of the elements in the set. For example, for S2=𝙸𝚇𝚉𝚉𝚇S_{2}=\mathtt{IXZZX} one can easily calculate have the following:

𝚠𝚝m2(𝚇𝙸𝚇𝚉𝚉)=(0,1)𝚠𝚝c2(𝚇𝙸𝚇𝚉𝚉)=(0,1)𝚠𝚝m2(𝙸𝚉𝚈𝚈𝚉)=(0,1)𝚠𝚝c2(𝙸𝚉𝚈𝚈𝚉)=(1,0).\begin{tabular}[]{cc}$\mathtt{wt}_{m_{2}}(\mathtt{XIXZZ})=(0,1)$&$\mathtt{wt}_{c_{2}}(\mathtt{XIXZZ})=(0,1)$\\ $\mathtt{wt}_{m_{2}}(\mathtt{IZYYZ})=(0,1)$&$\mathtt{wt}_{c_{2}}(\mathtt{IZYYZ})=(1,0)$\end{tabular}. (189)

Performing a simple counting operation over all normalizers and stabilizers we get the following:

E𝒮()\displaystyle\sum_{E\in\mathcal{S}(\mathfrak{C})} 𝐮m1𝚠𝚝m1(E)𝐮c1𝚠𝚝c1(E)𝐮m4𝚠𝚝m4(E)𝐮c4𝚠𝚝c4(E)𝐮𝚠𝚝(E)=\displaystyle\mathbf{u}_{m_{1}}^{\mathtt{wt}_{m_{1}}(E)}\mathbf{u}_{c_{1}}^{\mathtt{wt}_{c_{1}}(E)}\cdots\mathbf{u}_{m_{4}}^{\mathtt{wt}_{m_{4}}(E)}\mathbf{u}_{c_{4}}^{\mathtt{wt}_{c_{4}}(E)}\mathbf{u}^{\mathtt{wt}(E)}=
wc4wm4wz5+3c4m4wzz4+12c3m4wcwzz4,\displaystyle w_{c}^{4}w_{m}^{4}w_{z}^{5}+3c^{4}m^{4}w_{z}z^{4}+12c^{3}m^{4}w_{c}w_{z}z^{4}, (190)
E𝒩()\displaystyle\sum_{E\in\mathcal{N}(\mathfrak{C})} 𝐮m1𝚠𝚝m1(E)𝐮c1𝚠𝚝c1(E)𝐮m4𝚠𝚝m4(E)𝐮c4𝚠𝚝c4(E)𝐮𝚠𝚝(E)=\displaystyle\mathbf{u}_{m_{1}}^{\mathtt{wt}_{m_{1}}(E)}\mathbf{u}_{c_{1}}^{\mathtt{wt}_{c_{1}}(E)}\cdots\mathbf{u}_{m_{4}}^{\mathtt{wt}_{m_{4}}(E)}\mathbf{u}_{c_{4}}^{\mathtt{wt}_{c_{4}}(E)}\mathbf{u}^{\mathtt{wt}(E)}=
wc4wm4wz5+12c3m4wcwz2z3+18c2m4wc2wz2z3\displaystyle w_{c}^{4}w_{m}^{4}w_{z}^{5}+12c^{3}m^{4}w_{c}w_{z}^{2}z^{3}+18c^{2}m^{4}w_{c}^{2}w_{z}^{2}z^{3}
+3c4m4wzz4+12c3m4wcwzz4+18c4m4z5.\displaystyle+3c^{4}m^{4}w_{z}z^{4}+12c^{3}m^{4}w_{c}w_{z}z^{4}+18c^{4}m^{4}z^{5}. (191)

To get the analogues of the Shor-Laflamme enumerators AA and BB, we will follow Theorem 43 and use the MacWilliams transforms (184), (186), (188)) on the above expressions (47) and (47). Let ApathA_{\text{path}} and BpathB_{\text{path}} be the enumerators that count the paths leading to stabilizers (44) and normalizers (44) respectively.

For ease of presentation, we are showing the normalized unhomogenized result up to the third order:

Bpath\displaystyle B_{\text{path}} =1+60m+960mz+12cz+24390m2+768cm\displaystyle=1+60m+960mz+12cz+24390m^{2}+768cm
+30z3+5760mz2+72cz2+365760m2z\displaystyle+30z^{3}+5760mz^{2}+72cz^{2}+365760m^{2}z
+11472cmz+54c2z+4145340m3+292608cm2\displaystyle+11472cmz+54c^{2}z+4145340m^{3}+292608cm^{2}
+3456c2m+12c3+,\displaystyle+3456c^{2}m+12c^{3}+\cdots, (192)
Apath\displaystyle A_{\text{path}} =1+12m+240mz+12cz+6102m2+192cm\displaystyle=1+12m+240mz+12cz+6102m^{2}+192cm
+1440mz2+91440m2z+2832cmz+1036332m3\displaystyle+1440mz^{2}+91440m^{2}z+2832cmz+1036332m^{3}
+73152cm2+864c2m+.\displaystyle+73152cm^{2}+864c^{2}m+\cdots. (193)

We can further subtract ApathA_{\text{path}} from BpathB_{\text{path}} and get a count of all the error paths leading to a nontrivial logical error:

BpathApath=48m+720mz+18288m2+576cm+30z3+4320mz2+72cz2+274320m2z+8640cmz+54c2z+3109008m3+219456cm2+2592c2m+12c3+.\begin{split}B_{\text{path}}-A_{\text{path}}&=48m+720mz+18288m^{2}+576cm+30z^{3}\\ &+4320mz^{2}+72cz^{2}+274320m^{2}z+8640cmz\\ &+54c^{2}z+3109008m^{3}+219456cm^{2}\\ &+2592c^{2}m+12c^{3}+\cdots.\end{split} (194)
Example 48 (Analysis of a noisy syndrome extraction for the distance 3 rotated surface code).

Let us consider the standard plaquettes in the distance 3 rotated surface code [31]:

𝒮\displaystyle\mathcal{S} =𝚉𝚉𝙸𝚉𝚉𝙸𝙸𝙸𝙸,𝙸𝙸𝙸𝙸𝚉𝚉𝙸𝚉𝚉,𝙸𝚇𝚇𝙸𝚇𝚇𝙸𝙸𝙸,𝙸𝙸𝙸𝚇𝚇𝙸𝚇𝚇𝙸,\displaystyle=\langle\mathtt{ZZIZZIIII},\mathtt{IIIIZZIZZ},\mathtt{IXXIXXIII},\mathtt{IIIXXIXXI},
𝙸𝙸𝚉𝙸𝙸𝚉𝙸𝙸𝙸,𝙸𝙸𝙸𝚉𝙸𝙸𝚉𝙸𝙸,𝚇𝚇𝙸𝙸𝙸𝙸𝙸𝙸𝙸,𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝚇𝚇.\displaystyle\qquad\mathtt{IIZIIZIII},\mathtt{IIIZIIZII},\mathtt{XXIIIIIII},\mathtt{IIIIIIIXX}\rangle. (195)

Some of the plaquettes have 4 qubits while others have only 2, thus we want to distinguish between them in our enumeration. We will do that by using two different variables m4m_{4} and m2m_{2}. We will use the same counting variables and weight functions for the initial errors and the idling errors as in Example 47, while for the measurement errors, we have m4m_{4} and m2m_{2} as counting variables and the respective 𝚠𝚝m4\mathtt{wt}_{m_{4}} and 𝚠𝚝m2\mathtt{wt}_{m_{2}} weight functions.

Table I contains the (unhomogenized) monomials for 8 out of the 256 stabilizers. When summing over all the products of the stabilizers we get the following unhomogenized polynomial:

1+4m42m2c11z2+8m44m22c20z4+8m44m22c21z4\displaystyle 1+4m_{4}^{2}m_{2}c^{11}z^{2}+8m_{4}^{4}m_{2}^{2}c^{20}z^{4}+8m_{4}^{4}m_{2}^{2}c^{21}z^{4}
+4m43m22c22z4+2m44m22c22z4+32m44m23c31z6\displaystyle\ +4m_{4}^{3}m_{2}^{2}c^{22}z^{4}+2m_{4}^{4}m_{2}^{2}c^{22}z^{4}+32m_{4}^{4}m_{2}^{3}c^{31}z^{6}
+32m44m23c32z6+8m44m24c32z6+4m44m23c33z6\displaystyle\ +32m_{4}^{4}m_{2}^{3}c^{32}z^{6}+8m_{4}^{4}m_{2}^{4}c^{32}z^{6}+4m_{4}^{4}m_{2}^{3}c^{33}z^{6}
+16m44m24c33z6+8m44m24c34z6+56m44m24c42z8\displaystyle\ +16m_{4}^{4}m_{2}^{4}c^{33}z^{6}+8m_{4}^{4}m_{2}^{4}c^{34}z^{6}+56m_{4}^{4}m_{2}^{4}c^{42}z^{8}
+56m44m24c43z8+17m44m24c44z8.\displaystyle\ +56m_{4}^{4}m_{2}^{4}c^{43}z^{8}+17m_{4}^{4}m_{2}^{4}c^{44}z^{8}. (196)

Following Therom 43 we can calculate the ApathA_{\text{path}} and BpathB_{\text{path}} enumerators. For ease of presentation, we are showing the normalized unhomogenized result up to the third order:

Bpath\displaystyle B_{\text{path}} =1+16m+438c2+188cz+1952cm+4z2\displaystyle=1+16m+438c^{2}+188cz+1952cm+4z^{2}
+368mz+3228m2+5432c3+3358c2z+92600c2m\displaystyle+368mz+3228m^{2}+5432c^{3}+3358c^{2}z+92600c^{2}m
+432cz2+36160czm+395744cm2+2832mz2\displaystyle+432cz^{2}+36160czm+395744cm^{2}+2832mz^{2}
+74600m2z+403280m3+24z3+,\displaystyle+74600m^{2}z+403280m^{3}+24z^{3}+\cdots, (197)
Apath\displaystyle A_{\text{path}} =1+16m+438c2+188cz+1320cm+4z2\displaystyle=1+16m+438c^{2}+188cz+1320cm+4z^{2}
+256mz+1516m2+1824c3+1316c2z+44224c2m\displaystyle+256mz+1516m^{2}+1824c^{3}+1316c^{2}z+44224c^{2}m
+88cz2+17992czm+150744cm2+1264mz2\displaystyle+88cz^{2}+17992czm+150744cm^{2}+1264mz^{2}
+28880m2z+114192m3+.\displaystyle+28880m^{2}z+114192m^{3}+\cdots. (198)

We can further subtract ApathA_{\text{path}} from BpathB_{\text{path}} and get a count of all the error paths leading to a nontrivial logical error:

Bpath\displaystyle B_{\text{path}} Apath=632cm+112mz+1712m2+3608c3\displaystyle-A_{\text{path}}=632cm+112mz+1712m^{2}+3608c^{3}
+2042c2z+48376c2m+344cz2+18168czm\displaystyle+2042c^{2}z+48376c^{2}m+344cz^{2}+18168czm
+245000cm2+1568mz2+45720m2z+289088m3\displaystyle+245000cm^{2}+1568mz^{2}+45720m^{2}z+289088m^{3}
+24z3+.\displaystyle+24z^{3}+\cdots. (199)

When discarding any idling errors in (48) we have 144,336 error paths with 3 errors that lead to a logical II. Using the observation in Corollary 45 we can calculate the error paths enumerators that lead to any specific logical error in the syndrome extraction circuit. For the logical XX or ZZ errors, the number of paths with 3 errors is 120,260 while for the logical YY the number is 95,880.

Stabilizer 𝐮1wt1\mathbf{u}_{1}^{\mathrm{wt}_{1}} 𝐮2wt2\mathbf{u}_{2}^{\mathrm{wt}_{2}} 𝐮3wt3\mathbf{u}_{3}^{\mathrm{wt}_{3}} 𝐮4wt4\mathbf{u}_{4}^{\mathrm{wt}_{4}} 𝐮5wt5\mathbf{u}_{5}^{\mathrm{wt}_{5}} 𝐮6wt6\mathbf{u}_{6}^{\mathrm{wt}_{6}} 𝐮7wt7\mathbf{u}_{7}^{\mathrm{wt}_{7}} 𝐮8wt8\mathbf{u}_{8}^{\mathrm{wt}_{8}} 𝐮wt\mathbf{u}^{\mathrm{wt}} product
𝚉𝚉𝙸𝚉𝚉𝙸𝙸𝙸𝙸\mathtt{ZZIZZIIII} m4m_{4} m4c3m_{4}c^{3} m4c2m_{4}c^{2} m4c2m_{4}c^{2} c4c^{4} m2c3m_{2}c^{3} m2c2m_{2}c^{2} c4c^{4} z4z^{4} m44m22c20z4m_{4}^{4}m_{2}^{2}c^{20}z^{4}
𝙸𝙸𝙸𝙸𝚉𝚉𝙸𝚉𝚉\mathtt{IIIIZZIZZ} m4c3m_{4}c^{3} m4m_{4} m4c2m_{4}c^{2} m4c2m_{4}c^{2} m2c3m_{2}c^{3} c4c^{4} c4c^{4} m2c2m_{2}c^{2} z4z^{4} m44m22c20z4m_{4}^{4}m_{2}^{2}c^{20}z^{4}
𝙸𝚇𝚇𝙸𝚇𝚇𝙸𝙸𝙸\mathtt{IXXIXXIII} m4c2m_{4}c^{2} m4c2m_{4}c^{2} m4m_{4} m4c3m_{4}c^{3} m2c2m_{2}c^{2} c4c^{4} m2c3m_{2}c^{3} c4c^{4} z4z^{4} m44m22c20z4m_{4}^{4}m_{2}^{2}c^{20}z^{4}
𝙸𝙸𝙸𝚇𝚇𝙸𝚇𝚇𝙸\mathtt{IIIXXIXXI} m4c2m_{4}c^{2} m4c2m_{4}c^{2} m4c3m_{4}c^{3} m4m_{4} c4c^{4} m2c2m_{2}c^{2} c4c^{4} m2c3m_{2}c^{3} z4z^{4} m44m22c20z4m_{4}^{4}m_{2}^{2}c^{20}z^{4}
𝙸𝙸𝚉𝙸𝙸𝚉𝙸𝙸𝙸\mathtt{IIZIIZIII} c2c^{2} m4cm_{4}c m4m_{4} c2c^{2} m2m_{2} c2c^{2} c2c^{2} c2c^{2} z2z^{2} m42m2c11z2m_{4}^{2}m_{2}c^{11}z^{2}
𝙸𝙸𝙸𝚉𝙸𝙸𝚉𝙸𝙸\mathtt{IIIZIIZII} m4cm_{4}c c2c^{2} c2c^{2} m4m_{4} c2c^{2} m2m_{2} c2c^{2} c2c^{2} z2z^{2} m42m2c11z2m_{4}^{2}m_{2}c^{11}z^{2}
𝚇𝚇𝙸𝙸𝙸𝙸𝙸𝙸𝙸\mathtt{XXIIIIIII} m4m_{4} c2c^{2} m4cm_{4}c c2c^{2} c2c^{2} c2c^{2} m2m_{2} c2c^{2} z2z^{2} m42m2c11z2m_{4}^{2}m_{2}c^{11}z^{2}
𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝚇𝚇\mathtt{IIIIIIIXX} c2c^{2} m4m_{4} c2c^{2} m4cm_{4}c c2c^{2} c2c^{2} c2c^{2} m2m_{2} z2z^{2} m42m2c11z2m_{4}^{2}m_{2}c^{11}z^{2}
TABLE I: The (unhomogenized) variables with their appropriate weight for the distance 3 rotated surface code. We show only 8 out of the 256 stabilizers

Next, we describe the simulation we used to validate the results of Example 48.

The noise model we considered in the simulation has two types of errors. The first is a Pauli error affecting one or more of the data qubits even before starting the syndrome extraction circuit. The second error is a post-measurement Pauli error, that is applied to one or more of the plaquettes. For example, in the 4-qubit plaquette, the possible errors are any four Pauli except IIIIIIII. See Fig. 7 for the simulated circuit and more information about the counting.

To generate the logical zero state we initialized all of the data qubits to |0{|{0}\rangle} and then performed a noiseless syndrome extraction. Similarly, to generate the |+L{|{+}\rangle}_{L} state we initialized all of the data qubits to |+{|{+}\rangle} before performing the noiseless syndrome extraction. Before running the syndrome extraction circuit with noise in different locations, we initialized the data qubits to one of the saved logical states.

In total, we considered 104,183,380 possible combinations of errors. The simulation time for each different initial state was about 1000 core hours. The circuit enumerator calculations took only a few seconds using Sage [33].

When initializing the data qubits to |0L{|{0}\rangle}_{L}, we got 264,596 possible error paths, with 3 errors, that generate a logical II or a logical ZZ. The same number of error paths was calculated when we initialized the data qubits to |+L{|{+}\rangle}_{L}. These numbers align perfectly with those calculated in Example 48, as 144336+120260=264596144336+120260=264596.

We conclude this section with the ApathA_{\text{path}} and BpathB_{\text{path}} enumerators for the distance five rotated surface code syndrome extraction circuit. In Example 48 we have shown how to efficiently calculate these enumerators for the distance 3 rotated surface code syndrome extraction circuit.

We will use the standard plaquettes of the distance five rotated surface code, as shown in Fig. 8. The generator group we use can be seen in Appendix A. The enumerators’ calculation for the distance five code follows the same path as presented in Example 48, resulting in the error paths enumerators below. We present the results up to degree 5.

Refer to caption
Figure 8: Standard plaquettes of the distance five rotated surface code — The vertices represent the physical qubits, while the purple and pink patches represent ZZ and XX stabilizers respectively. The complete generator group can be found in Appendix A.
Bpath=1+40m+8z2+704mz+4892m2+3656mz2+106568m2z+606632m3+72z4+16960mz3+1156208m2z2+19015984m3z+94658202m4+160z5+73040mz4+8544672m2z3+292544120m3z2+3723068248m4z+16168935704m5+\begin{split}B_{\text{path}}&=1+40m+8z^{2}+704mz+4892m^{2}+3656mz^{2}\\ &+106568m^{2}z+606632m^{3}+72z^{4}+16960mz^{3}\\ &+1156208m^{2}z^{2}+19015984m^{3}z+94658202m^{4}\\ &+160z^{5}+73040mz^{4}+8544672m^{2}z^{3}\\ &+292544120m^{3}z^{2}+3723068248m^{4}z\\ &+16168935704m^{5}+\cdots\end{split} (200)
Apath=1+40m+8z2+704mz+4892m2+3656mz2+103440m2z+548712m3+72z4+15424mz3+1046000m2z2+15997312m3z+71438618m4+52816mz4+6800352m2z3+222326424m3z2+2569524432m4z+9919808920m5+\begin{split}A_{\text{path}}&=1+40m+8z^{2}+704mz+4892m^{2}+3656mz^{2}\\ &+103440m^{2}z+548712m^{3}+72z^{4}+15424mz^{3}\\ &+1046000m^{2}z^{2}+15997312m^{3}z+71438618m^{4}\\ &+52816mz^{4}+6800352m^{2}z^{3}+222326424m^{3}z^{2}\\ &+2569524432m^{4}z+9919808920m^{5}+\cdots\end{split} (201)
BpathApath=57920m3+3128m2z+110208m2z2+3018672m3z+1536mz3+1744320m2z3+20224mz4+6249126784m5+1153543816m4z+23219584m4+70217696m3z2+160z5+\begin{split}B_{\text{path}}-A_{\text{path}}&=57920m^{3}+3128m^{2}z+110208m^{2}z^{2}\\ &+3018672m^{3}z+1536mz^{3}+1744320m^{2}z^{3}\\ &+20224mz^{4}+6249126784m^{5}\\ &+1153543816m^{4}z+23219584m^{4}\\ &+70217696m^{3}z^{2}+160z^{5}+\cdots\end{split} (202)

Executing the enumerators’ calculation required approximately 30 hours using our Sage code running on a single laptop CPU core. Given our current approach validation approach, conducting such a simulation would be unfeasible due to the necessity of considering 6,395,354,893,463,716 potential error paths.

IX Conclusions

In this paper, we presented a novel approach to analyze circuits and error models in the context of quantum error correction. By introducing the concept of circuit enumerators, we have extended the framework of tensor enumerators to address the specific challenges posed by fault-tolerant quantum circuits. We developed all the necessary machinery to analyze any quantum circuit. Our methodology offers a promising alternative to Monte Carlo techniques, providing an explicit means of analyzing circuits without sacrificing accuracy.

With the development of an analogue of the Poisson summation formula tailored for stabilizer codes, we have demonstrated the efficacy of our approach in rapidly enumerating error paths within syndrome extraction circuits. This advancement is particularly significant as it enables the exact computation of error probabilities, even for larger circuits and rare error events, where traditional computational methods become intractable.

The explicit counting of error paths in a distance five surface code serves as a great example of the utility and effectiveness of our approach. By showcasing scenarios previously deemed infeasible via simulation, we have highlighted the practical relevance of circuit enumerators in the realm of quantum error correction.

Looking forward, the development and usage of circuit enumerators hold promise for advancing the field of quantum computation. Future research may focus on using the methodology to tackle complex quantum circuits other than syndrome extractions. Furthermore, in our example, we ignored the syndrome measurement result, while there is value in taking that into account as well.

References

  • [1] Peter W Shor. Fault-tolerant quantum computation. In Proceedings of 37th conference on foundations of computer science, pages 56–65. IEEE, 1996.
  • [2] Daniel Gottesman. Theory of fault-tolerant quantum computation. Physical Review A, 57(1):127, 1998.
  • [3] John Preskill. Fault-tolerant quantum computation. In Introduction to quantum computation and information, pages 213–269. World Scientific, 1998.
  • [4] Emanuel Knill. Fault-tolerant postselected quantum computation: Schemes. arXiv preprint quant-ph/0402171, 2004.
  • [5] Emanuel Knill. Fault-tolerant postselected quantum computation: Threshold analysis. arXiv preprint quant-ph/0404104, 2004.
  • [6] David S Wang, Austin G Fowler, Ashley M Stephens, and Lloyd CL Hollenberg. Threshold error rates for the toric and surface codes. arXiv preprint arXiv:0905.0531, 2009.
  • [7] Eric Dennis, Alexei Kitaev, Andrew Landahl, and John Preskill. Topological quantum memory. Journal of Mathematical Physics, 43(9):4452–4505, 2002.
  • [8] Michael E Beverland, Shilin Huang, and Vadym Kliuchnikov. Fault tolerance of stabilizer channels. arXiv preprint arXiv:2401.12017, 2024.
  • [9] ChunJun Cao and Brad Lackey. Quantum weight enumerators and tensor networks. IEEE Transactions on Information Theory, December 2023.
  • [10] Emanuel Knill. Group representations, error bases and quantum codes. arXiv preprint quant-ph/9608049, 1996.
  • [11] Emanuel Knill. Non-binary unitary error bases and quantum codes. arXiv preprint quant-ph/9608048, 1996.
  • [12] AA Klappenecker and M Rotteler. Beyond stabilizer codes I. Nice error bases. IEEE Transactions on Information Theory, 48(8):2392–2395, 2002.
  • [13] Michael A. Nielsen and Isaac L. Chuang. Quantum Computation and Quantum Information: 10th Anniversary Edition. Cambridge University Press, 2010.
  • [14] Peter Shor and Raymond Laflamme. Quantum analog of the MacWilliams identities for classical coding theory. Physical review letters, 78(8):1600, 1997.
  • [15] Eric M Rains. Quantum weight enumerators. IEEE Transactions on Information Theory, 44(4):1388–1394, 1998.
  • [16] Chuangqiang Hu, Shudi Yang, and Stephen S-T Yau. Complete weight distributions and MacWilliams identities for asymmetric quantum codes. IEEE Access, 7:68404–68414, 2019.
  • [17] Chuangqiang Hu, Shudi Yang, and Stephen S-T Yau. Weight enumerators for nonbinary asymmetric quantum codes and their applications. Advances in Applied Mathematics, 121:102085, 2020.
  • [18] Nicolas Delfosse and Adam Paetznick. Spacetime codes of clifford circuits. arXiv preprint arXiv:2304.05943, 2023.
  • [19] J Ignacio Cirac, David Perez-Garcia, Norbert Schuch, and Frank Verstraete. Matrix product states and projected entangled pair states: Concepts, symmetries, theorems. Reviews of Modern Physics, 93(4):045003, 2021.
  • [20] Karol Życzkowski and Ingemar Bengtsson. On duality between quantum maps and quantum states. Open systems & information dynamics, 11(1):3–42, 2004.
  • [21] Min Jiang, Shunlong Luo, and Shuangshuang Fu. Channel-state duality. Physical Review A, 87(2):022310, 2013.
  • [22] David Gosset, Vadym Kliuchnikov, Michele Mosca, and Vincent Russo. An algorithm for the t-count. Quantum Info. Comput., 14(15–16):1261–1276, 2014.
  • [23] Daniel Gottesman. The Heisenberg Representation of Quantum Computers. arXiv preprint quant-ph/9807006, 1998.
  • [24] Man-Duen Choi. Completely positive linear maps on complex matrices. Linear algebra and its applications, 10(3):285–290, 1975.
  • [25] Daniel Litinski. A Game of Surface Codes: Large-Scale Quantum Computing with Lattice Surgery. Quantum, 3:128, 2019.
  • [26] Adam Paetznick and Krysta M Svore. Repeat-until-success: Non-deterministic decomposition of single-qubit unitaries. arXiv preprint arXiv:1311.1074, 2013.
  • [27] Nathan Wiebe and Martin Roetteler. Quantum arithmetic and numerical analysis using repeat-until-success circuits. arXiv preprint arXiv:1406.2040, 2014.
  • [28] Craig Gidney. A pair measurement surface code on pentagons. Quantum, 7:1156, 2023.
  • [29] Linnea Grans-Samuelsson, Ryan V Mishmash, David Aasen, Christina Knapp, Bela Bauer, Brad Lackey, Marcus P da Silva, and Parsa Bonderson. Improved pairwise measurement-based surface code. arXiv preprint arXiv:2310.12981, 2023.
  • [30] Charles H. Bennett, David P. DiVincenzo, John A. Smolin, and William K. Wootters. Mixed-state entanglement and quantum error correction. Physical Review A, 54(5):3824–3851, November 1996.
  • [31] Austin G. Fowler, Matteo Mariantoni, John M. Martinis, and Andrew N. Cleland. Surface codes: Towards practical large-scale quantum computation. Physical Review A, 86(3):032324, September 2012.
  • [32] Rui Chao, Michael E Beverland, Nicolas Delfosse, and Jeongwan Haah. Optimization of the surface code design for majorana-based qubits. Quantum, 4:352, 2020.
  • [33] The Sage Developers. SageMath, the Sage Mathematics Software System (Version 9.5), 2024. https://www.sagemath.org.

Appendix A Stablizer Generator Group for the distance five rotated surface code

For the calculation of enumerators for the distance five rotated surface code we have used the following stabilizer generator group:

𝒮=𝚉𝚉𝙸𝙸𝙸𝚉𝚉𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸,𝙸𝙸𝚉𝚉𝙸𝙸𝙸𝚉𝚉𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸,𝙸𝙸𝙸𝙸𝙸𝙸𝚉𝚉𝙸𝙸𝙸𝚉𝚉𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸,𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝚉𝚉𝙸𝙸𝙸𝚉𝚉𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸,𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝚉𝚉𝙸𝙸𝙸𝚉𝚉𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸,𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝚉𝚉𝙸𝙸𝙸𝚉𝚉𝙸𝙸𝙸𝙸𝙸𝙸,𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝚉𝚉𝙸𝙸𝙸𝚉𝚉𝙸𝙸,𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝚉𝚉𝙸𝙸𝙸𝚉𝚉,𝙸𝚇𝚇𝙸𝙸𝙸𝚇𝚇𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸,𝙸𝙸𝙸𝚇𝚇𝙸𝙸𝙸𝚇𝚇𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸,𝙸𝙸𝙸𝙸𝙸𝚇𝚇𝙸𝙸𝙸𝚇𝚇𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸,𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝚇𝚇𝙸𝙸𝙸𝚇𝚇𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸,𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝚇𝚇𝙸𝙸𝙸𝚇𝚇𝙸𝙸𝙸𝙸𝙸𝙸𝙸,𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝚇𝚇𝙸𝙸𝙸𝚇𝚇𝙸𝙸𝙸𝙸𝙸,𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝚇𝚇𝙸𝙸𝙸𝚇𝚇𝙸𝙸𝙸,𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝚇𝚇𝙸𝙸𝙸𝚇𝚇𝙸,𝙸𝙸𝙸𝙸𝚉𝙸𝙸𝙸𝙸𝚉𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸,𝙸𝙸𝙸𝙸𝙸𝚉𝙸𝙸𝙸𝙸𝚉𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸,𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝚉𝙸𝙸𝙸𝙸𝚉𝙸𝙸𝙸𝙸𝙸,𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝚉𝙸𝙸𝙸𝙸𝚉𝙸𝙸𝙸𝙸,𝚇𝚇𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸,𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝚇𝚇𝙸𝙸,𝙸𝙸𝚇𝚇𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸,𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝙸𝚇𝚇\begin{split}\mathcal{S}=\langle&\mathtt{ZZIIIZZIIIIIIIIIIIIIIIIII},\\ &\mathtt{IIZZIIIZZIIIIIIIIIIIIIIII},\\ &\mathtt{IIIIIIZZIIIZZIIIIIIIIIIII},\\ &\mathtt{IIIIIIIIZZIIIZZIIIIIIIIII},\\ &\mathtt{IIIIIIIIIIZZIIIZZIIIIIIII},\\ &\mathtt{IIIIIIIIIIIIZZIIIZZIIIIII},\\ &\mathtt{IIIIIIIIIIIIIIIIZZIIIZZII},\\ &\mathtt{IIIIIIIIIIIIIIIIIIZZIIIZZ},\\ &\mathtt{IXXIIIXXIIIIIIIIIIIIIIIII},\\ &\mathtt{IIIXXIIIXXIIIIIIIIIIIIIII},\\ &\mathtt{IIIIIXXIIIXXIIIIIIIIIIIII},\\ &\mathtt{IIIIIIIXXIIIXXIIIIIIIIIII},\\ &\mathtt{IIIIIIIIIIIXXIIIXXIIIIIII},\\ &\mathtt{IIIIIIIIIIIIIXXIIIXXIIIII},\\ &\mathtt{IIIIIIIIIIIIIIIXXIIIXXIII},\\ &\mathtt{IIIIIIIIIIIIIIIIIXXIIIXXI},\\ &\mathtt{IIIIZIIIIZIIIIIIIIIIIIIII},\\ &\mathtt{IIIIIZIIIIZIIIIIIIIIIIIII},\\ &\mathtt{IIIIIIIIIIIIIIZIIIIZIIIII},\\ &\mathtt{IIIIIIIIIIIIIIIZIIIIZIIII},\\ &\mathtt{XXIIIIIIIIIIIIIIIIIIIIIII},\\ &\mathtt{IIIIIIIIIIIIIIIIIIIIIXXII},\\ &\mathtt{IIXXIIIIIIIIIIIIIIIIIIIII},\\ &\mathtt{IIIIIIIIIIIIIIIIIIIIIIIXX}\rangle\end{split} (203)

Appendix B Examples of circuit tensor for boolean operations

In this appendix, we provide more examples of circuit tensors for some primitive boolean operations that commonly appear in quantum fault-tolerance circuits.

In Example 21 we constructed the circuit tensor for the xor operation. Here we provide the construction for the and, or, and mux functions.

Example 49 (And circuit tensor).

The operator of and is:

Aand=x0,x1|x0x1x0,x1|L((2)2,2).A_{and}=\sum_{x_{0},x_{1}}{|{x_{0}\land x_{1}}\rangle}\langle{x_{0},x_{1}}|\in L((\mathbb{C}^{2})^{\otimes 2},\mathbb{C}^{2}). (204)

For it, we get the circuit tensor:

C(𝚊𝚗𝚍)ZβZα0Zα1=14x0,x1(1)α0x0α1x1+β(x0x1)\displaystyle C({\mathtt{and}})^{Z^{\alpha_{0}}\otimes Z^{\alpha_{1}}}_{Z^{\beta}}=\tfrac{1}{4}\sum_{x_{0},x_{1}}(-1)^{-\alpha_{0}x_{0}-\alpha_{1}x_{1}+\beta(x_{0}\land x_{1})}
={1 if α0=α1=β=0,(1)α0α112 if β=1,0otherwise.\displaystyle\qquad\qquad=\begin{cases}1&\text{ if $\alpha_{0}=\alpha_{1}=\beta=0$,}\\ (-1)^{\alpha_{0}\alpha_{1}}\frac{1}{2}&\text{ if $\beta=1$,}\\ 0&\text{otherwise.}\end{cases} (205)

Or using a tensor basis

𝐂(𝚊𝚗𝚍)=eIII+12(eZII+eZIZ+eZZIeZZZ).\mathbf{C}\left({\mathtt{and}}\right)=e^{I\otimes I}_{I}+\frac{1}{2}(e^{I\otimes I}_{Z}+e^{I\otimes Z}_{Z}+e^{Z\otimes I}_{Z}-e^{Z\otimes Z}_{Z}). (206)
Example 50 (Or circuit tensor).

The operator of or is:

Aor=x0,x1|x0x1x0,x1|L((2)2,2).A_{or}=\sum_{x_{0},x_{1}}{|{x_{0}\lor x_{1}}\rangle}\langle{x_{0},x_{1}}|\in L((\mathbb{C}^{2})^{\otimes 2},\mathbb{C}^{2}). (207)

For it, we get the circuit tensor:

C(𝚘𝚛)ZβZα0Zα1=14x0,x1(1)α0x0α1x1+β(x0x1)\displaystyle C({\mathtt{or}})^{Z^{\alpha_{0}}\otimes Z^{\alpha_{1}}}_{Z^{\beta}}=\tfrac{1}{4}\sum_{x_{0},x_{1}}(-1)^{-\alpha_{0}x_{0}-\alpha_{1}x_{1}+\beta(x_{0}\lor x_{1})}
={1 if α0=α1=β=0,(1)1+α0α112 if β=1,0otherwise.\displaystyle\qquad=\begin{cases}1&\text{ if $\alpha_{0}=\alpha_{1}=\beta=0$,}\\ (-1)^{1+\alpha_{0}\alpha_{1}}\frac{1}{2}&\text{ if $\beta=1$,}\\ 0&\text{otherwise.}\end{cases} (208)

Or using a tensor basis

𝐂(𝚘𝚛)=eIII+12(eZII+eZIZ+eZZI+eZZZ).\mathbf{C}\left({\mathtt{or}}\right)=e^{I\otimes I}_{I}+\frac{1}{2}(-e^{I\otimes I}_{Z}+e^{I\otimes Z}_{Z}+e^{Z\otimes I}_{Z}+e^{Z\otimes Z}_{Z}). (209)
Example 51 (Mux circuit tensor).

The operator of mux is:

Amux=s,x1,x2|mux(s,x1,x2)s,x1,x2|L((2)3,2).A_{mux}=\sum_{s,x_{1},x_{2}}{|{mux(s,x_{1},x_{2})}\rangle}\langle{s,x_{1},x_{2}}|\in L((\mathbb{C}^{2})^{\otimes 3},\mathbb{C}^{2}). (210)

For it, we get the circuit tensor:

C(𝚖𝚞𝚡)ZβZα0Zα1Zα2\displaystyle C({\mathtt{mux}})^{Z^{\alpha_{0}}\otimes Z^{\alpha_{1}}\otimes Z^{\alpha_{2}}}_{Z^{\beta}}
=18s,x1,x2(1)α0s+α1x1+α2x2+βmux(s,x1,x2)\displaystyle\quad=\tfrac{1}{8}\sum_{s,x_{1},x_{2}}(-1)^{\alpha_{0}s+\alpha_{1}x_{1}+\alpha_{2}x_{2}+\beta\ mux(s,x_{1},x_{2})}
={1 if α0=α1=α2=β=0,(1)α0α212 if β=α1α2=1,0otherwise.\displaystyle\quad=\begin{cases}1&\text{ if $\alpha_{0}=\alpha_{1}=\alpha_{2}=\beta=0$,}\\ (-1)^{\alpha_{0}\alpha_{2}}\frac{1}{2}&\text{ if $\beta=\alpha_{1}\oplus\alpha_{2}=1$,}\\ 0&\text{otherwise.}\end{cases} (211)

Or using a tensor basis

𝐂(𝚖𝚞𝚡)=eIIII\displaystyle\mathbf{C}\left({\mathtt{mux}}\right)=e^{I\otimes I\otimes I}_{I}
+12(eZIIZ+eZIZIeZZIZ+eZZZI).\displaystyle\qquad+\frac{1}{2}(e^{I\otimes I\otimes Z}_{Z}+e^{I\otimes Z\otimes I}_{Z}-e^{Z\otimes I\otimes Z}_{Z}+e^{Z\otimes Z\otimes I}_{Z}). (212)

Appendix C Relation between process matrix and circuit tensor

In this work, we have constructed circuit tensors from the operator representation, or Choi-Kraus form, of a quantum channel. However, another popular representation of a quantum channel arises from its so-called process matrix (usually computed relative to the Pauli basis, but any error basis will suffice). In this appendix, we show that the process matrix of a quantum channel is related to the channel’s circuit tensor precisely by the quantum MacWilliams identity for tensor enumerators, [9].

Definition 52 (Process matrix of a quantum channel).

Let \mathcal{E} be an error basis on a Hilbert space \mathfrak{H} and :\mathcal{M}:\mathfrak{H}\leadsto\mathfrak{H} a quantum channel. The process matrix of \mathcal{M} in the error basis \mathcal{E} is the matrix χEE\chi^{E}_{E^{\prime}} defined implicitly by (ρ)=E,EχEE(E)ρE\mathcal{M}(\rho)=\sum_{E,E^{\prime}}\chi^{E}_{E^{\prime}}(E^{\prime})^{\dagger}\rho E.

Unlike in the case of Kraus operators, the process matrix associated with a quantum channel is unique and completely characterizes the channel. To see this, we extend \mathcal{M} linearly to all linear operators L()L(\mathfrak{H}) and then we could define the process matrix directly as χEE=1dim()Tr(E(E))\chi^{E}_{E^{\prime}}=\frac{1}{\dim(\mathcal{H})}\operatorname{Tr}(E^{\dagger}\mathcal{M}(E^{\prime})).

Like the circuit tensor, we write the process matrix in an index-free form χ=1dim()E,ETr(E(E))eEE\chi=\frac{1}{\dim(\mathcal{H})}\sum_{E,E^{\prime}}\operatorname{Tr}(E^{\dagger}\mathcal{M}(E^{\prime}))e^{E}_{E^{\prime}}.

Note that the matrix is a Hermitian matrix: by definition

(ρ)\displaystyle\mathcal{M}(\rho) =((ρ))=E,EχEE¯EρE\displaystyle=(\mathcal{M}(\rho))^{\dagger}=\sum_{E,E^{\prime}}\overline{\chi^{E}_{E^{\prime}}}E^{\dagger}\rho E^{\prime}
=E,EχEE¯(E)ρE.\displaystyle=\sum_{E,E^{\prime}}\overline{\chi^{E^{\prime}}_{E}}(E^{\prime})^{\dagger}\rho E. (213)

So by uniqueness of the process matrix, χEE¯=χEE\overline{\chi^{E^{\prime}}_{E}}=\chi^{E}_{E^{\prime}}.

It is straightforward to compute the process matrix from a channel’s Kraus operators. Namely, if (ρ)=jAjρAj\mathcal{M}(\rho)=\sum_{j}A_{j}\rho A_{j}^{\dagger} then we expand each Kraus operator as Aj=Eλj,EEA_{j}=\sum_{E}\lambda_{j,E}E^{\dagger}. Then substituting this expression gives

(ρ)=j(E,Eλj,Eλj,E¯)(E)ρE.\mathcal{M}(\rho)=\sum_{j}\left(\sum_{E,E^{\prime}}\lambda_{j,E^{\prime}}\overline{\lambda_{j,E}}\right)(E^{\prime})^{\dagger}\rho E. (214)

And hence we see χEE=jλj,Eλj,E¯\chi^{E}_{E^{\prime}}=\sum_{j}\lambda_{j,E^{\prime}}\overline{\lambda_{j,E}}. Conversely finding Kraus operators from the process matrix of a channel just is a matter of diagonalization.

Following [9], and akin to what appears in §VII, we define the quantum MacWilliams transform of an error basis \mathcal{E} to be the linear operator on matrices indexed by elements of \mathcal{E} given by

Ψ(eEE)=1dim()2F,FTr(FEF(E))eFF.\Psi(e^{E}_{E^{\prime}})=\frac{1}{\dim(\mathfrak{H})^{2}}\sum_{F,F^{\prime}\in\mathcal{E}}\operatorname{Tr}(F^{\dagger}EF^{\prime}(E^{\prime})^{\dagger})e^{F}_{F^{\prime}}. (215)

Then our version of the MacWilliams identity for quantum channels is as follows.

Theorem 53.

Let :\mathcal{M}:\mathfrak{H}\leadsto\mathfrak{H} a quantum channel. Relative to some error basis \mathcal{E}, its circuit tensor 𝐂()\mathbf{C}\left({\mathcal{M}}\right) and process matrix χ\chi satisfy 𝐂()=dim()Ψ(χ)\mathbf{C}\left({\mathcal{M}}\right)=\dim(\mathfrak{H})\Psi(\chi).

Proof.

Let χ\chi be the process matrix of \mathcal{M}, and via diagonalization write χEE=jλj,Eλj,E¯\chi^{E}_{E^{\prime}}=\sum_{j}\lambda_{j,E^{\prime}}\overline{\lambda_{j,E}}. Then as above define Kraus operators Aj=Eλj,EEA_{j}=\sum_{E}\lambda_{j,E}E^{\dagger}. Finally, compute

Ψ(χ)\displaystyle\Psi(\chi) =E,EχEEΨ(eEE)\displaystyle=\sum_{E,E^{\prime}\in\mathcal{E}}\chi^{E}_{E^{\prime}}\Psi(e^{E}_{E^{\prime}})
=1dim()2E,E,F,FχEETr(FEF(E))eFF\displaystyle=\frac{1}{\dim(\mathfrak{H})^{2}}\sum_{E,E^{\prime},F,F^{\prime}}\chi^{E}_{E^{\prime}}\operatorname{Tr}(F^{\dagger}EF^{\prime}(E^{\prime})^{\dagger})e^{F}_{F^{\prime}}
=1dim()2j,E,E,F,Fλj,Eλj,E¯Tr(FEF(E))eFF\displaystyle=\frac{1}{\dim(\mathfrak{H})^{2}}\sum_{j,E,E^{\prime},F,F^{\prime}}\lambda_{j,E^{\prime}}\overline{\lambda_{j,E}}\operatorname{Tr}(F^{\dagger}EF^{\prime}(E^{\prime})^{\dagger})e^{F}_{F^{\prime}}
=1dim()2j,F,FTr(FAjFAj)eFF\displaystyle=\frac{1}{\dim(\mathfrak{H})^{2}}\sum_{j,F,F^{\prime}}\operatorname{Tr}(F^{\dagger}A_{j}^{\dagger}F^{\prime}A_{j})e^{F}_{F^{\prime}}
=1dim()𝐂().\displaystyle=\frac{1}{\dim(\mathfrak{H})}\mathbf{C}\left({\mathcal{M}}\right).