I Introduction
Consider a quantum circuit that is accessible to us but its inner working or the mathematical description are unknown. Then, given a quantum state as an input, what do we know about the circuit output? The goal of this paper is to find a circuit representation that resembles the functioning of so that we are able to predict the output given an arbitrary input . Moreover, we would like to use as few queries to as possible. We term such a problem learning an unknown quantum circuit.
If we focus on only the output state for a particular input state , the problem boils down to determining the state . This is also called quantum state tomography, known as one of the most crucial tasks in quantum information sciences [1, 2, 3, 4]. Its goal is to infer an unknown quantum state (assuming several copies of it are available) through a sequence of quantum measurements in a way so that a proposed candidate state performs well in future predictions. However, this is a nontrivial task. In order to identify an unknown qubit quantum state, one would require exponentially many copies (in the number ) of the state during the tomography process to determine a full description of the state. This makes the task of tomography intractable in practice. To mitigate such difficulties, at least two possible approaches were proposed as follows. Firstly, instead of fully characterizing the mathematical description of the unknown state, one might come up with a state that is Probably Approximately Correct (PAC) [5] when only a particular set of measurements is of interest in future predictions. In this case, Aaronson formulated the state tomography as a learning problem, and proved that only copies of the state are sufficient to obtain a good hypothesis state [6] (see also [7, 8, 9, 10, 11] for the related works). Secondly, one can focus on restricted states with a certain specific structure. For example, stabilizer states are a class of states that play an substantial role in quantum errorcorrecting codes and other computational tasks [12]. Aaronson and Gottesman provided a procedure to identify an unknown qubit stabilizer state with only copies of it if collective measurements are possible [13]. Later, Montanaro proposed an efficient algorithm via Bell sampling that consumes copies of the state and runs in time of order [14]. Rocchetto cast the problem into the PAC learning model, and showed that stabiliser states are efficiently PAC learnable in the sense that the running time is polynomial in [15]. (Note that the number of copies is optimal by Holevo’s theorem [16].)
If now one aims to infer an unknown quantum evolution with certain known input states, this is called quantum process tomography. Once we completely know the underlying evolution, we can determine the final states for arbitrary initial states. This is the target problem we want to study in this paper. Nevertheless, this problem is much more challenging than quantum state tomography. The amount of resources needed for identifying an arbitrary qubit quantum circuit is , which is also practically formidable [17, 18, 19, 20]. When considering a restricted class of Clifford circuits [21], Low showed that an qubit Clifford circuit is determined (up to a global phase) given queries to and queries to its conjugate in time [22]. Moreover, a converse result showed that at least queries is required for such the task [22]. However, no concrete algorithms for reconstructing the circuit representation of the target are provided and one is not capable of predicting the output state of when sending an arbitrary state as input. The first main contribution of this paper is to fulfill this gap. Specifically, we propose a constructive algorithm to efficiently produce the circuit representation of the target circuit by using queries to it. (See Theorem 9 and Algorithm 1 in Section III.)
Theorem 1.
[Learning unknown Clifford circuits] Given access to an unknown Clifford circuit , one can learn a circuit description using queries to it in time , so that the produced hypothesis circuit is equivalent to with probability at least .
Let us emphasize that our approach does not rely on accessing the conjugate circuit (as it was required in [22]) since implementing such the conjugate circuit might incur exponential overhead [23], hence compromising the efficiency of the learning process. The problem of learning an unknown Clifford circuit is closely related to that of learning stabilizer states since the output of a Clifford on input is a stabilizer state. In the proposed Algorithm 1, we adopt Montanaro’s Bell sampling algorithm for learning stabilizer states [14] as a subroutine. Moreover, we employ the stabilizer formalism [12, 24], exploiting the desirable structure of the Pauli group to learn the output stabilizers states. Lastly, by showing that a set of evolved Pauli basis can be identified by changing the input basis state appropriately, we determine the circuit representation of the unknown Clifford circuit via a circuit synthesis procedure.
In the aforementioned task, we heavily rely on the stabilizer formalism. However, it is unknown for a long time whether one can efficiently identify a quantum state that is produced from a quantum device beyond the class of Clifford circuits. In this work, we aim to provide an algorithm to identify the unknown quantum state output produced from a quantum circuit consisting of Clifford gates and a nonClifford gate . This Clifford gate set is universal for quantum computation and receives great attention in faulttolerant quantum computation [25, 26], compiling quantum circuits [27, 28, 29], and quantum circuit simulations [30, 31]. Namely, an arbitrary quantum circuit can be approximately decomposed as a sequence of Clifford stages and stages, alternatively. Here, a Clifford stage is simply a Clifford circuit. In a stage, either a gate or the identity is applied to each qubit^{1}^{1}1We remark that can also be used here but and are equivalent up to a Clifford gate (). For our purpose, we only have to consider gates.. The number of stages in a circuit is called the depth of the circuit. A slightly related work is that the quantum circuits in the Clifford hierarchy can be distinguished by some POVM measurements [22, Theorem 8]. However, no exact construction of the POVMs is given, other than the first level of Clifford hierarchy, namely the Pauli group, which can be identified using the idea of superdense coding [32]. We note that quantum circuits of depth one have been studied in [33].
Our second main contribution is as follows. Suppose that is an unknown qubit depth one quantum circuit with gates. We show that it requires at most queries to efficiently learn the output of on input .
Theorem 2.
[Learning unknown depth one output states] Given access to an unknown depth one quantum circuit , one can learn a circuit description using queries to the unknown circuit with time complexity , where is the number of gates, so that the produced hypothesis circuit is equivalent to with probability at least when the input states are restricted to the computational basis.
The explicit procedure is provided in Algorithm 2 of Section V. The reason why learning quantum circuits of some gates is a much more technicaldemanding problem is elaborated in the following. Since the gate dose not belong to the Clifford group, Pauli operators are not preserved by the evolution of the quantum circuit , and hence the stabilizer formalism or the Gottesman–Kitaev theorem [24] does not work for circuits with gates. To circumvent such challenges, we need to conceive a scenario such that the Gottesman–Kitaev theorem can be leveraged for our purpose. Since a gate can be implemented by a gadget with the magic state , it yields two corresponding stabilizer pseudomixture representations. Hence, a depth one quantum circuit can be transformed to a Clifford circuit with postselection and some ancillary magic states (see Proposition 11 of Section IV). We remark that the stabilizer pseudomixtures have been studied in some contexts, such as robustness of magic [34], classical and quantum simulation [30, 35]. In this work we will exploit the structure of stabilizer pseudomixtures in learning quantum circuits. We propose an expanded stabilizer formalism, which serves as a crucial and convenient tool to analyze quantum circuits of some gates (see Section IV). A depth one circuit can be represented by the expanded stabilizer formalism (Lemma 12 of Section IV). In particular, this expanded stabilizer formalism can be generated by at most primary symplectic stabilizers. By using such technique in the learning problem, we are able to analyze the outcomes of Pauli and Bell measurements on copies of its output state on input (Lemmas 13 and 14 of Section V). As a result, we recover a set of basis output states, which in turn recovers the target circuit representation (Theorem 17 of V). We remark that no conjugate oracle to is required in our algorithm as well. This is done after we carefully analyze the structure of such depth one output state (Lemma 16 of Section V). Our results are summarized in Table I.
This paper is organized as follows. We provide preliminaries in Section II. Section III is devoted to learning unknown Clifford circuits. In Section IV, we propose an expanded stabilizer formalism for analyzing quantum circuits of some gates. The learning algorithm for quantum circuits of depth one output state is given in Section IVB. Then we conclude in Section VI.
Ii Preliminaries
Iia Pauli operators and Clifford gates
A pure quantum state, denoted by
, is a unit vector in a certain Hilbert space. Let
be an ordered basis (computational basis) for pure singlequbit states in . The Pauli matricesform a basis of the space of linear operators . An important fact is that and anticommute with each other. Note that we may sometimes refer to
as the identity matrix of appropriate dimension without ambiguity. The states
andare the eigenvectors of
and thus is also called basis. Similarly, the eigenvectors of are , called basis, and the eigenvectors of are , called basis.Associated with an qubit quantum system is a complex Hilbert space . A standard basis for linear operators on the qubit state space is the fold Pauli group, denoted by
All the elements in
are unitary with eigenvalues
and they either commute or anticommute with each other. For convenience, we may sometimes omit the symbol of tensor product
.An fold Pauli operator admits a binary representation that is irrelevant to its phase. For , define
where denote the concatenation of the two vectors and . Consequently, can be generated by independent Pauli operators up to a phase in .
The set of qubit Clfford circuits, denoted by , consists of unitary operators that preserve the fold Pauli group under conjugation
Clifford circuits are composed of Hadamard , phase , and controlledNOT (see, for example, [12]) and these gates are called Clifford gates.
We may use the notation to denote an operator that applies an to the th qubit but trivially operates on the others. For , let . Other operators, such as , , , and , are similarly defined. Thus any can be expressed as for some and .
Without loss of generality, a basis of can be represented as follows:
(1) 
where is a Clifford unitary. They satisfy the following commutation relations:
(2) 
For a set of operators satisfying the commutation relations (2), the operators and are called symplectic partners of each other.
Iii Learning unknown Clifford circuits
A Clifford circuit can be decomposed into Clifford gates in many ways. This section is devoted to providing an efficient algorithm for finding a circuit representation of an unknown Clifford circuit. In subsection IIIA, we recall how to retrieve information about an unknown stabilizer state by measurements. In subsection IIIB, we describe a circuit synthesis method for Clifford circuits. Lastly, in subsection IIIC, we add up the introduced tools to achieve our goal of learning an unknown Clifford circuit (Algorithm 1 and Theorem 9).
Iiia Stabilizer states and measurements
An qubit stabilizer state is the joint eigenvector of an Abelian group that does not contain , where are independent generators. Any element in satisfies that and is called a stabilizer of . Suppose that , where and , for . Then a Pauli frame of the qubit stabilizer state is given by
where for .
Example 1.
The twoqubit state has a Pauli frame (The plus sign is omitted.)
Definition 3.
A Pauli frame , where , is said to have rank if the binary matrix is of rank . .
It is known that the evolution of a Clifford circuit on a stabilizer state can be simulated by tracking the transformation of its Pauli frame according to the Gottesman–Kitaev theorem [24]. Measuring a Pauli operator on a stabilizer state can also be tracked in a Pauli frame [12].
An qubit stabilizer state and its stabilizer group have a onetoone correspondence. Hence can be identified by its stabilizer group . A stabilizer group can be described by a set of independent Pauli generators. Assuming that many copies of are available, we can perform certain measurements on and obtain a representation of . A naive method is to measure each Pauli operator on a copy of . The measurement returns outcome with probability 1 if stabilizes and returns outcome with probability (), otherwise. This requires copies of the state for Pauli measurements.
Montanaro showed that Bell sampling on two copies of a stabilizer state returns one of its stabilizer, up to a Pauli operator that relates the stabilizer state and its conjugate state [14, Lemma 2]. Consequently outcomes of Bell sampling on pairs of the stabilizer state return stabilizers of the state, which can then be used to determine a set of independent stabilizer generators with high probability.
For an arbitrary quantum state , its conjugate state is defined by
(3) 
Inspired by Montanaro’s Bell sampling [14, Lemma 2], we reformulate the following lemma.
Lemma 4.
Suppose that is an qubit pure state. Then a joint Bell measurement on returns outcome with probability
Proof.
The outcome of a joint Bell measurement on is with probability
∎
Therefore, we can learn a stabilizer of a stabilizer state by performing a joint Bell measurement on . If copies of the conjugate state are not available, stabilizers can be still learned by Bell measurements on as in the following corollary.
Corollary 5.
Suppose that is an qubit stabilizer state. Then there exists such that a joint Bell measurement on returns outcome with probability
Proof.
Suppose that is stabilized by independent stabilizer generators . It is straightforward to see that the conjugate state is stabilized by , where if the number of its Pauli component is even, and , otherwise. If for all , then and the statement holds trivially.
Now assume that for some , say for convenience, and for . This can be done because that if for , we can replace it by such that . Hence, the conjugate state is stabilized by . Suppose that , for some , is a symplectic partner of such that the commutation relations (2) hold. Then
since they are both stabilized by . Consequently, a Bell measurement on returns outcome with probability
∎
Remark: This corollary is slightly weaken than [14, Lemma 2], where the Pauli operator is shown to be for some by exploiting the mathematical structure of a stabilizer state [36, 37]. This can be understood as for some and a unitary consisting of , , , and gates [37, Theorem 2].
However, Corollary 5 is sufficient for our purpose of learning stabilizer states so that we have a selfcontained proof here. Moreover, this idea will be exploited in learning depth one output states later.
IiiB A Circuit Synthesis Method
In this section, we describe a circuit synthesis approach for Clifford circuits and it will be used later in Section IIIC for finding the circuit representation of an unknown target Clifford circuit.
An qubit state is described by a density matrix. The fold Pauli operators are a basis for matrices. To understand the evolution of a density operator under a unitary operator , it suffices to know how operates on the fold Pauli operators. Namely, with . Since the Pauli matrices are related by and the fold Pauli group has independent generators, one has the following lemma.
Lemma 6.
Suppose is a Clifford operator. Given and (or ) for , can be uniquely determined up to a global phase.
Remark 7.
Lemma 6 shows that only one Clifford satisfies the pair constraints and (or ) for . However, it is computationally difficult to find the circuit representation for . (For example, using Gaussian elimination would take time .)
In a learning task, the goal is usually to predict the output state or the measurement outcome on . Given knowledge of and for , it is still not easy to do this prediction. If we know the mathematical description of , we can find a Pauli decomposition of , and then evaluate the combination . Since there are basis matrices, this decomposition would require inner products. On the other hand, if a circuit description of is available, we can simply apply to the input quantum state for predicting the output state. In the following, we describe a crucial step—a circuit synthesis method—for finding a circuit representation for the unknown Clifford .
Clifford circuits are composed of controlledNOT (CNOT), Hadamard, and phase gates. A tableau description of a Clifford unitary is a binary matrix with rows corresponding to and for . Given the tableau of , Aaronson and Gottesman provided a circuit synthesis algorithm that decomposes to a circuit that contains 11 stages of computation in the sequence HCPCPCHPCPC [38], where H, P, and C stand for stages composed of only Hadamard, Phase, and CNOT gates, respectively. (This is further improved to a ninestage circuit by Maslov and Roetteler [39], which can be utilized in faulttolerant quantum computation [40].) Consequently, any Clifford circuit can be decomposed into Clifford gates with circuit depth [41] or Clifford gates with circuit depth [42]. When the input to a Clifford circuit is restricted to , Van den Nest showed that the output state is equal to a Clifford circuit of five stages HCXPCZ on input [37], where X and CZ stand for stages of only , and controlled phase gates, respectively.
In the following Lemma 8, we show that if one only has access to an incomplete tableau, it is still possible to apply the above Clifford synthesis algorithm with additional steps. This is similar to the encoding circuit decomposition for entanglementassisted quantum stabilizer codes [43] and its proof is omitted.
Lemma 8.
Suppose that is a Clifford circuit. Given for and for with , we can construct a unitary operation composed of Clifford gates such that for and for . Moreover, such can be found in time .
Similarly, given for some , one can derive a circuit such that .
IiiC Learning algorithm for unknown Clifford circuits
In this section, we show how to learn a circuit representation for an unknown Clifford circuit . Our idea is similar to that of learning an unknown stabilizer state. For example, Montanaro proposed an algorithm for learning unknown stabilizer state via identifying its stabilizer group [14]. However, identifying an unknown Clifford circuit is more complicated. One would need to determine and for simultaneously. Our key ingredient is to apply Lemma 8 to find a Clifford circuit decomposition for as described as follows.
Our learning algorithm for unknown Clifford circuits is given in Algorithm 1. We briefly explain how it works. According to Corollary 5, the set obtained in step 2) is a set of stabilizers for , from which we can obtain a stabilizer group description of . Let with stabilizers , and with stabilizers , . If we use Motanaro’s algorithm with copies of , we can determine an independent set of generators with probability at least such that
Similarly, using copies of , we can determine an independent set of generators with probability at least such that
Consequently, there exist for , and for , such that
Once and are known, and can be uniquely determined by Lemma 8.

Prepare copies of using the oracle .

For , perform a Bell measurement on and denote the outcomes by .

Determine a basis for and denote the basis by , where .

For , do the following:

Measure the Pauli operator on .

If the outcome is , then is a stabilizer of ; otherwise, is a stabilizer of .
Then is a stabilizer basis for .


For , do the following:

prepare copies of using the oracle .

For , measure on . If the outcome is , set ; otherwise, .


Find the inverse of and denote it by , using augmented matrices and Gaussian elimination. Then
for .

Repeat Steps 1) to 5) but with , , and replaced by , and , respectively.

Find the inverse of and denote it by , using augmented matrices and Gaussian elimination. Then
for .

Apply Lemma 8 to and output the obtained Clifford circuit.
Finding a basis for requires a Gaussian elimination, which takes time in reality. Similarly, Gaussian elimination is also needed in Lemma 8 and to find the inverse of an matrix using augmented matrices. To sum up we have the following theorem.
Theorem 9.
Given access to an oracle , one can identify using queries to in time with probability at least .
In the special case of learning simply an unknown stabilizer state , applying steps 1) to 4) in Algorithm 1 is sufficient to find a set of stabilizer generators.
Iv Characterizing Quantum Circuits of Some gates
Iva Expanded stabilizer formalism
The Clifford gates together with a nonClifford gate, say , are universal for quantum computation [12]. We will focus on quantum circuits composed of Clifford gates in this paper. An arbitrary quantum circuit can be approximated by Clifford and gates and this approximation can be decomposed as a sequence of Clifford stages and stages, alternatively.
Definition 10.
The number of stages in a circuit is called the depth of the circuit. The output state of a depth one circuit on input will be called a depth one output state.
For example, Figure 1 provides a quantum circuit of depth one.
A gate can be implemented by the gadget shown in Figure 2 with a magic state . In addition, this gadget is, conditioned on the measurement outcome, equivalent to one of the postselected gadgets as shown in Figure 3 [31], where only Clifford gates are required.
Hence we have the following proposition.
Proposition 11.
Any qubit Clifford+ quantum circuit of gates can be reduced to an qubit Clifford circuit of depth if postselection is possible and magic sates are available. It can be further reduced to a quantum circuit of constant depth if, in addition, large ancillary state preparation is possible.
Proof.
Using the gadget in Figure 3 [31], a quantum circuit of gates can be implemented by an equivalent Clifford circuit with ancillary magic states conditioned on outcome in the gadgets. (Both postselected gadgets work here, and for simplicity, we use only the postselected gadget conditioned on outcome in the following.) Then the equivalent circuit has qubits and only Clifford gates, followed by some postselection measurements at the end. Since a Clifford circuit can be implemented with depth logarithmic in the number of qubits [42], we have the first statement.
As for the second statement, we simply use the gate teleportation technique [44, 40] to implement a Clifford circuit with a corresponding ancillary state. If this ancillary state can be prepared offline, the teleportation part can be done in constant depth.
∎
For example, the quantum circuit in Figure 1 can be implemented by Figure 4 with two postselected gadgets.
Recently, it is shown that computations with larger quantum depth are strictly more powerful (with respect to an oracle) and not every quantum algorithm can be implemented in logarithmic depth [45, 46]. We remark that the above proposition does not violate the depth constraint since it assumes that postselection is available.
A quantum state can be represented as a stabilizer pseudomixture , where are stabilizer states and are real numbers such that . Note that this representation is not unique and can be negative. The magic state has the following two stabilizer pseudomixtures:
(4)  
(5) 
where , , and . In Eq. (4), the stabilizers of the component stabilizer states are , , and , respectively, while in Eq. (5), the stabilizers are , , and , respectively. In this work we will exploit the structure of stabilizer pseudomixtures in learning quantum circuits. We will provide algorithms to learn Clifford circuits of some gates, specifically .
We propose the following expanded stabilizer formalism for simulating a quantum circuit of gates when the input is a stabilizer state. First we replace the gates in the target quantum circuit by postselected gadgets, which leads to a Clifford circuit with input a pseudomixture of stabilizer states. Then the evolution of the input stabilizer state under can be done by tracing the corresponding Pauli frames in the remaining Clifford circuit and then combining the resulting states appropriately. We say that these Pauli frames constitutes an expanded Pauli frame. Clearly, this method can efficiently handle gates.
Example 2.
Consider a gate operating on , which is stabilized by . The output is and the expanded Pauli frame evoles from to as follows:
In general, we can start with an qubit Pauli frame. Each time when a gate is applied, we consider the qubit Pauli frames, expand the number of Pauli frames by three, do CNOTs, measure the ancilla with postselected outcome , and then discard the ancilla qubit. Continuing this process, we end with qubit Pauli frames.
Remark: in the task of classical simulation in [30, Theorem 3], knowledge of Eq. (4) is sufficient so that classical measurement outcomes can be linearly combined. However, we need both Eqs. (4) and (5) to develop our expanded stabilizer formalism as shown in the following.
The transformations of single Pauli operators under in the expanded Pauli frame are summarized in Table II. A triplet such as means that the state is a pseudomixture of the three states stabilized by , , and , and with coefficients and respectively. Note that commutes with so remains unchanged. The two triplets in an entry correspond to the expressions (4) and (5), respectively. In each triplet, the second operator is always equal to the first, multiplied by . Observe that these two triplets have the same first and third operators in the opposite order. Therefore, we will call the first and third operators as the primary symplectic stabilizers (they are also symplectic partners to each other). For example, we say that and are the primary symplectic stabilizers of . Another reason is that when measuring each of these primary symplectic stabilizers on the output state, we obtain outcome with probability and outcome with probability . These ideas naturally extend to fold Pauli operators.
input  output  primary symplectic stabilizers  
(,, )  (,, )  
(,, )  (,, )  
(,, )  (,, )  
(,, )  (,, )  
NA 
IvB Quantum circuits of depth one
An expanded Pauli frame of an qubit quantum circuit has exponentially many Pauli frames in the number of gates and this seems intractable when goes large. For depth one quantum circuits, we show that it suffices to trace the evolution of at most primary symplectic stabilizers. Without loss of generality, we consider a depth one quantum circuit , where and are Clifford operators in , and of Hamming weight . Here applies a gate to qubit if , and operates trivially, otherwise. Figure 1 illustrates such an example.
Lemma 12.
Suppose that is a depth one circuit, where and is of Hamming weight . Then has a pseudomixture of orthogonal stabilizer states, where , and its expanded Pauli frame has primary symplectic stabilizers and the other stabilizer generators that stabilize all the component stabilizer states.
Proof.
Recall the definition of rank in Def. 3. In the following we consider the two cases of whether has a Pauli frame of full rank.

Assume that has a Pauli frame of full rank. Without loss of generality, we may assume that the Pauli frame of has the following form:
where and . This can be done by appropriate row multiplications.
Assume . The case that is similar. Now we simulate the evolution of a postselected gadget (conditioned on outcome ) operating on the last qubit of , that is, applying a gate to the last qubit. By Eq. (4), we start with three Pauli frames (of dimension ):
Comments
There are no comments yet.