{'fraction_non_alphanumeric': 0.04868012422360248, 'fraction_numerical': 0.01372670807453416, 'mean_word_length': 4.145082687544939, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 32, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Constructions for Quantum Indistinguishability Obfuscation

An indistinguishability obfuscator is a probabilistic polynomial-time algorithm that takes a circuit as input and outputs a new circuit that has the same functionality as the input circuit, such that for any two circuits of the same size that compute the same function, the outputs of the indistinguishability obfuscator are indistinguishable. Here, we study schemes for indistinguishability obfuscation for quantum circuits. We present two definitions for indistinguishability obfuscation: in our first definition (qiO) the outputs of the obfuscator are required to be indistinguishable if the input circuits are perfectly equivalent, while in our second definition (qiOD), the outputs are required to be indistinguishable as long as the input circuits are approximately equivalent with respect to a pseudo-distance D. Our main results provide (1) a computationally-secure scheme for qiO where the size of the output of the obfuscator is exponential in the number of non-Clifford (T gates), which means that the construction is efficient as long as the number of T gates is logarithmic in the circuit size and (2)a statistically-secure qiOD, for circuits that are close to the kth level of the Gottesman-Chuang hierarchy (with respect to D); this construction is efficient as long as k is small and fixed.


Introduction
At the intuitive level, an obfuscator is a probabilistic polynomial-time algorithm that transforms a circuit C into another circuit C ′ that has the same functionality as C but that does not reveal anything about C, except its functionality i.e., anything that can be learned from C ′ about C can also be learned from blackbox access to the input-output functionality of C. This concept is formalized in terms of virtual black-box obfuscation, and was shown [11] to be unachievable in general. Motivated by this impossibility result, the same work proposed a weaker notion called indistinguishability obfuscation (iO).
In the classical case, an indistinguishability obfuscator is a probabilistic polynomial-time algorithm that takes a circuit C as input and outputs a circuit iO(C) such that iO(C)(x) = C(x) for all inputs x and the size of iO(C) is at most polynomial in the size of C. Moreover, it must be that for any two circuits C 1 and C 2 of the same size and that compute the same function, their obfuscations are computationally indistinguishable. It is known that iO achieves the notion of best possible obfuscation, which states that any information that is not hidden by the obfuscated circuit is also not hidden by any circuit of similar size computing the same functionality [27]. Indistinguishability obfuscation is a very powerful cryptographic tool which is known to enable, among others: digital signatures, public key encryption [39], multiparty key agreement, broadcast encryption [14], fully homomorphic encryption [18] and witness-indistinguishable proofs [13]. Notable in the context of these applications is the punctured programming technique [39] which manages to render an iO(C) into an intriguing cryptographic building block, and this, despite that fact that the security guarantees of iO(C) appear quite weak as they are applicable only if the two original circuits have exactly the same functionality.
The first candidate construction of iO was published in [24], with security relying on the presumed hardness of multilinear maps [20,25,34]. Unfortunately, there have been many quantum attacks on multilinear maps [5,19,21]. Recently, new iO schemes were proposed under different assumptions [9,32,38]. Whether or not these schemes are resistant against quantum attacks remains to be determined.
Indistinguishability obfuscation has been studied for quantum circuits in [3,4]. In a nutshell (see Section 1.2 for more details), [4] shows a type of obfuscation for quantum circuits, but without a security reduction. On the other hand, the focus of [3] is on impossibility of obfuscation for quantum circuits in a variety of scenarios. Thus, despite these works, until now, the achievability of indistinguishability obfuscation for quantum circuits has remained wide open.

Overview of Results and Techniques
Our contribution establishes indistinguishability obfuscation for certain families of quantum circuits. We now overview each of our two main definitions, and methods to achieve them (Section 1.1.1 and Section 1.1.2). We then compare the two approaches (Section 1.1.3).

Indistinguishability obfuscation for quantum circuits
First, we define indistinguishability obfuscation for quantum circuits (qiO) (Section 3) as an extension of the conventional classical definition. This definition specifies that on input a classical description of a quantum circuit C q , the obfuscator outputs a pair (|φ , C ′ q ), where |φ is an auxiliary quantum state and C ′ q is a quantum circuit. For correctness, we require that ||C ′ q (|φ , ·) − C q (·)|| ⋄ = 0, whereas for security, we require that, on input two functionally equivalent quantum circuits, the outputs of qiO are indistinguishable. As a straightforward extension of the classical results, we then argue that inefficient indistinguishability obfuscation exists.
In terms of constructing qiO, we first focus on the family of Clifford circuits and show two methods of obfuscation: one straightforward method based on the canonical representation of Cliffords, and another based on the principle of gate teleportation [30]. Clifford circuits are quantum circuits that are built from the gate-set {X, Z, P, CNOT, H}. They are known not to be universal for quantum computation and are, in a certain sense, the quantum equivalent of classical linear circuits. It is known that Clifford circuits can be efficiently simulated on a classical computer [29]; however, note that this simulation is with respect to a classical distribution, hence for a purely quantum computation, quantum circuits are required, which motivates the obfuscation of this circuit class. Furthermore, Clifford circuits are an important building block for faulttolerant quantum computing, for instance, due to the fact that Cliffords admit transversal computations in many fault-tolerant codes. We provide two methods to achieve qiO for Clifford circuits.
Obfuscating Cliffords using a canonical form. Our first construction of qiO for Clifford circuits starts with the well-known fact that a canonical form is an iO. We point out that a canonical form for Clifford circuits was presented in [2]; this completes this construction (we also note that an alternative canonical form was also presented in [40]). This canonical form technique does not require any computational assumptions. Moreover, the obfuscated circuits are classical, and hence can be easily communicated, stored, used and copied.
Obfuscating Cliffords using gate teleportation. Our second construction of qiO for Clifford circuits takes a very different approach. We start with the gate teleportation scheme [30]: according to this, it is possible to encode a quantum computation C q into a quantum state (specifically, by preparing a collection of entangled qubit pairs, and applying C q to half of this preparation). Then, in order to perform a quantum computation on a target input |ψ , we teleport |ψ into the prepared entangled state. This causes the state |ψ to undergo the evolution of C q , up to some corrections, based on the teleportation outcome. If C q is chosen from the Clifford circuits, these corrections are relatively simple 1 and thus we can use a classical iO to provide the correction function. In contrast to the previous scheme, the gate teleportation scheme requires the assumption of quantum-secure classical iO for a certain family of functions (Section 2.14) and the obfuscated circuits include a quantum system. While this presents a technological challenge to communication, storage and also usage, there could be advantages to storing quantum programs into quantum states, for instance to take advantage of their uncloneability [1,17].
Obfuscating Beyond Cliffords. Next, in our main result for Section 5, we generalize the gate teleportation scheme for Clifford circuits, and show a qiO obfuscator for all quantum circuits where the number of non-Clifford gates is at most logarithmic in the circuit size. For this, we consider the commonly-used Clifford+T gate-set, and we note that the T relates to the X, Z as: This means that, if we implement a circuit C with T gates as in the gate teleportation scheme above, then the correction function is no longer a simple Pauli update (as in the case for Cliffords). However, this is only partially true: since the Paulis form a basis, there is always a way to represent an update as a complex, linear combination of Pauli matrices. In particular, for the case of a T, we note that P = ( 1+i 2 )I + ( 1−i 2 )Z. Hence, it is possible to produce an update function for general quantum circuits that are encoded via gate teleportation. To illustrate this, we first analyze the case of a general Clifford+T quantum circuit on a single qubit (Section 5.1). Here, we are able to provide qiO for all circuits. Next, for general quantum circuits, (Section 5.2), we note that the update function exists for all circuits, but becomes more and more complex as the number of T gates increases. We show that if we limit the number of T gates to be logarithmic in the circuit size, we can reach an efficient construction. Both of these constructions assume a quantum-secure, classical indistinguishability obfuscation.
To the best of our knowledge, our gate teleportation provides the first method for indistinguishability obfuscation that is efficient for a large class of quantum circuits, beyond Clifford circuits. Note, however that canonical forms (also called normal forms) are known for single-qubits universal quantum circuits [26,36]. We note that, for many other quantum cryptographic primitives, it is the case that the T-gate is the bottleneck (somewhat akin to a multiplication in the classical case). This has been observed, e.g., in the context of homomorphic quantum encryption [16,23], and instantaneous quantum computation [42]. Because of these applications, and since the T is also typically also the bottleneck for fault-tolerant quantum computing, techniques exist to reduce the number of T gates in quantum circuits [7,8,22] (see Section 1.2 for more on this topic).
1.1.2 Indistinguishability obfuscation for quantum circuits, with respect to a pseudo-distance Next in Section 6, we define indistinguishability obfuscation for quantum circuits with respect to some pseudo-norm D, which we call qiO D . This definition specifies that on input a classical description of a quantum circuit C q , the obfuscator outputs a pair (|φ , C ′ q ), where |φ is an auxiliary quantum state and C ′ q is a quantum circuit. For correctness, we require that D(C ′ q (|φ , ·), C q (·)) ≤ negl(n), whereas for security, we require that, on input two approximately equivalent quantum circuits (Definition 6.1), the outputs of qiO D are statistically indistinguishable. This definition is more in line with [3].
We show how to construct a statistically-secure quantum indistinguishability obfuscation with respect to the pseudo-distance D (see Algorithm 6) for quantum circuits that are very close to kth level of the Gottesman-Chuang hierarchy [30], for some fixed k (see Section 2.9). The construction takes a circuit U q as an input with a promise that the distance D(U q , C) ≤ ǫ < 1 2 k+1/2 for some C ∈ C k . It computes the conjugate circuit U † q and then runs Low's learning algorithm as a subroutine on inputs U q and U † q [35]. The algorithm outputs whatever Low's learning algorithm outputs. Note that Low's learning algorithm runs in time super-polynomial in k, therefore for our construction to remain efficient the parameter k is some small fixed integer (say k = 5). Note that for k > 2, the set C k includes all Clifford unitaries as well as some non-Clifford unitaries [35].

Comparison of the two Approaches
Our notions of qiO and qiO D are incomparable. To see this, on one hand, note that the basic instantiation of an indistinguishability obfuscator that outputs a canonical form is no longer secure in the definition of indistinguishability with respect to a pseudo-norm. 2 On the other hand, the construction for qiO D that we give in Algorithm 6 does not satisfy the definition of qiO, because the functionality is not perfectly preserved, which is a requirement for qiO. We recall that in the classical case, it is generally considered an advantage that iO is a relatively weak notion (since it is more easily attained) and that, despite this, a host of uses of iO are known. We thus take qiO as the more natural extension of classical indistinguishability obfuscation to the quantum case, but we note that issues related to the continuity of quantum mechanics and the inherent approximation in any universal quantum gateset justify the relevance for our approach to qiO D .
We now compare the schemes that we achieve. The most general scheme that we give as a construct for qiO (Algorithm 5) allows to obfuscate any polynomialsize quantum circuit (with at most O(log) non-Clifford gates). While this is a restricted class, it is well-understood and we believe that this technique may be amenable to an extension that would result into a full qiO.
In comparison, the scheme that we give for qiO D , based on Low's learning algorithm [35] has some advantages over the teleportation-based constructions. Firstly, the circuits to be obfuscated don't need to be of equal size or perfectly equivalent and the outputs of the obfuscator remain statistically indistinguishable as long as the circuits are approximately equivalent (with respect to the pseudo-distance D). Secondly, Algorithm 6 does not require any computational assumptions, whereas the teleportation-based constructions require a quantum-secure classical indistinguishability obfuscator. However, beyond the fact that C k contains all Clifford circuits, it is not clear how powerful unitaries are in the kth level of the Gottesman-Chuang hierarchy (especially for a fixed small k). Even when k → ∞, the hierarchy does not include all unitaries. In terms of extending this technique, Low's learning algorithm exploits the structure of the Gottesman-Chuang hierarchy and it not obvious how one can apply this technique to arbitrary quantum circuits.

More on Related Work
Quantum Obfuscation. Quantum obfuscation was first studied in [4], where a notion called (G, Γ)-indistinguishability obfuscation was proposed, where G is a set of gates and Γ is a set of relations satisfied by the elements of G. In this notion, any two circuits over the set of gates G are perfectly indistinguishable if they differ by some sequence of applications of the relations in Γ.
Since perfect indistinguishability obfuscation is known to be impossible under the assumption that P = NP [27], one of the motivations of this work was to provide a weaker definition of perfectly indistinguishable obfuscation, along with possibility results. However, to the best of our knowledge, (G, Γ)indistinguishability obfuscation is incomparable with computational indistinguishability obfuscation [11,24], which is the main focus of our work.
Quantum obfuscation is studied in [3], where the various notions of quantum obfuscation are defined (including quantum black-box obfuscation, quantum indistinguishability obfuscation, and quantum best-possible obfuscation). A contribution of [3] is to extend the classical impossibility results to the quantum setting, including e.g. showing that each of the three variants of quantum indistinguishability obfuscation is equivalent to the analogous variant of quantum best-possible obfuscation, so long as the obfuscator is efficient. This work shows that the existence of a computational quantum indistinguishability obfuscation implies a witness encryption scheme for all languages in QMA. Various impossibiliity results are also shown: that efficient statistical indistinguishability obfuscation is impossible unless PSPACE is contained in QSZK 3 (for the case of circuits that include measurements), or unless coQMA 4 is contained in QSZK (for the case of unitary circuits). Notable here is that [3] defines a notion of indistinguishability obfuscation where security must hold for circuits that are close in functionality (this is similar to our definition of qiO D ); it is however unclear if their impossibility results hold for a notion of quantum indistinguishability along the lines of our definition of qiO. See Section 3.2 for further discussion of the links between this definition and ours. We note that [3] does not provide any concrete instantiation of obfuscation.
Recently it has been shown that virtual black-box obfuscation of classical circuits via quantum mechanical means is also impossible [10,28].
Quantum Homomorphic Encryption. In quantum homomorphic encryption, a computationally-weak client is able to send a ciphertext to a quantum server, such that the quantum server can perform a quantum computation on the encrypted data, thus producing an encrypted output which the client can decrypt, and obtaining the result of the quantum computation.
This primitive was formally defined in [16] (see also [15,23]), where it was shown how to achieve homomorphic quantum computation for quantum circuits of low T-depth, by assuming quantum-secure classical fully homomorphic encryption. We note that even the simplest scheme in [16] (which allows the homomorphic evaluation of any Clifford circuit), requires computational assumptions in order for the server to update homomorphically the classical portion of the ciphertext, based on the choice of Clifford. In contrast, here we are able to give information-theoretic constructions for this class of circuits (essentially, because the choice of Clifford is chosen by the obfuscator, not by the evaluator). We thus emphasize that in iO, we want to hide the circuit, whereas in homomorphic encryption, we want to hide the plaintext (and allow remote computations on the ciphertext). Since the evaluator in homomorphic encryption has control of the circuit, but not of the data, the evaluator knows which types of gates are applied, and the main obstacle is to perform a correction after a T-gate, controlled on a classical value that is held only in an encrypted form by the evaluator. In contrast to this, in iO, we want to hide the inner workings of the circuit. By using gate teleportation, we end up in a situation where the evaluator knows some classical values that have affected the quantum computation in some undesirable way, and then we want to hide the inner workings of how the evaluator should compensate for these undesirable effects. Thus, the techniques of quantum homomorphic encryption do not seem directly applicable, although we leave as an open question if they could be used in some indirect way, perhaps towards efficient qiO for a larger family of circuits.

Open Questions
The main open question is efficient quantum indistinguishability obfuscation for quantum circuits with super-logarithmic number of T-gates. Another open question is about the applications of quantum indistinguishability obfuscation. While we expect that many of the uses of classical iO carry over to the quantum case, we leave as future work the formal study of these techniques.
Outline. The remainder of this paper is structured as follows. Section 2 overviews basic notions required in this work. In Section 3, we formally define indistinguishability obfuscation for quantum circuits. In Section 4, we provide the construction for Clifford circuits. In Section 5, we give our main result which shows quantum indistinguishability obfuscation for quantum circuits, which is efficient for circuits having at most a logarithmic number of T gates. Finally in Section 6, we consider the notion of quantum indistinguishability obfuscation with respect to a pseudo-distance, and show how to instantiate it for a family of circuits close to the Gottesman-Chuang hierarchy.

Basic Classical Cryptographic Notions
Let N be the set of positive integers. For n ∈ N, we set [n] = {1, · · · , n}. We denote the set of all binary strings of length n by {0, 1} n . An element s ∈ {0, 1} n is called a bitstring, and |s| = n denotes its length. Given two bit strings x and y of equal length, we denote their bitwise XOR by x ⊕ y. For a finite set X, the notation x $ ← − X indicates that x is selected uniformly at random from X. We denote the set of all d × d unitary matrices by is negligible if for every positive polynomial p(n), there exists a positive integer n 0 such that for all n > n 0 , negl(n) < 1/p(n). A typical use of negligible functions is to indicate that the probability of success of some algorithm is too small to be amplified to a constant by a feasible (i.e., polynomial) number of repetitions.

Classical Circuits and Algorithms
A deterministic polynomial-time (or PT) algorithm C is defined by a polynomialtime uniform 5 family C = {C n | n ∈ N} of classical Boolean circuits over some gate set, with one circuit for each possible input size n ∈ N. For a bitstring x, we define C(x) := C |x| (x). We say that a function family f : for all x; it is implicit that m is a function of n which is bounded by some polynomial, e.g., the same one that bounds the running time of C. Note that in the literature, circuits that compute functions whose range is {0, 1} m are often called multi-output Boolean circuits [31], but in this paper we simply called them Boolean circuits [41].
A probabilistic polynomial-time algorithm (or PPT) is again a polynomialtime uniform family of classical Boolean circuits, one for each possible input size n. The nth circuit still accepts n bits of input, but now also has an additional "coins" register of p(n) input wires. Note that uniformity enforces that the function p is bounded by some polynomial. For a PPT algorithm C, n-bit input x and p(n)-bit coin string r, we set C(x; r) := C n (x; r). In contrast with the PT case, the notation algorithm C(x) will now refer to the random variable

Classical Indistinguishability
Here, we define indistinguishability for classical random variables, against a quantum distinguisher (Definition 2.2). Definition 2.1. (Statistical Distance) Let X and Y be two random variables over some countable set Ω. The statistical distance between X and Y is 2. X and Y are statistically indistinguishable if there exists a negligible function negl such that for all sufficiently large n: 3. {X n } n∈N and {Y n } n∈N are computationally indistinguishable if for any polynomial-time quantum distinguisher D q , there exists a negligible function negl such that:

Classical Indistinguishability Obfuscation
Let C be a family of probabilistic polynomial-time circuits. For n ∈ N, let C n be the circuits in C of input length n. We now provide a definition of classical indistinguishability obfuscation (iO) as defined in [27], but where we make a few minor modifications. 6 Definition 2.3. (Indistinguishability Obfuscation, iO) A probabilistic polynomialtime algorithm is a quantum-secure indistinguishability obfuscator (iO) for a class of circuits C, if the following conditions hold: 1. Preserving Functionality: For any C ∈ C n : The probability is taken over the iO's coins.

Polynomial Slowdown:
There exists a polynomial p(n) such that for all input lengths, for any C ∈ C n , the obfuscator iO only enlarges C by a factor of p(|C|) : |iO(C)| ≤ p(|C|).

Indistinguishability:
An iO is said to be a computational/statistical/ perfect indistinguishability obfuscation for the family C, if for all large enough input lengths, for any circuit C 1 ∈ C n and for any C 2 ∈ C n that computes the same function as C 1 and such that |C 1 | = |C 2 |, the distributions iO(C 1 )) and iO(C 2 ) are (respectively) computationally/statistically/perfectly indistinguishable.

Basic Quantum Notions
Given an n-bit string x, the corresponding n-qubit quantum computational basis state is denoted |x . The 2 n -dimensional Hilbert space spanned by n-qubit basis states is denoted: We denote by D(H n ) the set of density operators (i.e., valid quantum states) on H n . These are linear operators on D(H n ) which are positive-semidefinite and have trace equal to 1.

Norms and Pseudo-Distance
The trace distance between two quantum states ρ, σ ∈ D(H n ) is given by: where |·| denotes the positive square root of the matrix (ρ − σ) † (ρ − σ). Let Φ and Ψ be two admissible operators of type (n, m) 7 . The diamond norm between two quantum operators is The Frobenius norm of a matrix A ∈ C n×m is defined as ||A|| F = Tr(AA † ). Let U 1 , U 2 ∈ U(d) be two d × d unitary matrices. The phase invariant distance between U 1 and U 2 is where U * i denotes the matrix with only complex conjugated entries and no transposition and |z| denotes the norm of the complex number z. Note that D is a pseudo-distance since D(U 1 , U 2 ) = 0 does not imply U 1 = U 2 , but that U 1 and U 2 are equivalent up to a phase so the difference is unobservable. It is easy to see that D satisfies the axioms of symmetry (D(U 1 ,
We define a generalized Bell state as a tensor product of n Bell states a Bell measurement in the (generalized) Bell basis on the state |ψ outputs the string s with probability |α s | 2 and leaves the system in the state |β s .

Quantum Gates
We will work with the following set of unitary gates For any single-qubit density operator ρ ∈ D(H 1 ), we can encrypt it via the quantum one-time pad by sampling uniform bits s and t, and producing X s Z t ρZ t X s . To an observer that has no knowledge of s and t, this system is information-theoretically indistinguishable from the state 1 1 /2 (where 1 1 is the 2 by 2 identity matrix) [6].

Gottesman-Chuang Hierarchy
The n-qubit Pauli group P n is a multiplicative group of order 4 n+1 , defined as: Let C 1 be the Pauli group P n . Then the level C k of the Gottesman-Chuang hierarchy is defined recursively [30]: Note that C 2 is the Clifford group and for k > 2, C k is no longer a group but contains unitaries that contains a universal gate set.
The set of gates {X, Z, P, CNOT, H} applied to arbitrary wires redundantly generates the Clifford group. We note the following relations between these gates (these relations hold up to global phase; in this work, we use the convention that equal signs for pure states and unitaries hold up to global phase.)

Quantum Circuits and Algorithms
A quantum circuit is an acyclic network of quantum gates connected by wires. The quantum gates represent quantum operations and wires represent the qubits on which gates act. In general, a quantum circuit can have n-input qubits and m-output qubits for any integer n, m ≥ 0. The T-count is the total number of T-gates in a quantum circuit.
A quantum circuit that computes a unitary matrix is called a reversible quantum circuit, i.e., it always possible to uniquely recover the input, given the output. A set of gates is said to be universal if for any integer n ≥ 1, any nqubit unitary operator can be approximated to arbitrary accuracy by a quantum circuit using only gates from that set [33]. It is a well-known fact that Clifford gates are not universal, but adding any non-Clifford gate, such as T, gives a universal set of gates [33] 8 . Generalized quantum circuits (which implement superoperators) are composed of the unitary gates, together with trace-out and measurement operations. It is well-known that a generalized quantum circuit can be implemented by adding auxiliary states to the original system, applying a unitary operation on the joint system, and then tracing out some subsystem [33].
A family of generalized quantum circuits C = {C qn | n ∈ N}, one for each input size n ∈ N, is called polynomial-time uniform if there exists a deterministic Turing machine M such that: (i) for each n ∈ N, M outputs a description of C qn ∈ C on input 1 n ; and (ii) for each n ∈ N, M runs in poly(n). We define a quantum polynomial-time algorithm (or QPT) to be a polynomial-time uniform family of generalized quantum circuits.

Quantum Indistinguishability
Here, we define indistinguishability for indistinguishability for quantum states (Definition 2.4). 2. R and S are statistically indistinguishable if there exists a negligible function negl such that for all sufficiently large n: 3. R and S are computationally indistinguishable if there exists a negligible function negl such that for every state ρ n ∈ R, σ n ∈ S and for all polynomial-time quantum distinguisher D q , we have:

Quantum Teleportation
Here we provide a high-level description of quantum teleportation; for a more rigorous treatment see [12]. Suppose Alice has a quantum state |ψ = α|0 + β|1 9 that she wants to send to Bob who is located far away from Alice. One way for Alice to send her qubit to Bob is via the quantum teleportation protocol. For teleportation to work, Alice prepares a 2-qubit Bell state and sends physically one of the qubit to Bob and keeps the other to herself (this is what subscript AB means). We can now write the 3-qubit system as Alice now performs a joint measurement on |ψ and her part of the EPR pair in the Bell basis and obtains the output of the measurement (classical bits a, b). After this step, Bob's part of EPR pair has been transformed into the state Alice sends the two classical bits (a, b) to Bob, who performs the correction unitary Z a X b to the state he possesses and obtains the state |ψ . 9 For simplicity we assume that |ψ is single-qubit pure state.

Gate Teleportation
One of the main applications of quantum teleportation is in fault-tolerant quantum computation [30]. To construct unitary quantum circuits, we need to have access to some universal set of quantum gates 10 . Suppose we want to evaluate a single-qubit gate on some quantum state |ψ . If we directly apply U on |ψ and U fails, then it may also destroy the state. Quantum teleportation gives a way of solving this problem. Instead of applying U directly to |ψ , we can apply U to the system B in Equation (2) and then follow the gate teleportation protocol and obtain U (|ψ ). If U fails, then the Bell state might be destroyed, but there is no harm done, since we can create another EPR pair and try again. The gate teleportation can easily be generalized to evaluate any n-qubit Clifford circuit (Algorithm 1).
Remark 2.5. In this section, we only discuss how to evaluate Clifford gates using gate teleportation. Note that we can evaluate any unitary circuit using gate teleportation but the correction unitary becomes more complicated (it is no longer a tensor product of Paulis). This is discussed in Section 5.

Update Functions for Quantum Gates
Let C q be an n-qubit circuit consisting of a sequence of Clifford gates g 1 , . . . , g |Cq| . Then the update function for C q is a map from {0, 1} 2n to {0, 1} 2n and is constructed by composing the update functions for each gate in C q For each Clifford gate g, the update function f g is defined below. Note how g relates to the X and Z gates.

Definitions
In this section, we provide a definition of perfectly equivalent quantum circuits (see Section 3.1), and define our notion of quantum indistinguishability obfus-Algorithm 1 Gate Teleportation Protocol. Input: A n-qubit Clifford Circuit C q and n-qubit quantum state |ψ 1. Prepare a tensor product of n Bell states: |β 2n = |β 00 ⊗ · · · ⊗ |β 00 .

3.
Apply the circuit C q on the subsystem B.
4. Perform a measurement in the generalized Bell Basis (generalized Bell measurement) on the system CA and obtain a binary string a 1 b 1 , . . . , a n b n .
The remaining system after the measurement is 5. Compute the correction bits using the update function F Cq (Section 2.14).

Compute the correction unitary
7. Apply U FC q to the system (Equation (3)).
cation for equivalent circuits (Section 3.2). At the end of the section, we also make an observation about the existence of inefficient quantum indistinguishability obfuscation. Note that in Section 6, we present our alternative definition for quantum indistinguishability obfuscation, applicable to the case where the circuits are approximately equivalent.

Indistinguishability Obfuscation for Quantum Circuits
Where |φ is an ℓ-qubit state, the circuits C q and C ′ q are of type (n, n) and (m, n) respectively (m = ℓ + n). 12 2. Polynomial Slowdown: There exists a polynomial p(n) such that for any C q ∈ C q n , 3. Computational/Statistical/Perfect Indistinguishability: For any two perfectly equivalent quantum circuits C q1 , C q2 ∈ C q n , of the same size, the two distributions qiO(C q1 ) and qiO(C q2 ) are (respectively) computationally/statistically/perfectly indistinguishable.

Remark 3.3.
A subtlety that is specific to the quantum case is that Definition 3.2 only requires that (|φ , C ′ q ) enable a single evaluation of C q . We could instead require a k-time functionality, which can be easily achieved by executing the single-evaluation scheme k times in parallel. This justifies our focus here on the single-evaluation scheme. Note 3.4. As described in Section 1.2, our Definition 3.2 differs from [3] as it requires security only in the case of equivalent quantum circuits (see Definition 6.2 for a definition that addresses this). Compared to [3], we note that in this work we focus on unitary circuits only. 13 Another difference is that the notion of indistinguishability (computational or statistical) in [3] is more generous than ours, since it allows a finite number of inputs that violate the indistinguishability inequality. Since our work focuses on possibility of obfuscations, our choice leads to the strongest results; equally, since [3] focuses on impossibility, their results are strongest in their model. We also note that that [3] defines the efficiency of the obfuscator in terms of the number of qubits. We believe that our definition, which bounds the size of the output of the obfucation by a polynomial in the size of the input circuit, is more appropriate 14 and follows the lines of the classical definitions. As far as we are aware, further differences in our definition are purely a choice of style. For instance, we do not include an interpreter as in [3], but instead we let the obfuscator output a quantum circuit together with a quantum state; we chose this presentation since it provides a clear separation between the quantum circuit output by the qiO and the "quantum advice state".

Inefficient Quantum Indistinguishability Obfuscators Exist
Finally, we show a simple extension of a result in [11], which shows that if we relax the requirement that the obfuscator be efficient, then information-theoretic indistinguishability obfuscation exists. Proof. Let qiO(C) q be the lexicographically first circuit of size |C q | that computes the same quantum map as C q .

Quantum Indistinguishability Obfuscation for Clifford Circuits
Here, we show how to construct qiO for Clifford circuits with respect to definition Definition 3.2. The first construction (Section 4.1) is based on a canonical form, and the second is based on gate teleportation (Section 4.2).

qiO for Clifford Circuits via a Canonical Form
Aaronson and Gottesman developped a polynomial-time algorithm that takes a Clifford circuit C q and outputs its canonical form (see [2], section VI), which is invariant for any two equivalent n-qubit circuits 15 . Moreover the size of the canonical form remains polynomial in the size of the input circuit. Based on this canonical form, we define a qiO in Algorithm 2.
1. Using the Aaronson and Gottesman algorithm [2], compute the canonical form of C q Let |φ be an empty register.

Lemma 4.1. Algorithm 2 is a Perfect Quantum Indistinguishability Obfuscation for all Clifford Circuits.
Proof. We have to show that Algorithm 2 satisfies the definition of a perfect quantum indistinguishability obfuscation (Definition 3.2) for all Clifford circuits.

Functionality:
Since |φ is an empty register, it is a 0 qubit state (ℓ = 0.) The circuit C ′ q is the canonical form of C q , therefore, it is also of type (n, n) and has the same functionality as C q . We have ||C ′ q (|φ , ·) − C q (·)|| ⋄ = 0 ≤ negl(n) for any negligible function negl(n).

Polynomial Slowdown:
Note C ′ q is constructed using Aaronson and Gottesman algorithm [2]. Therefore, there exists a polynomial q(·) such that |C ′ q | ≤ q(|C q |). Let p(n) = q(n) + n then we clearly have • n ≤ p(|C q |) • |C ′ q | ≤ p(|C q |). 3. Perfectly Indistinguishability: Let C q1 , C q2 ∈ C q n , be any two equivalent Clifford circuits of the same size. Let Since the canonical form of any two equivalent Clifford circuits are exactly the same, we have C q ′ 1 = C q ′ 2 . Moreover both |φ 1 and |φ 2 are empty registers we have |φ 1 = |φ 2 . Then we have qiO-Canonical(C q1 ) = qiO-Canonical(C q2 ). Therefore, Algorithm 2 is a perfect quantum indistinguishability obfuscation for all Clifford circuits.

qiO for Clifford Circuits via Gate Teleportation
In this section, we show how gate teleportation (see Algorithm 1) can be used to construct a quantum indistinguishability obfuscation for Clifford circuits. Our construction, given in Algorithm 3, relies on the existence of a quantumsecure iO for classical circuits; however, upon closer inspection, our construction relies on the assumption that a quantum-secure classical iO exists for a very specific class of classical circuits 16 . In fact, it is easy to construct a perfectly secure iO for this class of circuits: like Clifford circuits, the circuits that compute the update functions also have a canonical form. Then the iO takes as input a Clifford circuit and outputs a canonical form of a classical circuit that computes the update function for C q . The iO is described formally in Algorithm 4.

Algorithm 3 qiO via Gate Teleportation for Clifford
• Input: An n-qubit Clifford Circuit C q .

2.
Apply the circuit C q on the right-most n qubits to obtain a system |φ : |φ = (I n ⊗ C q )|β 2n . 5. Description of the circuit C ′ q : (a) Perform a general Bell measurement on the leftmost 2n-qubits on the system |φ ⊗ |ψ , where |φ is an auxiliary state and |ψ is an input state. Obtain classical bits (a 1 , b 1 . . . , a n , b n ) and the state

Compute a classical circuit C that computes the update function
(b) Compute the correction bits (c) Using the above, the correction unitary is ai )|ψ to obtain the state C q (|ψ ).

Theorem 4.2. Algorithm 3 is a perfect quantum indistinguishability obfuscation for all Clifford Circuits.
Proof. We have to show that Algorithm 3 satisfies Definition 3.2.

2.
Polynomial Slowdown: Note ℓ = 2n (the number of qubits in |φ ) and C ′ q is a circuit of type (3n, n). The size of the circuit |C ′ q | = |iO(C)| + |Bell measurement|, where C is the classical circuit that computes the update function corresponding to C q . The size of a Bell measurement circuit for an O(n)-qubit state is O(n). Therefore, there exists a polynomial q(|C|) such that |Bell measurement| ≤ q(|C|)|. The size of |iO(C)| is at most r(|C|) for some polynomial r(·) (Lemma 4.4). Further, the size of |C| is at most s(|C q |) for some polynomial |C q | (Lemma 4.4). By setting p(|C|) = 2|C q | + q(|C|) + r(s(|C|)), we have 3. Perfect Indistinguishability: Let C q1 and C q2 be two n-qubit equivalent Clifford circuits of the same size. Let |φ 1 , C ′ q1 and |φ 2 , C ′ q2 be the outputs of Algorithm 3 on inputs C q1 and C q2 respectively. Since C q1 (|τ ) = C q2 (|τ ) for every quantum state |τ we have, The update functions for any two equivalent Clifford circuits are equivalent (Lemma 4.3), further the classical iO that obfuscates the update functions (circuits) is perfectly indistinguishable for any two equivalent Clifford circuits (not necessarily of the same size) (Lemma 4.4). Therefore, C ′ q1 and C ′ q2 are perfectly indistinguishable. Proof. Let F Cq 1 and F Cq 2 be the update functions for two n-qubit Clifford circuits C q1 and C q2 respectively. Suppose F Cq 1 = F Cq 2 , then there must exist at least one binary string s = a 1 b 1 . . . a n b n ∈ {0, 1} 2n such that Since C q1 and C q2 are equivalent circuit we must have that for every quantum state |ψ : , then we can rewrite Equation (11) as We can replace C q2 (|ψ ) with C q1 (|ψ ) in Equation (12) ( Now if there exists a j such that a ′ j = d ′ j or b ′ j = e ′ j , then Equation (13) does not hold. This contradicts the assumption that C q1 and C q2 are equivalent Clifford circuits. Therefore F Cq 1 and F Cq 2 are equivalent functions. 17

Indistinguishability Obfuscator for Clifford: Update Functions
Here, we describe a perfect indistinguishability obfuscator iO for the update functions corresponding to the Clifford circuits. The algorithm takes an n-qubit Clifford circuit C q and output a classical circuit C that computes the update function F Cq . The circuit C is invariant for any two equivalent Clifford circuits. The main idea here is to compute the canonical form for the Clifford circuit, and then compute the update function for the canonical form.
Algorithm 4 iO for Clifford: Update Functions.
1. Compute the canonical form C q using the algorithm presented in [2] (section VI). Denote the canonical form as C q .
2. Let g 1 , g 2 , . . . , g m be a topological ordering of the gates in C q , where m = | C q |.
3. Construct the classical circuitĈ that computes the update function F Cq as follows. For i = 1 to m, implement the update rule for each gate g i (Section 2.14).
4. Output the classical circuitĈ. Proof. We have to show that Algorithm 4 satisfies Definition 2.3.

1.
Functionality: Let C q be an n-qubit Clifford circuit and C be the circuit that computes F Cq (the update function for C q ). Let C q be the canonical form of C q . Since C q and C q ′ are equivalent circuits, it follows from Lemma 4.3 that F Cq and F ′ Cq are equivalent functions, therefore any circuit that computes F ′ Cq also computes F Cq . From the construction above (Algorithm 4) it follows that the circuitĈ computes F ′ Cq thereforê C(x) = C(x) for all inputs x.

2.
Polynomial Slowdown: For each gate g i in C q , the classical circuit C has to implement one of the following operations (Section 2.14): Therefore the size of | C| can be at most be O(| C q |). The C q is a canonical form of C q and of at most q(|C q |) for some polynomial q(·) [2]. Therefore, there exists a polynomial p(·) such that | C| ≤ p(|C q |).
3. Perfectly Indistinguishability: Let C q1 , C q2 be two equivalent nqubit Clifford circuits (not necessarily of the same size) and C q be their canonical form. Note that the output of Algorithm 4 only depends on the canonical form of the input Clifford circuit. Since, C q1 and C q2 have the same canonical form we havê C ← Algorithm 4( C q ) = Algorithm 4(C q1 ) = Algorithm 4(C q2 ), Therefore, Algorithm 4 is a perfect indistinguishability obfuscation for the Clifford update functions.

Remark 4.5.
What is convenient about the iO of Algorithm 4 is that it works for any two equivalent Clifford circuits (regardless of their relative sizes) (see Lemma 4.3). However, we can use any perfectly secure iO in our construction with some care. Suppose iO is some perfectly secure indistinguishability obfuscator for classical circuits (for Clifford update functions) of the same size. Suppose we want to obfuscate an update circuit corresponding to some Clifford C q . The classical circuit C is constructed by going through each gate in C q . Some gates are more costly than others (for e.g., CNOT vs. Z, see proof of Theorem 4.2 or Section 2.14). Since we assume all Clifford circuits are of the same size, we can obtain an upper bound on all the classical circuits (for the update functions) by replacing each gate in C q with the most costly gate and then computing the classical circuit for the resulting quantum gate. Now suppose m is the upper bound on the size of classical circuits, then for any circuit C q , we first calculate the circuit C that computes F Cq and then pad C with m − |C| identity gates. This will ensure that if |C q1 | = |C q2 |, then |C 1 | = |C 2 |.

Obfuscating Beyond Clifford Circuits
In this section, we extend the gate teleportation technique to show how we can construct qiO for any quantum circuit. Our construction is efficient as long as the circuit has T-count at most logarithmic in the circuit size. For the sake of simplicity, we first construct a qiO for an arbitrary 1-qubit quantum circuit (Section 5.1), then extend the 1-qubit construction to any n-qubit quantum circuit (Section 5.2). We first start with some general observations on quantum circuits which are relevant to this section. Consider the application of the T-gate on an encrypted system using the quantum one-time pad. The following equation relates the T-gate to the X-and Z-gates: If b = 0, then P b is the identity; otherwise we have a P-gate correction. This is undesirable as P does not commute with X, making the update of the encryption key (a, b) complicated (since it is no longer a tensor product of Paulis). Note that we can write P = 1+i 2 I+ 1−i 2 Z, therefore Equation (14) can be rewritten as: Since 1+i , 1}, we can rewrite Equation (15) as, It follows from Equation (16) that for any a, b ∈ {0, 1}, we can represent TX b Z a as a linear combination of X and Z.
where α j ∈ 0, 1, 1+i . We further note that for a general n-qubit quantum unitary U and n-qubit Pauli P , there exists a Clifford C such that U P |ψ = CU |ψ . This is due to the Clifford hierarchy [30]. We also mention that if an n-qubit Clifford operation is given in matrix form, an efficient procedure exists in order to produce a circuit that executes this Clifford [37]. This is a special case of the general problem of synthesis of quantum circuits, which aims to produce quantum circuits, based on an initial description of a unitary operation.

Single-Qubit Circuits
Here, we show an indistinguishability obfuscation for single-qubit circuits. As previously mentionned, we note that for the single-qubit case, an efficient indistinguishability obfuscation can also be built using the Matsumoto-Amano normal form [26,36]. Here, we give an alternate construction based on gate teleportation. Let C q be a 1-qubit circuit we want to obfuscate and |ψ be the quantum state on which we want to evaluate C q . Note that we can write any 1-qubit circuit as a sequence of gates from the set {H, T} 18 C q = (g |Cq| , . . . , g 2 , g 1 ), g i ∈ {H, T} .
For the indistinguishability obfuscation of a single-qubit circuit, we use the gate teleportation protocol (Algorithm 1), which leaves us (after the teleportation) with a subsystem of the form C q X b Z a (|ψ ) and to evaluate the circuit on |ψ , we have to apply a correction unitary. Now suppose we apply the gate g 1 . We can write the system in Equation (18) as where Since {I, X, Z, XZ}, forms a basis, after applying the remaining gates in the sequence (g |Cq| , . . . , g 3 , g 2 ), we can write Equation (19) as C q X b Z a (|ψ ) = (β 1 I + β 2 X + β 3 Z + β 4 XZ)(g |Cq| , . . . , g 2 , g 1 )(|ψ ) (20) where each β i ∈ C and is computed by multiplying and adding numbers from the set {0, 1, 1+i 2 , 1−i 2 }. We show in Appendix A that the size of the coefficients β i grows at most as a polynomial in the number of T-gates. Therefore it follows from Equation (20) that the update function for any 1-qubit circuit C q can be defined as the following map, and is in one-to-one correspondence with the correction unitary β 1 I + β 2 X + β 3 Z + β 4 XZ. As indicated, our construction for 1-qubit circuits is nearly the same as the gate teleportation scheme for Clifford circuits (Algorithm 3). The proof that this is a qiO scheme is also very similar to the proof for the Clifford construction (Section 4.2); we thus omit the formal proof here (it can also be seen as a special case of the proof of Theorem 5.3). Some subtleties, however are addressed below: the equivalence of the update functions (Lemma 5.1) and the circuit synthesis (Lemma 5.2).
Lemma 5.1. Let C q1 and C q2 be two equivalent 1-qubit circuits. Then their corresponding update functions in the gate teleportation protocol are also equivalent.
We note that, on top of being equal, the circuits that compute the update functions F Cq 1 , F Cq 2 can be assumed to be of the same size. This follows by an argument very similar to the one in Remark 4.5.
Lemma 5.2. Based on the classical iO that computes the coefficients in Equation (20), it is possible to build a quantum circuit that performs the correction efficiently.
Proof. Given a 2 × 2 unitary matrix that represents a Clifford operation as in Equation (20), it is simple to efficiently derive the Clifford circuit that implements the unitary. This is a special case of the general efficient synthesis for Clifford circuits as presented in [37].

qiO via Gate Teleportation for all Quantum Circuits
In this section, we construct a qiO for all quantum circuits. The construction is efficient whenever the number of T-gates is at most logarithmic in the circuit size (see Algorithm 5). The reason for this limitation is that the update function blows up once the number of T-gates is greater than logarithmic in the circuit size. The construction is very similar to the gate teleportation for Clifford circuits (Section 4.2) and assumes the existence of a quantum-secure iO for classical circuits.
We are now ready to present our main theorem (Theorem 5.3). For ease of presentation, the proof relies on three auxiliary lemmas that are presented in the following section: Lemma 5.4 (which shows that equivalent circuits have equivalent update functions), Lemma 5.5 (which bounds the number of terms of the update function), and Lemma 5.6 (which shows that update functions can be computed by a polynomial-size circuits). Theorem 5.3. (Main Theorem) If iO is a perfect/statistical/computational quantum-secure indistinguishability obfuscation for classical circuits, then Algorithm 5 is a perfect/statistical/computational quantum indistinguishability obfuscator for any quantum circuit C q with T-count ∈ O(log |C q |).

Algorithm 5 qiO via Gate Teleportation for Quantum Circuits
• Input: A n-qubit quantum Circuit C q with T-count ∈ O(log(|C q |)).

2.
Apply the circuit C q on the right-most n qubits to obtain a system |φ : |φ = (I n ⊗ C q )|β 2n .

SetĈ ← iO(C).
Where C is a circuit that computes the update function F Cq as in Section 5.4. Note the size of C is at most a polynomial in |C q | (Lemma 5.6).
4. Description of the circuit C ′ q : (a) Perform a general Bell measurement on the leftmost 2n-qubits on the system |φ ⊗ |ψ , where |φ is an auxiliary state and |ψ is an input state. Obtain classical bits (a 1 , b 1 . . . , a n , b n ) and the state C q (X ⊗ n i=1 bi · Z ⊗ n i=1 ai )|ψ .
(c) Using the above, the correction unitary is Compute a quantum circuit that applies U FC q , using the circuit synthesis method of [37]. (d) Apply the quantum circuit for U FC q to the system C q (X ⊗ n i=1 bi · Z ⊗ n i=1 ai )|ψ to obtain the state C q (|ψ ).
Proof. We have to show that Algorithm 5 satisfies Definition 3.2. Throughout the proof, we assume that the quantum circuits have a logarithmic T-count in the circuit size.
1. Functionality: The proof of functionality follows from the principle of gate teleportation and is very similar to the proof in Theorem 4.2.
The size of C ′ q is equal to the size ofĈ plus the size of the circuit that performs the general Bell measurement (GBM ) and the size of the circuit that computes the circuit for U FC q . Since the size of |GBM | is in O(n), the size of |Ĉ| is polynomial in |C q | (Lemma 5.5, Lemma 5.6, Lemma A.1 and the definition of iO). Moreover, efficient Clifford synthesis implies that the size of the circuit for U FC q is polynomial [37]. Therefore, there exists a polynomial p(·) such that and C q2 be two n-qubit circuits of the same size. Let |φ 1 , C ′ q1 and |φ 2 , C ′ q2 be the outputs of Algorithm 3 on inputs C q1 and C q2 respectively. Since C q1 (|τ ) = C q2 (|τ ) for every quantum state |τ we have, The update functions for any two equivalent quantum circuits are equivalent (Lemma 5.4). If the classical iO that obfuscates the circuits for the update functions is perfectly/statistically/computationally indistinguishable, then states C ′ q1 and C ′ q2 are perfectly/statistically/computationally indistinguishable. 19 Therefore, Algorithm 5 is a perfectly/statistically/ computationally indistinguishable quantum obfuscator for the quantum circuits.

Equivalent Update Functions
Here, we provide a generalization of Lemma 4.3, applicable to the case of general circuits.
Lemma 5.4. Let C q1 and C q2 be two equivalent n-qubit circuits. Then their corresponding update functions are also equivalent.
Proof. Suppose C q1 and C q2 are two equivalent n-qubit quantum circuits, then for any quantum state |ψ and for any binary string r ∈ {0, 1} 2n .
Then the corresponding update functions are (see Equation (26)) where s i = a i1 b i1 , . . . , a in b in ∈ {0, 1} 2n , and s ′ j = a j1 b j1 , . . . , a jn b jn ∈ {0, 1} 2n . Without loss of generality, we can assume that . Using the update functions, we can rewrite Equation (22) as (23) Since C q1 and C q2 are equivalent, we can replace C q2 with C q1 in Equation (23) Note the update functions F Cq 1 and F Cq 2 are in one-to-one mapping with the unitaries on the left-and right-hand side of Equation (25) respectively. Since, the unitaries are equivalent, the corresponding update functions are also equivalent.

Complexity of Computing the Update Function
Let C q be an n-qubit circuit consisting of a sequence of gates g 1 . . . , g |Cq| . The update function F Cq is computed by composing update functions for each gate in C q . F Therefore the update function for any n-qubit quantum circuit C q with k Tgates can be defined as the following map.
which corresponds to the following correction unitary where β i ∈ C and s i = a i1 b i1 , . . . , a in b in ∈ {0, 1} 2n , i ∈ [4 k ]. Therefore, in order to satisfy the efficiency requirement (polynomial-slowdown), we must have k ∈ O(log(|C q |)). Note that the range of the update function can increase exponentially in the number of T-gates as long as k ≤ n (Equation (26)). This is because there are at most 2 2n binary strings of length 2n, therefore for any n-qubit circuit, the correction unitary Equation (27) can be written as a summation of at most 2 2n terms. We will first prove that as long as the T-count in O(log(|C q |), the number of terms in F Cq has at most O(|C q |) terms.
Lemma 5.5. If C q is an n-qubit quantum circuit with T-count in O(log(|C q |), then the update function F Cq (Equation (26)) has at most O(|C q |) terms.
Proof. Let C q be an n-qubit circuit with T-count in O(log(|C q |). Suppose we want to evaluate C q on some n-qubit state |ψ , then after the step 4a of Algorithm 5, we will obtain a state In order to recover C q (|ψ ) from the above expression, we multiply the correction unitary U FC q to the left hand side of expression Equation (28). To compute U FC q we first compute the update function F Cq on the input a 1 b 1 , . . . , a n b n F Cq (a 1 b 1 , . . . , a n b n ) = ((β 1 , s 1 ), . . . , (β 4 k , s 4 k )) where We will show that if the T-count is in O(log(|C q |), then k ∈ O(|C q |) (number of terms). Recall that • Case 0: Suppose C q has no T-gates, then C q is a Clifford and there is only one term in F Cq . Therefore k = 0.
• Case 1: Suppose C q has one T-gate (acting on some ℓ-th wire).
Therefore k ≤ 4. It is important to realize that 4 is the maximum number of terms a circuit with T can have. No Clifford gate including CNOT can increase the number of terms beyond 4. This is because only a T gate can contribute a 4-term expression and then we expand all the terms in the correction unitary to maximum (Equation (30)). Now any Clifford acting on the correction unitary will act linearly on U FC q and only affect the bits a ′ i and b ′ i (Equation (30)).
• Case 2: Similarly, if C q has two T gates, then each will contribute at most one expression of the form (β 1 I + β 2 X + β 3 Z + β 4 XZ). This will give us a correction unitary U FC q = 4 2 i=1 β i X bi 1 Z ai 1 ⊗ · · · ⊗ X bin Z ai n , therefore k ≤ 16. Note that it makes no difference whether T gates are acting on the same wire or on different wires for the worst-case analysis. If they are on the same wire, then the first T will contribute 4 terms and the second T will expand each term into 4 more terms, resulting in 16 terms. If they are acting on different wires, say i and j and suppose CNOTs are acting on the i-th to j-th wire, then we may have to expand all terms in the unitary to apply CNOTs. This again can contribute at most 16 terms.
General Case: Suppose C q has O(log(|C q |) T gates, then each T-gate will contribute at most a linear combination of 4 terms and in total at most 4 O(log(|Cq|) terms. therefore k ∈ O(|C q |).
Lemma 5.6. If C q be an n-qubit quantum circuit with T-count ∈ O(log |C q |), then there exists a classical circuit C and a polynomial p(·) such that • C computes the update function F Cq , • |C| ≤ p(|C q |).
Proof. Let C q be a n-qubit quantum circuit with T-count ∈ O(log |C q |). Recall from Section 2.14 that the corresponding update functions for the Clifford + T gate set are: Let C X , C Z , C H , C P , C CNOT and C T denote the classical circuits (called subcircuits) that compute f X , f Z , f H f P , f CNOT and f T respectively. Clearly, these subcircuits are of constant size. Recall that all subcircuits for Cliffords map k-bit strings to k-bit strings (k ∈ {0, 1}), but C T expands its 2-bit input into a 4ℓ-bit strings (where ℓ = max{ 1+i 2 , 1−i 2 } 20 . Let C be a circuit that computes F Cq . Then C can be expressed in terms of these gadgets. To construct C, we go gateby-gate in C q and employ the corresponding subcircuit. If C q is a Clifford circuit, then C only consists of Clifford subcircuit (as mentioned earlier they map k bits to k bits k ∈ {2, 4} there are O(|C q |) gadgets in the circuit C). Otherwise if C q has k T-gates, then each C T subcircuit will map a 2-bit string to a 4ℓ-bit string, potentially increasing the size of C to O((4ℓ) k ), but since k ∈ O(log(|C q |), we . Therefore, there exists a polynomial p(·) such that |C| ≤ p(n).

Quantum Indistinguishability Obfuscation with
Respect to a Pseudo-Distance In this section, we provide a definition for circuits that are approximately equivalent (with respect to a pseudo-distance) (Definition 6.1). In Section 6.2, we present a definition of quantum indistinguishability obfuscation with respect to a pseudo-distance, and in Section 6.3, we present a scheme that satisfies this definition, for circuits close to a fixed level of the Gottesman-Chuang hierarchy.

Approximately Equivalent Quantum Circuits
Definition 6.1. (Approximately Equivalent Quantum Circuits): Let C q0 and C q1 be two n-qubit quantum circuits and D be a pseudo-distance. We say C q0 and C q1 are approximately equivalent with respect to D if there exists a negligible function negl(n) such that D(C q0 , C q1 ) ≤ negl(n).

Indistinguishability Obfuscation for Approximately Equivalent Quantum Circuits
In this section, we provide a definition of quantum indistinguishability obfuscation for approximately equivalent circuits, qiO D . To be consistent with Definition 3.2, we require that the obfuscator, on input a quantum circuit C q , outputs an auxiliary quantum state |φ and a quantum circuit C ′ q , but note in the actual construction (Algorithm 6), the state |φ is an empty register. Here, we consider only the case of statistical security. Notable here is the indistinguishability property is required to hold not only for equivalent quantum circuits, but also for approximately equivalent quantum circuits. Also, contrary to Definition 3.2, we only require the indistinguishability for large values of n. Definition 6.2. Let C Q be a polynomial-time family of reversible quantum circuits and let D be a pseudo-distance. For n ∈ N, let C q n be the circuits in C Q of input length n. A polynomial-time quantum algorithm for C Q is a statistically 20 The notation |a + bi| denotes the number of bits to represent the complex number a + bi. secure quantum indistinguishability obfuscator (qiO D ) for C Q with respect to D if the following conditions hold: 1. Functionality: There exists a negligible function negl(n) such that for every C q ∈ C q n (|φ , C ′ q ) ← qiO D (C q ) and D(C ′ q (|φ , ·), C q (·)) ≤ negl(n).
3. Statistically Secure Indistinguishability: For any two approximately equivalent quantum circuits C q0 , C q1 ∈ C q n , of the same size and for large enough n, the two distributions qiO D (C q0 ) and qiO D (C q1 ) are statistically indistinguishable.

qiO D for Circuits Close to the Gottesman-Chuang Hierarchy
Here, we present a quantum indistinguishability obfuscation (Definition 3.2) for a family of circuits that are approximately equivalent (Definition 6.1) with respect to the pseudo-distance D(U 1 , U 2 ) = 1 √ 2d 2 ||U 1 ⊗ U * 1 − U 2 ⊗ U * 2 || F (see Section 2.6). There are two main ingredient in our construction, one is Low's learning algorithm [35] (described below) and the second is Lemma 6.3.
In [35] Low presents a learning algorithm that, given oracle access to a unitary U and its conjugate U † with the promise that the distance D(U, C) ≤ ǫ < 1 2 k−1/2 for some C ∈ C k (Section 2.9), outputs a circuit C q for computing C with probability at least 1 − δ with O 1 ǫ ′ 2 (2n) k−1 log (2n + 1) k−1 ) δ queries. Where ǫ ′ := 2(1 − (2 k−1 ǫ) 2 − 1 > 0 and D(U 1 , U 2 ) = 1 √ 2d 2 ||U 1 ⊗ U * 1 − U 2 ⊗ U * 2 || F is the pseudo-distance defined in Section 2.6. Based on Low's work, we construct an quantum indistinguishability obfuscation qiO D with respect to this pseudo-distance D for circuits that are very close to C k . Note that the run-time of Low's algorithm is exponential in k. Moreover, the algorithm becomes infeasible if ǫ ′ is very small. Therefore, to ensure that 21 A circuit is of type (i, j) if it maps i qubits to j qubits. our construction in Algorithm 6 runs in polynomial-time we set k to be some fixed positive integer and ǫ ≤ negl(n) < 1 2 k−1/2 for all n. Note if ǫ < 1 2 k−1/2 , then ǫ ′ ≥ √ 7 2 − 1. Lemma 6.3. Let U and C be unitaries. If the distance D(U, C) < 1 2 k−1/2 for some C ∈ C k , then C is unique up to phase.
Theorem 6.4. Let C Q = {U q n,k | n ∈ N and k is fixed positive integer}, be a polynomial-time family of reversible quantum circuits. Here, U q n,k denotes the n-qubit circuits for which there exists a negligible function negl(n) such that for any U q ∈ U q n,k , there exists a C q ∈ C k that satisfies D(U q , C q ) < negl(n) < 3. Statistically Indistinguishability: Let U q , U ′ q ∈ U q n,k be two circuits such that D(U q , U ′ q ) < negl(n). By assumption (Theorem 6.4), there exist unitaries C, C ′ ∈ C k such that D(U q , C) < negl(n) < 1 2 k+1/2 and D(U ′ q , C ′ ) < negl(n) < 1 2 k+1/2 . Using the triangle inequality we can easily show that C and C ′ are equivalent circuit (up to a global phase) for large n.
According Lemma 6.3 C ′ is unique (up to a global phase) such that D(U q , C ′ ) < 1 2 k−1/2 , But C also satisfies D(U q , C) < 1 2 k−1/2 . It follows that C and C ′ are equivalent circuits (up to a global phase). Moreover, the outputs of Low's algorithm C q and C ′ q on any two equivalent unitaries (up to global phase) is statistically indistinguishable [35]. Therefore, for any U q , U ′ q ∈ U q n,k , the two distributions qiO D (U q ) and qiO D (U ′ q ) are statistically indistinguishable.
Note that there is a one-to-one map between F Cq and the corresponding unitary U FC q = 4 k i=1 β i X bi 1 Z ai 1 ⊗ · · · ⊗ X bin Z ai n , k ≤ n. Note that any Clifford gate can only affect the correction bits in unitaries of type U FC q , but will have no effect on the coefficients β i . So the coefficients can be affected by T gates. Therefore, to estimate the size of the coefficients we can ignore other gates. Each β i is constructed by adding and multiplying numbers from the set 0, 1, 1+i 2 , 1−i 2 . We note the following relationships between 1+i 2 , 1−i