Number-Theoretic Characterizations of Some Restricted Cliﬀord+T Circuits

Kliuchnikov, Maslov, and Mosca proved in 2012 that a 2 × 2 unitary matrix V can be exactly represented by a single-qubit Cliﬀord+ T circuit if and only if the entries of V belong to the ring Z [1 / √ 2 , i ] . Later that year, Giles and Selinger showed that the same restriction applies to matrices that can be exactly represented by a multi-qubit Cliﬀord+ T circuit. These number-theoretic characterizations shed new light upon the structure of Cliﬀord+ T circuits and led to remarkable developments in the ﬁeld of quantum compiling. In the present paper, we provide number-theoretic characterizations for certain restricted Cliﬀord+ T circuits by considering unitary matrices over subrings of Z [1 / √ 2 , i ] . We focus on the subrings Z [1 / 2] , Z [1 / √ 2] , Z [1 /i √ 2] , and Z [1 / 2 , i ] , and we prove that unitary matrices with entries in these rings correspond to circuits over well-known universal gate sets. In each case, the desired gate set is obtained by extending the set of classical reversible gates { X, CX, CCX } with an analogue of the Hadamard gate and an optional phase gate.


Introduction
Kliuchnikov, Maslov, and Mosca showed in [26] that a 2-dimensional unitary matrix V can be exactly represented by a single-qubit Clifford+T circuit if and only if the entries of V belong to the ring Z[1/ √ 2, i]. This result gives a number-theoretic characterization of single-qubit Clifford+T circuits. In [17], Giles and Selinger extended the characterization of Kliuchnikov et al. to multi-qubit Clifford+T circuits by proving that a 2 n -dimensional unitary matrix can be exactly represented by an n-qubit Clifford+T circuit if and only if its entries belong to Z[1/ √ 2, i]. These number-theoretic characterizations provide great insight into the structure of Clifford+T circuits. As a result, single-qubit Clifford+T circuits are now very well understood [13,18,28,29,34], and some of these results have even been extended to single-qubit circuits beyond the Clifford+T gate set [12,16,25,27,32,33]. In contrast, our understanding of multi-qubit Clifford+T circuits remains more limited, despite interesting results [11,15,19,20,39]. One of the reasons for this limitation is that large unitary matrices over Z[1/ √ 2, i] are hard to analyze. In order to circumvent the difficulties associated with multi-qubit Clifford+T circuits, restricted gate sets have been considered in the literature. This led to important developments in the study of multi-qubit Clifford, CNOT+T , and CNOT-dihedral circuits [3-6, 23, 30, 36]. Unfortunately, the simpler structure of these restricted gate sets comes at a cost: they are not universal for quantum computing.
In the present paper, our goal is to address both of these limitations by considering restrictions of the Clifford+T gate set which are nevertheless universal for quantum computing. To this end, we study circuits corresponding to unitary matrices over proper subrings of Z [ For each subring, we find a set of quantum gates G with the property that circuits over G correspond to unitary matrices over the given ring. Writing U 2 n (R) for the group of 2 n × 2 n unitary matrices over a ring R, our main results can then be summarized in the following theorem. where ω = e iπ/4 and F ∝ √ H. Moreover, in (i)-(iv), a single ancilla is sufficient.
The gate sets in items (i)-(iv) of the above theorem are all universal for quantum computing [2,37], and we sometimes refer to circuits over these gate sets as integral, real, imaginary, and Gaussian Clifford+T circuits, respectively. As a corollary to the above theorem, we also obtain two additional characterizations of universal gate sets.

Moreover, in (i) and (ii), a single ancilla is sufficient.
As a final corollary to the theorem above, we refine the characterizations (iii) and (iv) by showing that in these cases a matrix can be represented by an ancilla-free circuit if and only if it has determinant 1. In (i) and (ii), the requirement that det V = 1 can be dropped for n < 4.
The characterization of ancilla-free real and integral Clifford+T circuits remains an open question but we conjecture that they correspond to a strict subgroup of the group of unitaries with determinant 1.
Restrictions similar to the ones considered here were previously studied in the context of foundations [35], randomized benchmarking [22], and graphical languages for quantum computing [8,24,38]. Furthermore, our study fits within a larger program, initiated by Aaronson and others, which aims at classifying quantum operations. Such classifications exist for classical reversible operations [1], for stabilizer operations [21], and for beam-splitter interactions [14], but no classification is known for a universal family of quantum operations suited for fault-tolerant quantum computing. In this context, our work can be seen as a partial classification of the universal extensions of the set of classical reversible gates {X, CX, CCX}. This perspective is illustrated in Figure 1, which depicts a fragment of the lattice of where, for conciseness, we wrote D for the ring Z[1/2] so that the rings , respectively. The rest of the paper is organized as follows. In Section 2, we give an overview of our methods. In Section 3, we introduce the rings and matrices which will be used throughout the paper. In Section 4, we show that certain useful matrices can be exactly represented by restricted Clifford+T circuits. Section 5 contains the proofs of our various number-theoretic characterizations. We conclude in Section 6.

Overview
Unrestricted Clifford+T circuits are generated by To the left of the cube, in yellow, the symmetric group Sn corresponds to circuits over the gate set {X, CX, CCX}. On the bottom face of the cube, in blue, are generalized symmetric groups, and on the top face of the cube, in red, are universal subgroups of Un(D [ω]). The edges of the lattice denote inclusion. The gates labeling the edges are sufficient to extend the expressive power of a gate set from one subgroup to the next (and no further). For example, the edge labeled Z going from Sn to Un(Z) indicates that adding the Z gate to {X, CX, CCX} produces a gate set expressive enough to represent every matrix in Un(Z) (but not every matrix in Un(Z [i])).
Since ω = (1 + i)/ √ 2, the entries of all the generators belong to the ring . Hence, if a matrix V can be represented exactly by an n-qubit Clifford+T circuit, then V ∈ U 2 n (D [ω]), the group of 2 n × 2 n unitary matrices with entries in D [ω]. Showing that the ring D [ω] characterizes Clifford+T circuits thus amounts to proving the converse implication. An algorithm establishing that every element of U 2 n (D [ω]) can be exactly represented by a Clifford+T circuit is known as an exact synthesis algorithm.
The original insight of Kliuchnikov, Maslov and Mosca in the single-qubit Clifford+T case was to reduce the problem of exact synthesis to the problem of state preparation. The latter problem is to find, given a target vector v ∈ D [ω] n , a sequence G 1 , . . . , G of Clifford+T gates such that G · · · G 1 e 1 = v or, equivalently, such that G † 1 · · · G † v = e 1 . Kliuchnikov et al. realized that this sequence of gates can be found by first writing v as v = u/ √ 2 q for some u ∈ Z [ω] and then iteratively reducing the exponent q.
This basic premise was extended by Giles and Selinger to the multi-qubit context by adding an outer induction over the columns of an n-qubit unitary. This method amounts to performing a constrained Gaussian elimination where the row operations are restricted to a few basic moves. The Giles-Selinger algorithm proceeds by reducing the leftmost column of an n×n unitary matrix to the first standard basis vector by applying a sequence of one-and two-level matrices, which act non-trivially on at most two components of a vector, before recursively dealing with the remaining submatrix. If the target unitary is V = v V , then the Giles-Selinger algorithm first constructs a sequence of matrices G 1 , . . . , G such that G 1 · · · G v = e 1 . Left-multiplying V by this sequence of matrices then yields where V is unitary. The fact that the matrices used in this reduction act non-trivially on no more than two rows of the matrix ensures that when the algorithm recursively reduces the columns of V it does so without perturbing the previously fixed columns. The Giles-Selinger algorithm thus relies on the following two facts.

A unit vector in D [ω]
n can be reduced to a standard basis vector by using one-and two-level matrices and 2. the required one-and two-level matrices can be exactly represented by Clifford+T circuits.
While there are subtle differences between the various cases discussed below, our method in characterizing restricted Clifford+T circuits follows this general structure.

Rings and Matrices
In this section, we discuss the rings and matrices that will be used throughout the paper. For further details, the reader is encouraged to consult [7].

Rings
We write N for the set of nonnegative integers and if n ∈ N we write [n] for the set {1, . . . , n}. We use Z to denote the ring of integers and i to denote the imaginary unit. We define ω as ω = e iπ/4 = (1 + i)/ √ 2. Note that i is a 4-th root of unity and that ω is an 8-th root of unity.
We will use the extensions of Z defined below.
, and Z [ω] are known as the ring of quadratic integers with radicand 2, the ring of quadratic integers with radicand -2, the ring of Gaussian integers, and the ring of cyclotomic integers of degree 8, respectively. All of these rings are distinct subrings of Z [ω] and we have the inclusions depicted in the lattice of subrings below.
Further to the rings introduced in Definition 3.1, we will consider extensions of the ring of dyadic fractions, i.e., fractions whose denominator is a power of 2.
If v ∈ D √ 2 , then v can be written as v = u/2 q for some q ∈ N and some u ∈ Z √ 2 . A similar property holds for elements of D i √ 2 , D[i], and D [ω]. If R is a ring and r ∈ R we write R/(r) for the quotient of the ring R by the ideal generated by the element r. Two elements s and s of R are congruent modulo r if s − s belongs to the ideal (r), in which case we write s ≡ s (mod r). We sometimes refer to the elements of the ring R/(r) as residues. Some quotient rings are well-known. For example, Z/(2) = {0, 1} and Z/(4) = {0, 1, 2, 3}. The following proposition gives an explicit description of certain lesser-known rings of residues which will be useful in what follows.
We will often take advantage of properties of residues. Some of these properties are generic. For example, if u and v are two elements of a ring R and u ≡ v (mod 2), then u ± v ≡ 0 (mod 2). Other properties of residues are specific to a particular ring. For example, an integer u ∈ Z is odd if and only if u 2 ≡ 1 (mod 4). Similarly, for an integer u ∈ Z, we have u ≡ 3 (mod 4) if and only if −u ≡ 1 (mod 4). We now state important properties of residues in Z i √ 2 and Z [i] for future reference. They can be established by reasoning using residue tables in the relevant quotient rings. In the following, we denote the complex conjugate of an element u by u † . For uniformity, we sometimes write u † even when u belongs to a real subring of D [ω]. In this case, u † = u. Proposition 3.5. The following statements hold.
Proposition 3.6. The following statements hold.

Matrices
We write e j for the j-th standard basis vector and M † for the conjugate transpose of the matrix M . If R is a ring, we sometimes write R n×n for the collection of n × n matrices over R. We will use one-, two-, and four-level matrices which act non-trivially on only one, two, or four of the components of their input. These matrices will be defined using basic matrices. The construction is best explained with an example. If is a 2-dimensional unitary matrix, then in 3 dimensions the two-level operator of type V , denoted by V [1,3] , is the matrix given below.
Let W be an n × n unitary matrix, let n ≤ n , and let a 1 , . . . , a n ∈ [n ]. The n-level matrix of type W is the n × n unitary matrix W [a1,...,an] defined by and let p be an element of Z [ω]. We will be interested in matrices of the form where W is a matrix over R and q ∈ N.
The smallest such q is the least p-denominator exponent of V , denoted lde p (V ).
We sometimes omit p when the base of the exponent is clear from the context. Note that the notion of denominator exponent applies to matrices of any dimension and we can therefore talk about the denominator exponent of a vector or scalar.

Circuits
In this section, we review basic circuit constructions which will be useful below. A more detailed discussion of quantum circuits can be found in Chapter 4 of [31].
Let ζ be an m-th root of unity. We sometimes call ζ a global phase of order m. We think of these global phases as gates acting on 0 qubits and in what follows we will be especially interested in the global phases of order 2, 4, and 8, which we denote −1, i, and ω, respectively. The single-qubit phase gate of order m is defined as We will be particularly interested in phase gates of order 2, 4, and 8 which we call the Z, S, and T gates, respectively. Hence In addition to phase gates, we will also use the single-qubit gates H and X defined by The H gate is the Hadamard gate and the X gate is the NOT gate. The last single-qubit gate we will use is the F gate defined below.
The F gate is not as common as the other single-qubit gates introduced above. We note that F 2 = iH and that F can be expressed as a product of better-known gates in Matsumoto-Amano normal form [29], We will also make use of the two-qubit H ⊗ H gate as well as the controlled gates defined below.
We will refer to these gates as the controlled -H gate, controlled -X or CNOT gate, and the doublycontrolled -X or Toffoli gate, respectively. In general, if G is a gate, then we write C n G for the n-control -G gate.
As usual, circuits are built from gates through composition and tensor product. An ancilla is a qubit used locally within a circuit but on which the global action of the circuit is trivial. We say that a 2 n × 2 n unitary matrix W is exactly represented by a circuit D using m clean ancillas if for any n-qubit state |ψ , If the circuit is independent of the initial state of the ancilla, it is said to accept a dirty ancilla. In particular, we say that a 2 n × 2 n unitary matrix W is exactly represented by a circuit D using m dirty ancillas if for any n-qubit state |ψ and any m-qubit state |φ , Note that a clean ancilla can always be used in place of a dirty ancilla.
In order to characterize restricted Clifford+T circuits, it is helpful to establish some basic facts about the construction of multi-level matrices over gate sets including the Toffoli gate. Proof. By the Giles-Selinger algorithm [17] restricted to permutation matrices, V can be represented by a circuit over two-level X gates. Likewise, each two-level X gate can be implemented over fully-controlled X and single-qubit gates by using a Gray code (see, e.g., [31,Sec. 4.5.2]). Each fully-controlled X gate can be implemented with one dirty ancilla by [9], which completes the proof. Proof. This follows from standard techniques, e.g. [9]. If n = 1, then CW can be implemented with a single dirty ancilla and thus also with a clean one. If n > 1, then the C n W gate can be implemented as follows, where each gate on the right has at least one dirty ancilla available for use.
We can now use Corollary 4.3 to give constructions of multi-level matrices of different types over their uncontrolled versions in the presence of the Toffoli gate. Proof. By Corollary 4.3 it suffices to give constructions for the singly-controlled Z and H ⊗ H gates using at most a single dirty ancilla. We have and it can be verified that the equality below holds. Proof. Again, it suffices to give constructions for the singly-controlled S and ωH gates. In this case it can be verified that both of the equalities below hold. Proof. To show that CZ is representable over the gate set, it can be observed that the equality below holds, since F 2 = iH and F 6 = −iH.
The construction of CF is somewhat more involved, but can be obtained from standard constructions (e.g., [9]) by first noting that (ZXF ) 2 and X(ZXF )X(ZXF )X = ZXF . The CF gate can then be constructed as below. If V is a matrix over D, then V can be written as where q ∈ N and W is a matrix over Z. We will consider 2-denominator exponents of such matrices.
The following four lemmas are devoted to proving the analogue of Giles and Selinger's Column Lemma (Lemma 5 in [17]). Here, the goal is to establish that any unit vector over D can be reduced to a standard basis vector by multiplying it on the left by an appropriately chosen sequence of generators. We consider the case of vectors of dimension n < 4 first, before moving on to higher dimensions.
Proof. Write v as v = u/2 q with u ∈ Z n and q = lde 2 (v). Since v is a unit vector, we have v † v = 1 and thus 4 q = u † k u k = u 2 k . The square of any odd number is congruent to 1 modulo 4. Thus when n < 4, we have u 2 k ≡ 0 (mod 4) only if every u k is even. This implies that lde 2 (v) = 0 when n < 4 and therefore that v = ±e j for some j ∈ [n]. Hence one of must hold, which completes the proof.
Because (H ⊗ H) [a,b,c,d] is a four-level matrix, we consider its action on certain 4-dimensional vectors in the lemma below. This is in contrast with Giles and Selinger's algorithm, for which only one-and two-level matrices are needed.
Proof. Write v as v = u/2 q where u ∈ Z n and q > 1. Since v is a unit vector we have v † v = 1 and thus 4 q = u † k u k = u 2 k since u is real. The number of u k such that u 2 k ≡ 1 (mod 4) is therefore congruent to 0 modulo 4. Hence, we can group these entries in sets of size 4 and apply Lemma 5.2 to each such set in order to reduce the 2-denominator exponent of the vector.

Lemma 5.4. Let j ∈ [n].
If v is an n-dimensional unit vector over D, then there exist generators G 1 , . . . , G from (2) such that G 1 · · · G v = e j .
Proof. The case of vectors of dimension n < 4 was treated in Lemma 5.1 so we assume that n ≥ 4 and we proceed by induction on the least 2-denominator exponent of v.
• If lde 2 (v) = 0, then v is a unit vector in Z n . Hence v = ±e j for some j ∈ [n] and one of • If lde 2 (v) > 0, apply Lemma 5.3 to reduce the 2-denominator exponent of v.
We can now use Lemma 5.4 to prove that every unitary matrix with entries in D can be written as a product of generators. This, together with Proposition 4.4 establishes our characterization of circuits over the gate set {X, CX, CCX, H ⊗ H}.

Theorem 5.5. If V is an n-dimensional unitary matrix with entries in D, then there exist generators
Proof. By iteratively applying Lemma 5.4 to the columns of V .

Super-integral Clifford+T operators
One might wonder whether the H ⊗ H gate can be replaced with the H gate. Since the H gate lies strictly outside of U 2 n (D), having denominator √ 2, we get a slightly more general gate set. Circuits over this gate set generate matrices of the form where q ∈ N and W is a matrix over Z. We now leverage Theorem 5.5 and Corollary 4.5 to show that every unitary matrix of the form in Eq. (4) can be represented by a circuit over {X, CX, CCX, H}. For these matrices, we use √ 2denominator exponents. We extend the set of generators from (2) with a matrix of the form I ⊗ H. Thus the relevant generators are now where a, b, c, and d are distinct elements of [n], and I n/2 ⊗ H is only well-defined when n is even. As the extra generator is only available in even dimensions, we start by showing that there are no odd-dimension unitary matrices of the form of Eq. (4) with odd q. The proof of this fact is due to Xiaoning Bian [10]. (4), then all the √ 2-denominator exponents of V are congruent modulo 2.

Lemma 5.7. If V = 0 is as in
Proof. Suppose that q < q are two √ 2-denominator exponents of V . Then V = W/ √ 2 q = W / √ 2 q for some integer matrices W and W . Assume without loss of generality that q < q . Then

Lemma 5.8. If v is an n-dimensional unit vector of the form
where u is an integer vector and q is odd, then there exist generators G 1 , . . . , G from (5) such that Proof. By induction on q. For the base case, it suffices to observe that since u 2 k = 2, there exist j, j such that u j = (−1) mj and u j = (−1) m j and the other entries of u are all 0. It can then be verified that Now suppose q ≥ 3. Then u 2 k = 2 q = 4 q and hence the number of u 2 k ≡ 1 (mod 4) is congruent to 0 modulo 4. Then, as in Lemma 5.3, we can group these entries in sets of size 4 and apply Lemma 5.2 to each set to reduce the √ 2-denominator exponent of the vector by 2.
Note also that the proof of Lemma 5.8 implies that there are no unit vectors of the form v = u/ √ 2 q with odd q ≥ 3 and dimension n < 4. Proof. By induction on n. If n = 1, then the only possibility is V = 1, hence there is no such unitary with odd least √ 2-denominator exponent. Now consider n ≥ 3 and assume that V = W/ √ 2 q where q is odd and W is an integer matrix. Let v be the first column of V . By Lemma 5.7, all the √ 2-denominator exponents of v are odd and by Lemma 5.8 there exists a unitary transformation G = G 1 · · · G U such that Let u 1 , u 2 be the first two columns of (GV ) † . Since (GV ) † is unitary, we know that u † 1 u 1 = u † 2 u 2 = 1, and u † 1 u 2 = u † 2 u 1 = 0. In can then be observed from the unit condition on u 1 and u 2 , that they each have one additional ±(1/ √ 2) entry, and are 0 everywhere else. Further, by the orthogonality condition it follows that these entries both occur on the same row j. Hence there exists m such that where V is a unitary matrix of the form of Eq. (4) that has odd dimension and, by Lemma 5.7, odd least √ 2-denominator exponent, a contradiction.
Having ruled out matrices with odd dimension and odd √ 2-denominator exponent, we can now prove our theorem. Proof. If q is even, the result follows from Theorem 5.5. If q is odd, then by Lemma 5.9 n must be even, and so (I n/2 ⊗ H)V is a matrix with entries in D. Hence the result follows by applying Theorem 5.5 to (I n/2 ⊗ H)V .

The D √ 2 case
We now focus on the group of n × n unitary matrices with entries in D √ 2 . The elements of this group can be written as where q ∈ N and W is a matrix over Z √ 2 . We now use √ 2-denominator exponents and the relevant generators are where a and b are distinct elements of [n]. By Proposition 4.8, all of the above generators can be exactly represented by quantum circuits over the gate set {X, CX, CCX, H, CH}. As in the previous cases, we prove our characterization by showing that any unitary matrix of the form (6) can be expressed as a product of generators from (7).

Lemma 5.13.
If v is an n-dimensional unit vector over D √ 2 and lde √ 2 (v) > 0, then there exist generators G 1 , . . . , G from (7) such that Since v is a unit vector we have v † v = 1 and thus 2 q = u † j u j = u 2 j since u is real. Letting u j = x j + y j √ 2, this yields the following equation Thus x 2 j ≡ 0 (mod 2) and x j y j = 0. It follows that u j ≡ 1 (mod 2) for evenly many j and u j ≡ 1 + √ 2 (mod 2) for evenly many j. We can therefore group these entries in sets of size 2 and apply Lemma 5.12 to each such set in order to reduce the √ 2-denominator exponent of the vector.
The following three statements are established like the corresponding ones in the previous section. For this reason, we omit their proofs.

The D i √ 2 case
We now consider the group of n × n unitary matrices with entries in D i √ 2 . Such matrices can be written as where q ∈ N and W is a matrix over Z i √ 2 . We now use i √ 2-denominator exponents and the relevant generators are where a and b are distinct elements of [n]. By Proposition 4.9, all of the above generators can be exactly represented by quantum circuits over the gate set {X, CX, CCX, F }. As in the previous cases, we establish our characterization by showing that any unitary matrix of the form (8) can be expressed as a product of generators from (9).
, then there exist m 0 , m 1 , m 2 , and m 3 such that Proof. First consider the case in which u 1 ≡ u 2 (mod 2). Then u 1 + u 2 ≡ u 1 − u 2 ≡ 0 (mod 2) and it can be verified that . We now consider the case in which u 1 ≡ u 2 (mod 2). In this case, the fact that u † 1 u 1 ≡ u † 2 u 2 ≡ 1 (mod 2) implies that one of u 1 or u 2 is congruent to 1 or 3 modulo 2i √ 2 while the other is congruent to ( We can therefore find m 1 , m 2 , m 3 such that But and Hence we can set u 1 = ((1 + i √ 2)u 1 + u 2 )/2 and u 2 = (u 1 + (−1 + i √ 2)u 2 )/2 to complete the proof.

Lemma 5.18. If v is an n-dimensional unit vector over
Since v is a unit vector we have v † v = 1 and thus (-2) q = u † j u j . Thus u † j u j ≡ 0 (mod 2) and it follows that u † j u j ≡ 1 (mod 2) for evenly many j, since modulo 2 we have u † j u j ≡ 0 or u † j u j ≡ 1. We can therefore group these entries in sets of size 2 and apply Lemma 5.17 to each such set in order to reduce the denominator exponent. Proof. If det V = 1, then V cannot be exactly represented over {X, CX, CCX, F } without ancillas when n ≥ 4, as each gate has determinant 1 in this case. Now suppose det V = 1. First observe that in Lemma 5.17, and consequently Lemma 5.18, the least i √ 2-denominator exponent can be reduced by substituting F m0 (−1) m1 [1] (−1) m2 [2] X m3 as follows: F (−1) [2] X → (ZF )(ZX), and F (−1) [1] (−1) [2] X → (F Z)(XZ).
Moreover, F Z, ZF , XZ and ZX have determinant 1 and can be represented over {X, CX, CCX, F } without ancillas when n ≥ 4 as shown in Appendix A.1. Likewise, an analogue of Lemma 5.19, where G 1 · · · G v = i m e j , holds by using the two-level ZX operator, which has determinant 1 and is representable without ancillas as shown in Appendix A.1. It now suffices to note that there exist generators G 1 , . . . , G from the set XZ [a,b] , ZX [a,b] , F Z [a,b] , ZF [a,b] such that where D is a diagonal unitary with entries ±1. Since det D = det V = 1, there are an even number of −1 entries, thus we can group them into pairs and use four-level I ⊗ Z operators to change each pair into +1 and obtain the identity matrix.

The D[i] case
where a and b are distinct elements of [n]. We reason as in the previous cases, noting by Proposition 4.6 that all of the above generators can be exactly represented by circuits over {X, CX, CCX, ωH, S}.
If V is a matrix over D[i], then V can be written as V = W/2 q where q ∈ N and W is a matrix over Z [i]. For our purposes, however, it is more convenient to express these matrices as where q ∈ N and W is a matrix over Z [i]. This is equivalent since We therefore use matrices of the form (11) and use (1 + i)-denominator exponents.

Lemma 5.24. If v is an n-dimensional unit vector over D[i] and lde
and q > 1. Since (1 + i) † (1 + i) = 2 and v is a unit vector, we have 2 q = u † j u j . Thus 0 ≡ u † j u j ≡ u 2 j (mod 2) and it follows that u 2 j ≡ 1 (mod 2) for evenly many j. We can therefore group these entries in sets of size 2 and apply Lemma 5.23 to each such set in order to reduce the denominator exponent.  Proof. We proceed as in the proof of Corollary 5.22. In particular, the least (1+i)-denominator exponent can be reduced in Lemma 5.24 by substituting ωHi m1 [1] i m2 [2] with ancilla-free two-level generators as follows: ωH → (ωSH), ωHi [2] → (ωHS), and ωHi [1] i [2] → (ωSH)(iZ).
Moreover, each parenthesized two-level operator on the right hand side has determinant 1 and can be exactly represented over {X, CX, CCX, ωH, S} without ancillas when n ≥ 4 as shown in Appendix A.
2. An analogue of Lemma 5.25 where G 1 · · · G v = i m e j holds by using the two-level iX operator, which similarly has determinant 1 and is representable without ancillas as shown in Appendix A.2. Again, there exist generators G 1 , . . . , G from the set iZ [a,b] , iX [a,b] , ωSH [a,b] , ωHS [a,b] such that where D is a diagonal unitary with entries i m . We can then use the n-qubit two-level iZ operator to remove the phases as follows. Suppose the jth diagonal entry is i mj and let N = 2 n . It can then be observed that (iZ [1,2] ) −m1 (iZ [2,3] Since det D = det V = 1, the proof is complete.

Super-Gaussian Clifford+T operators
As in the integral case, the characterization of Gaussian Clifford+T circuits as unitaries over D[i] requires the unusual ωH gate as a generator. Replacing ωH with H yields a slightly larger set of unitaries with matrices of the form where q ∈ N and W is a matrix over Z

Conclusion
In this paper, we provided number-theoretic characterizations for several classes of restricted but universal Clifford+T circuits, focusing on integral, real, imaginary, and Gaussian circuits. We showed that a unitary matrix can be exactly represented by an n-qubit integral Clifford+T circuit if and only if it is an element of the group U 2 n (D). We then established that real, imaginary, and Gaussian circuits similarly correspond to the groups U 2 n (D √ 2 ), U 2 n (D i √ 2 ), and U 2 n (D[i]), respectively. An avenue for future research is to improve the performance, in runtime or gate count, of the algorithms introduced in the present paper. Further afield, it would be interesting to study restricted Clifford+T circuits in the context of fault-tolerance, randomized benchmarking, or simulation. While these and many other questions remain open, we hope that our characterizations will help deepen our understanding of Clifford+T circuits, restricted or not. Proof. Recall that the controlled-F gate is representable with a single dirty ancilla. The two-level XZ gate is then constructible without ancillas using the following circuit. Proof. In the n = 1 and n = 2 cases, this is trivially true, as the controlled F and controlled Z are both implementable without ancillas. For n ≥ 3, note that XZ = −ZX, and so (ZXF )X(ZXF )X = X(ZXF ) = −ZF . Hence, we have the equality below. where no ancillas are needed.

A.2 The D[i] case
In this appendix we give ancilla-free constructions of the two-level operators iX, iZ, ωSH, and ωHS over {X, CX, CCX, ωH, S}. We progressively build up to the necessary operators.
Lemma A.5. For any n, the n-qubit two-level X and Z gates can be represented over the gate set {X, CX, CCX, ωH, S} with a single dirty ancilla.
Proof. Recall that the two-level X gate is representable over {X, CX, CCX} with a single dirty ancilla [9]. The two-level Z gate can then be constructed as follows. Proof. Using the n-qubit iX operator as follows. Proof. The n = 1 case is trivially true. For n = 2, if we do not use ancillas, we are left with the Clifford group generators and are unable to implement non-Clifford operators. However, appending CS to our list of operators gives us the following circuits.
Note moreover that the 2-qubit circuits can also be represented over {X, CX, CCX, ωH, S} with a single dirty ancilla, which we use in the identities for n ≥ 3 below.