On Groups in the Qubit Clifford Hierarchy

Here we study the unitary groups that can be constructed using elements from the qubit Clifford Hierarchy. We first provide a necessary and sufficient canonical form that semi-Clifford and generalized semi-Clifford elements must satisfy to be in the Clifford Hierarchy. Then we classify the groups that can be formed from such elements. Up to Clifford conjugation, we classify all such groups that can be constructed using generalized semi-Clifford elements in the Clifford Hierarchy. We discuss a possible minor exception to this classification in the appendix. This may not be a full classification of all groups in the qubit Clifford Hierarchy as it is not currently known if all elements in the Clifford Hierarchy must be generalized semi-Clifford. In addition to the diagonal gate groups found by Cui et al., we show that many non-isomorphic (to the diagonal gate groups) generalized symmetric groups are also contained in the Clifford Hierarchy. Finally, as an application of this classification, we examine restrictions on transversal gates given by the structure of the groups enumerated herein which may be of independent interest.

1 Prologue: The Clifford Hierarchy The Pauli and Clifford groups are ubiquitous in quantum information processing.The Clifford Hierarchy, while less widely known, builds upon these groups (though it is not a group) and is frequently encountered in its own right.It typically rears its head in tasks centered on processing of stabilizers states (or groups) when processes involving Clifford operations are assumed to be free (or at least easy) to implement.The difficulty of the task typically increases with level in the Hierarchy.
The Clifford Hierarchy (CH) was originally defined [1] as the set of gates that could be realized via gate teleportation with Pauli gate corrections though it has grown to encompass many areas of research.
A (likely incomplete) list of myriad places where the Clifford Hierarchy is featured follows: In magic state distillation schemes [2,3,4], the state distilled is typically used as a resource state to apply a gate from the lower levels of the Clifford Hierarchy.Resource theories classifying the difficulty of preparing magic states find that higher levels in CH tend to correspond to more 'valuable' resources [5].Transversal gates (and even low-depth circuits) on stabilizer codes have been shown [6] to only implement logical operators from finite levels in the CH.Also, the local physical gates which can be applied to implement a transversal gate on a qubit stabilizer code have been shown [7,8] in some cases to be in CH.With few exceptions, local symmetries of stabilizer states and graph states are in the Clifford Hierarchy [8].Many normal forms use unitary gate sets consisting of the Clifford group and some element(s) in the lower levels of the Clifford Hierarchy.These normal forms, in turn, provide the mathematical underpinning for exact (and approximate) gate compiling algorithms.Recently [9], the CH was used in the classification of Boolean functions which can be computed using non-adaptive measurement-based quantum computation.There, the local operations available to act on the cluster state were contained in a finite level of the Clifford hierarchy.
With all these applications, it is no surprise that the Clifford Hierarchy has been studied abstractly in its own right.We briefly review some of the results here.
The n-qubit Clifford Hierarchy [1,10] is recursively defined as with the first level (k = 1) defined as CH 1 ≡ P n , the n-qubit Pauli group.CH 2 is the n-qubit Clifford group.Throughout this paper we will refer to elements of the n-qubit Pauli group as Pauli strings and to elements consisting of tensor products of X (Z) and Identity as Pauli X (Z) strings.We will often refer to the unitary matrices defined up to a global U (1) phase as gates.We will say that a gate U which satisfies Eqn.1.1 is in the Clifford Hierarchy at the kth level.We will also say that a gate is in the Clifford Hierarchy (written CH) if it is in CH k at any level k.It is known that the Clifford Hierarchy is a finite set for any k.For k = 1 we have the Pauli group, for k = 2 the Clifford group, and for k ≥ 3 the elements no longer form a group.Note the following relation holds: CH 1 ⊂ CH 2 ⊂ ...CH k since each level contains all elements in the lower levels and contains distinct elements not present in the lower levels [10].
We will briefly consider how the elements in the set CH k for k ≥ 3 fail to be a group.Associativity is clear since all elements are faithfully represented by unitary operators.The identity operator is in CH 1 and, therefore, all higher levels have identity.The product of elements in CH k≥3 , however, is not typically in the same level or even in CH at any level!For example, HT ∈ CH 3 , but (HT ) 2 / ∈ CH.We will discuss some properties of inverses for the cases of semi-Clifford and generalized semi-Clifford later.
As mentioned, the Pauli and Clifford groups are in CH.In Cui et al. [11] all the diagonal gates in the qubit (and qudit) Clifford Hierarchy were classified.These gates were also shown to form groups at each level in CH.
Work to elucidate the structure of elements in CH was undertaken in [10,12,13].We will briefly introduce semi-Clifford and generalized semi-Clifford gates to better explain the structure of CH that has been discovered so far.Definition 1.1 (Semi-Clifford Gate).A gate in U (2 n ) is semi-Clifford iff it can be written as C 1 j exp (iθ j Z j ) C 2 where C 1 , C 2 are n-qubit Clifford gates, θ ∈ [0, 2π), and Z j are non-identity Z Pauli strings.Definition 1.2 (Generalized Semi-Clifford Gate).A gate in U (2 n ) is generalized semi-Clifford iff it can be expressed as where C 1 , C 2 are n-qubit Clifford gates, θ ∈ [0, 2π), Z j are Z Pauli strings, and P is a permutation matrix in U (2 n ).
The following table summarizes what is currently known about the structure of the qubit Clifford Hierarchy: Much has been accomplished in these studies, but a major conjecture remains open.
¬SC(GSC?) ¬SC(GSC?) n = 4 P C GSC ¬SC(GSC?) ¬SC(GSC?) n ≥ 5 P C GSC ¬SC(GSC?) ¬SC(GSC?) Table 1: Here k indicates the level in the Clifford Hierarchy, n the number of qubits, P indicates the Pauli group, C indicates the Clifford group, SC indicates that the elements are semi-Clifford, GSC indicates that the elements are generalized semi-Clifford, and ¬SC(GSC?) indicates that gates are known to exist which are not semi-Clifford (though they are generalized semi-Clifford), but it has not been proven that all such elements must be generalized semi-Clifford.The results presented in this table were proven in [10,12].
Figure 1: Groups in the Clifford Hierarchy.The blue circle indicates the group CH 1 (the Pauli group), the red circle indicates the group CH 2 (the Clifford group), the diagonal gate groups for each level, k, in CH (classified in [11]) are indicated by D k , and the groups introduced in this paper, C Π ⋉ D k (a generalized symmetric group), are indicated by GSG k .The set of all gates in the Clifford Hierarchy at level k, CH k≥3 , does not form a group.At every level D k ⊂ GSG k .Note that GSG 1 is the Pauli group and, therefore the full Pauli group is a subgroup of GSG k .
We should also note that the structure of the qudit Clifford Hierarchy has recently been studied [14].There, some evidence for similar structure as in the qubit Hierarchy was presented but less has been proven.

Fixing Notation
Let P 1 = ⟨i, X, Z⟩ be the single-qubit Pauli group.The n-qubit Pauli group is then given by P n = P ⊗n 1 .We refer to elements of the n-qubit Pauli group as Pauli strings and to elements in the subgroup of P n consisting of tensor products of Xs (Zs) and Identity matrices as Pauli X (Z) strings.
The normalizer of the Pauli group, P n , over SU (2 n ) is the n-qubit Clifford group.Any element, C, in the n-qubit Clifford group maps Pauli strings p ∈ P n to p ′ ∈ P n under conjugation i.e.CpC † = p ′ .We say that a gate, g, (or group of gates, G) is 'Clifford isomorphic' to another gate g ′ (a group of gates, G ′ ) if CgC † = g ′ (CGC † = G ′ ) for some Clifford gate C. Similarly we refer to the map, C(•)C † , as a Clifford isomorphism.A stabilizer group, S, is an abelian subgroup of P n with −I / ∈ S.This group is generated by l ≤ n independent generators (Pauli strings).The number of elements in a stabilizer group is 2 l , and we will refer to the rank of a stabilizer group as l in this case.When l = n, we say that the stabilizer group is full rank.
The diagonal gates in the Clifford Hierarchy, D, were fully classified in Cui et al. [11].At any finite level k in CH, they form a finite abelian group denoted D k .This group is generated by π 2 k rotations about all Pauli Z axes.That is, rotations defined by where Z j is any non-identity Pauli Z string.This group is also generated by well-known gates.For n ≥ k qubits, the following gates generate D k [10]: Here, Λ k (U ) denotes the k-controlled U gate, a gate with support on k + 1 qubits; the index i runs over all qubits; i 1 , i 2 is over all pairs of qubits, etc.Note that the order of indices does not matter here since the gates are symmetric.For n < k a similar set of generating gates can be written, but the set of generators must be truncated at m = n − 1 controls since an (m − 1)-controlled gate for m > n − 1 is not supported on n qubits.The group of 2 n × 2 n diagonal unitary matrices with 2 l root of unity entries denoted Diag n l is also useful in this work.We are actually interested in the group Diag n l /U (1) since a global phase is unphysical.We 'fix' this gauge by requiring the top-left entry of all matrices in the group to be 1.In a slight abuse of notation, we will denote this group by Diag n l and only use the latter in the sequel.Diag n l is generated by For large enough k and l any diagonal gate in CH is an element of D k and Diag l , respectively (See Appendix F for more details).
In this work, rotations about Pauli axes play a key role and spend some time introducing our notation below.A rotation about the Pauli axis σ by an angle θ is given by We denote conjugation by U as where σ ′ is some Pauli rotation axis.
In this work, we will often encounter products of commuting Pauli rotations (each of which are in the Clifford Hierarchy).We denote a product of such rotations as where α j ∈ {0, ±1, ..., ±2 k j } and all σ j commute (by definition).Since R σ (θ) = R −σ (−θ) we can always choose the σ j such that they are in some stabilizer group S.
We say a Clifford gate, C, preserves a stabilizer group, S, (and the underlying states) if Here, S ′ i also denotes an element of S, and ±θ indicates that C may change the sign of θ and still preserve the stabilizer group.
For example, the stabilizer group of all Pauli Z strings, S Z , is preserved by any Clifford gate generated by C Π = ⟨CN OT, X⟩ (we refer to these gates as Clifford permutations) and also by any diagonal Clifford gate C D = ⟨CZ, S⟩.The group of all Clifford gates which preserve S Z is then given by G S Z ≜ C Π ⋉ C D where ⋉ indicates a semi-direct product of groups.Elements in C D commute with all Pauli Z strings (and therefore leave them invariant) and elements in C Π can permute Pauli Z strings with other Pauli Z strings in the stabilizer group.These are the only Clifford elements which (via conjugation) preserve the full-rank stabilizer group S Z .
For other full-rank stabilizer groups (stabilizer groups of maximum size (|S| = 2 n ) on n qubits), S, we have that CS Z C † = S.A Clifford circuit, C, always exists which maps all elements of S Z to another full-rank stabilizer group S (see Lemma 4.2) and the group of Clifford gates which preserve S is given by and S j , S ′ j ∈ S for all j.We can see that all R S j , R S ′ j must commute.In addition, we also look at how (classical) permutations act on Pauli-Z rotations R σ Z (θ).In what follows, Π n denotes the group of permutations on 2 n computational basis states defined on 2 n × 2 n permutation matrices.Note these matrices (gates) are universal for reversible classical computation.A generating set for Π n on n qubits is given by ⟨C n−1 (X), SW AP i,j , X i ⟩ where C n−1 (X) is the (n − 1)-controlled NOT gate, SW AP i,j is the SW AP gate between any two qubits i and j (though nearest-neighbor SW AP s would suffice), and X i is Pauli X on any qubit i (though a single X 1 would suffice).For Z rotations in CH, elements P ∈ Π have the following effect: That is, permutations, under conjugation, take diagonal rotations in CH to products of diagonal rotations in CH.Note that these products are also diagonal matrices.On a fixed number of qubits, n, a permutation can only take a diagonal gate at level k in CH to a product of diagonal gates at level, at most, k + n (see Appendix F).Also, the number of terms j in the product is bounded simply because there are only 2 n − 1 (non-trivial) commuting Pauli Z strings.We note that this mapping is constrained in additional ways such as preserving the spectrum of R S Z , but we do not use these properties here.For clarity, in what follows we denote the classical permutations mentioned above as Π S Z to distinguish them from other groups of permutations.Under conjugation by Clifford gates, elements of CΠ S Z C † = Π S will act as 'permutations' on a new state basis and act on Pauli rotations in S = CS Z C † as P R S απ where P ∈ Π S .Finally, we can take elements from the group of Clifford gates which preserve S, C S , and elements from the group of permutation gates which preserve S, Π S , and examine their combined effect when applied to R S i : where C ∈ C S and P ∈ Π S .
As above, S i , S j ∈ S for all i, j and this implies that all R S i , R S j must also commute.
A brief warning: when defining rotations in this section and others, we use the convention that R σ (θ) ≜ e iσθ ; however when writing circuit diagrams, we use the standard convention which differs from the rotations above by a global phase.For example, on a single qubit R Z π 8 = e −iπ/8 T .Thus far, this seems like only a global phase, but we will sometimes add controls to these gates which can result in a gate not equal up to a global phase.We have made an effort to stick to the same convention in each section.
3 Canonical Forms for semi-Clifford and Generalized semi-Clifford gates in CH In this section, we introduce canonical forms for both semi-Clifford and generalized semi-Clifford gates in CH.A gate is (generalized) semi-Clifford and in CH iff it can be written in this form.
A gate in U (2 n ) is semi-Clifford iff it can be written as C 1 j exp (iθ j Z j ) C 2 where C 1 , C 2 are n-qubit Clifford gates, θ ∈ [0, 2π), and Z j are non-identity Z Pauli strings.A semi-Clifford gate is sometimes said to be 'diagonalizable' by left and/or right multiplication with Clifford gates.
To be in CH, a semi-Clifford gate, U , must have the following form: where α j are integers and k j are positive integers.We discuss additional assumptions about the form of U at the end of this section.Equ.3.1 is necessary and sufficient since a semi-Clifford gate in the Clifford Hierarchy must be 'diagonalizable' by Clifford multiplication, and the resulting diagonal gate must be in the Clifford Hierarchy.All diagonal gates in the Clifford Hierarchy were classified by Cui et al. [11], and we use their classification for qubit diagonal gates here1 .We will often use an equivalent expression for Equ.3.1: where S j indicates a non-identity stabilizer element in a stabilizer group S and C is a Clifford gate.We refer to these elements as stabilizers since they are Pauli strings and must all commute.They are Pauli because Clifford gates map Pauli strings to Pauli strings and must commute since any isomorphism (here C † 2 ( )C 2 ) must preserve commutation relations of elements.Note the S j terms do not need to include all elements in a stabilizer group, S; however a stabilizer group must exist which contains all S j .Here, α ′ j = ±α j and we can always choose α ′ j such that the stabilizer elements have the correct ±1 phase to be in the stabilizer group 2 .
A gate, U ∈ U (2 n ) is generalized semi-Clifford iff it can be expressed as where C 1 , C 2 are n-qubit Clifford gates, Z j are Z Pauli strings, and P is a permutation matrix in U (2 n ).A generalized semi-Clifford gate is said to be 'diagonalizable' by Clifford gates and a permutation.Note that all semi-Clifford gates are generalized semi-Clifford gates; simply set the permutation to Identity.To be in CH, it is necessary and sufficient for a generalized semi-Clifford gate, U , to have the following form: where D = j exp i α j π 2 k j Z j is a diagonal gate in CH (defined exactly the same as in the semi-Clifford case above) and P indicates a permutation in CH.
Proof of the canonical form for generalized semi-Clifford gates is somewhat lengthy and it is deferred to Appendix A.
There are no other restrictions on U and a generalized semi-Clifford gate is in CH iff it can be written in this form.
We will often use the equivalent expression: where Σ = j exp i ±α j π 2 k j S j with all S j belonging to some stabilizer group S, P permutes basis states stabilized by S as P permuted basis states in the computation basis, and C = C 1 C 2 is a Clifford gate.Note that U as well as C, P , and S are all in CH.

Additional assumptions about the canonical form of U
Throughout the paper, unless otherwise noted, we make the following assumptions in regard to (generalized) semi-Clifford gates in the Clifford Hierarchy.We will assume that rotation angles such as α j /2 k j are given as irreducible fractions and that any Clifford gate (multiples of π/4 rotations about a Pauli axis) in the diagonal part of U ( j exp i α j π 2 k j Z j ) has been moved to the Clifford part of U (labelled by C 1 , C 2 , or C in the equations above) unless otherwise noted.We will also assume that all non-Clifford rotations about the same Pauli axis are combined into a single rotation.After combining terms, the index j in Equ.3.1 (or the number of commuting non-Clifford rotations in S in Equ.3.5) can then go over at most 2 n − 1 terms (each corresponding to a commuting nontrivial Pauli string).Finally, we assume that no product of commuting non-Clifford rotations is proportional to the identity.If this occurs, the product of rotations can simply be replaced with the identity (possibly times a phase) resulting in an equivalent gate.These assumptions can all be made without loss of generality.
In the next two sections we will look at the groups that can be formed with semi-Clifford and generalized semi-Clifford gates, respectively.

Groups of semi-Clifford gates in CH
While it is well known that gates exist in CH which are not semi-Clifford, all gates on n ≤ 2 qubits, as well as many other common gates, are semi-Clifford and they warrant some study before moving on to the more general case.Moreover, the structure of these groups is simple to state and comes with fewer caveats than the general case.
In what follows, we will classify the semi-Clifford matrix groups in CH.We make use of many ideas of Englbrecht and Kraus [8] in this section and the next.
First, let U be a semi-Clifford gate in CH.Hereafter, we will simply refer to these gates as semi-Clifford, keeping in mind that they are in CH.U can, therefore, be written in canonical form (see Eqn. 3.2).We will examine the additional requirements (beyond Eqn.3.2) for gates to be generators of a group G of semi-Clifford operators in CH.As we will show, all elements of G will be subject to these constraints.
Writing U in canonical form we have where C is an n-qubit Clifford gate and the terms in the product are commuting non-Clifford gates.If U ∈ G, then U 2 must also be in G and we have where the RHS is a semi-Clifford gate written in canonical form.This is required since (by our definition of G) all elements in G must be semi-Clifford and all semi-Clifford gates can be written in this form.But, U 2 can also be written as which must also be semi-Clifford.And this requires that Since all α j , α ′ j ̸ = 0 and k j ≥ 3, we can only satisfy this equation when all S j and S ′ j commute.And by examining how C acts under conjugation on the non-Clifford gates, we see that all S j and S ′ j commute iff C † S j C ∈ S for some stabilizer group S which contains all S j and S ′ j .In other words, we require that a stabilizer group exists which contains all S j and S ′ j and this is the case when C is in the normalizer of S. The normalizer of S in the Clifford group C is We will revisit these constraints on C, but first we will show that all elements (not just powers of U ) in G must have commuting non-Clifford gates.
Let U, V be semi-Clifford gates (in CH).They can, therefore, be written in canonical form (see Eqn. 3.2).
Given semi-Clifford gates U and V in canonical form we have To form a group of semi-Clifford gates we must have that U V ∈ G.We can express this requirement as where C 3 j 3 exp i S j 3 is some semi-Clifford gate written in canonical form.But, Matching terms, we again see that all non-Clifford rotations about S ′ j 1 must commute with all non-Clifford rotations about S j 2 .This is equivalent to requiring that all S ′ j 1 and S j 2 be part of some stabilizer group S. Also, since U 2 must also be in G, we see that S j 1 and S ′ j 1 must commute and, therefore, have Pauli rotations in the same stabilizer group S. Similar arguments follow for other products of elements, and we see that all non-Clifford rotations in all elements of G must commute and therefore, be part of some stabilizer group S.
As mentioned earlier, to preserve the stabilizer group S, the Clifford part of each term (C in the equations above) must be in the normalizer of S. To see why this is necessary, assume that the (potential) generators of a semi-Clifford group G have nondiagonal rotations whose Pauli axes generate a full-rank stabilizer group S.Then, assume there exists a generator which in canonical form contains a Clifford gate, C, which is not in the normalizer of S. Therefore, C must take some non-Clifford rotation by conjugation to a non-Clifford rotation about a Pauli axis not in S and the product of the generators will not be semi-Clifford.We have arrived at a contradiction and must conclude that all C are in the normalizer of S. Requiring the Clifford part, C, of each term to be in the normalizer of S means that C can only do the following: (1) commute with all elements in S or (2) permute elements of S (while commuting with the rest).Note that we ignore the ±1 that Clifford gates can apply since it can be absorbed into the rotation angle α.
For each element (expressible as a product of generators) in G, we now have shown that each element's commuting non-Clifford rotations must commute with the non-Clifford rotations of all other elements.We proved that this was equivalent to requiring that each Pauli rotation axis for all non-Clifford gates belongs to a common stabilizer group, S.
Finally, we showed that the Clifford part of each element must be in the normalizer of that group.
In [11], all the qubit diagonal gates contained in CH k were shown to form groups at each level, k.We denote these groups as D n k .Since all the non-Clifford rotations in G commute and are rotations about Pauli axes, we can conjugate each element in G by the same n-qubit Clifford gate to diagonalize the non-Clifford rotations.Since these gates are now diagonal and in CH, we can find a group (or subgroup of) D n k (for large enough k) such that all conjugated non-Clifford gates are elements of this group.We then refer to the non-Clifford gates in G as 'Clifford isomorphic' to a subset of D n k .This is generally a subset since the group, as we shall soon see, is formed by Clifford permutations and diagonal gates which do not require that the diagonal gates form a group on their own.Under conjugation, the Clifford gates will now normalize a diagonal (Pauli Z string elements) stabilizer group, but it will also normalize (under conjugation) the group D n k .We sum up this discussion in the theorem below.Theorem 4.1.A set of semi-Clifford gates in CH generates a group of semi-Clifford gates in CH iff each element, l, in the set, written in canonical form as C l j l exp i S j l , has all S j l in a common stabilizer group, S, and has all C l in the normalizer of S in the n-qubit Clifford group.This is a restatement of the constraints derived in this section.The normalizer of the group of diagonal gates in U (2 n ) is the group of unitary generalized permutation matrices.These matrices have one non-zero entry (which must be some e iθ since the matrix is unitary) in each row and column.The normalizer of the diagonal gates in the n-qubit Clifford group is the group of diagonal Clifford gates C D and its normalizer in the Clifford group, the Clifford permutations, C Π .We can express this group as the semi-direct product C Π ⋉ C D .Elements of this group are Clifford gates which map diagonal gates to diagonal gates under conjugation.We say the non-Clifford rotations ( j l exp i α j l π 2 k j l S j l ) in the elements of G have full support on n qubits when the only allowable Clifford gates for any element of G are from a group Clifford-isomorphic to C Π ⋉ C D .In this case we also refer to the Clifford gates as restricted.Note that this Clifford group (C Π ⋉ C D ) is in the normalizer of any diagonal matrix group.Sometimes, however, additional Clifford gates are in the normalizer and we discuss how this can occur below.
If the non-Clifford gates in all elements in G have no support on some qubit(s) then any Clifford gate can be applied to these qubits in the Clifford portion of any element in G.These unconstrained Clifford gates are not always so apparent, and generally a subsystem (of size equal to some number of qubits) can be left unconstrained by the non-Clifford rotations.Additionally, the product of non-Clifford rotations in each element of G is not unique and other products of Pauli rotations in the same stabilizer group can equal the same product.This can further obfuscate the unconstrained subsystem.Checking if any unconstrained subsystems exist is very similar to checking for the existence of a noiseless subsystem [15,16,17].To see this, treat each non-Clifford rotation in each element of G as a Kraus operator in an error channel and then check for the existence of a noiseless subsystem.If an unconstrained subsystem exists, then by Clifford conjugation of each element in G (and possibly expressing some products of Pauli-axis rotations by equivalent products of Pauli-axis rotations), we can write each non-Clifford rotation such that it has no support (acts trivially) on some number of qubits.Now, we can use the following lemma to simultaneously diagonalize the non-Clifford rotations in each element of G.

Lemma 4.2 (Encoding circuit Lemma).
For every stabilizer group on n qubits, there exists an n-qubit Clifford circuit which by conjugation takes all elements of S to Pauli Z strings (a diagonal stabilizer group).Furthermore, if the stabilizer group is on n qubits, but has 2 m elements for some m < n, then a Clifford circuit exists which by conjugation takes the elements of S to Pauli Z strings on m qubits and to Identity on the remaining n − m qubits.
A Clifford circuit that performs the desired operation is very similar to an encoding circuit for a qubit stabilizer code (or state).In fact, a Clifford circuit exists which (by conjugation) takes any m generators of a n-qubit stabilizer group, S, to any other n-qubit stabilizer group, S ′ , generated by m generators.A Clifford circuit which performs this operation is clearly sufficient to prove our lemma.References to encoding circuits are found in [18] and [19].This can also be seen as a consequence of Witt's Theorem as noted in [20].Additionally, efficient (in number of qubits n) algorithms for constructing such circuits can be found in [19].We will refer to the qubits after conjugation by this Clifford circuit as non-Clifford qubits if non-Clifford rotations have non-trivial support on them and to Clifford qubits otherwise.
Note this Clifford circuit is not unique since we haven't specified how the pure errors (anti-stabilizers) are mapped; however, we do not need uniqueness in any of our constructions, and existence of such a circuit suffices.
Under conjugation by the Clifford circuit mentioned above, the Clifford part, C, of each element in G will map to (1) a diagonal Clifford, (2) to a Clifford permutation, or, if it is unconstrained by the non-Clifford rotations, (3) to some Clifford gate.( 1) or ( 2) are required for any part of C with support on the non-Clifford qubits.Note, that C can map to some combination of ( 1), (2), and (3) provided it only maps to a combination of (1) and ( 2) on the non-Clifford qubits.
In some cases Clifford permutations (CNOT gates) can have support on both the Clifford and non-Clifford qubits.This complicates the structure theorem below.We will assume, for now, that conjugation by the Clifford circuit above does not map a Clifford gate to a Clifford permutation with support on both Clifford and non-Clifford qubits.This is discussed further in Appendix E. Now, we can state our first structure theorem.
Theorem 4.3.Every group, G, of semi-Clifford gates on n qubits in CH must be Cliffordisomorphic to a subgroup of3  Examples of semi-Clifford groups are provided in Appendix B.
We conclude this section by giving a recipe that can be used to construct any semi-Clifford group in CH.We will construct groups which have non-Clifford diagonal rotations and note that all other groups are Clifford isomorphic to these.
1. Fix the number of qubits, 0 ≤ m ≤ n, which can support the full Clifford group.We will call these the Clifford qubits and refer to the other qubits as non-Clifford qubits.
2. Choose a set of generating elements and c m i is a Clifford gate on the m Clifford qubits.
3. If desired add any number of CNOTs with control on the non-Clifford qubits and target on the Clifford qubits to the existing generators or as new generators.See Appendix E for more details.

Groups of Generalized semi-Clifford gates in CH
A generalized semi-Clifford gate is any unitary 'diagonalizable' by left/right Clifford multiplication and a (classical) permutation.In this section we will proceed similarly to the last section except that now each element in G is generalized semi-Clifford.We will derive constraints on Clifford and permutations gates set by the the non-Clifford rotations.Note conjugation by a non-Clifford permutation does not generally preserve the level of a diagonal gate in CH.In fact, the full group of diagonal gates in CH k , denoted D m k , is only preserved under conjugation by Clifford permutations.There are, however, groups of diagonal gates in CH which have the entire group of permutations (represented by 2 m × 2 m permutation matrices) in their normalizer.These groups have elements represented by 2 m × 2 m diagonal matrices which generate all diagonal matrices with 2 l root of unity entries.Since conjugation by a permutation cannot change the eigenvalues of a diagonal matrix and all diagonal matrices which are permutations of these eigenvalues are in this group, we see that the entire permutation group is in the normalizer of this group.It is easy to show that these diagonal matrices are in CH (see Appendix F) and we denote them by Diag m l .Let U, V be generalized semi-Clifford gates (in CH).They can, therefore, be written in canonical form (see Eqn. 3.5).
With U and V in canonical form we have where P 1 is a permutation on basis states stabilized by a stabilizer group S 1 and P 2 is a permutation on basis states stabilized by a stabilier group S 2 .
Recall that P 1 is Clifford isomorphic to a (generally non-Clifford) permutation and it acts on some stabilizer basis S 1 (under conjugation) as a classical permutation acts on Pauli Z strings.That is, it can take a single Pauli rotation exp i S j 1 to a product of Pauli rotations.All Pauli rotations in this product, however, are required to be in S 1 .All terms in the product of non-Clifford rotations in U and V are required to be in S 1 and S 2 , respectively, since they are written in canonical form.Note that S 1 or S 2 might not be fully 'pinned down' by the permutation; this is just shorthand for any stabilizer group that the permutation preserves.
To form a group of generalized semi-Clifford gates we must have that all products of U and V are in G.We can express this requirement on U V as where S j 3 is some generalized semi-Clifford gate written in canonical form.
We first look at the constraints on C 2 in the product U V : For this term to be generalized semi-Clifford, we must have that C 2 P 2 is in the normalizer of S 1 .This requires that C 2 must be constrained as in the semi-Clifford case.There must also exist some stabilizer group S which contains all S j 2 and all terms S ′ j 1 = P −1 2 C † 2 S j 1 C 2 P 2 .Note that a permutation, P , by conjugation can generally take a unitary rotation to a product of unitary rotations (or vice versa).This means that the number of stabilizer elements in S ′ j 1 needs not be the same as S j 1 .A more complicated constraint arises on P The permutation part of each generator is required (by being written in canonical form) to be a permutation-like gate in CH; however, the set of all permutations in CH is not a group under matrix multiplication.We must therefore require that all products of permutations P 2 P ′ 1 are also permutations in CH.To reiterate, we require that all S j in all elements in G are in some (shared) stabilizer group S, that all permutations P act on the same stabilizer group S (that is are in the normalizer of S), and that all permutations also form a group with all elements in CH.The groups of permutations that have this property, to our knowledge, have not been studied in the literature and membership in CH must be checked for the permutation part of each element in a generalized semi-Clifford group.Note that this is in contrast to the semi-Clifford case where we could enforce the restrictions on the generators and all elements of the group were guaranteed to be semi-Clifford and in CH.We mention a few results in Appendices B & H to assist interested parties in constructing these groups.

Definition 5.1 (Maximal Permutation groups in CH)
. A permutation group on n qubits, Πn , is maximal in CH if all elements P ∈ Πn are also in CH and the addition of any permutation P ′ ∈ Π n and P ′ / ∈ Πn results in a group which is no longer contained in CH.We refer to these groups as maximal permutation groups for short.
Again, we can use the Encoding Circuit Lemma to map (via Clifford conjugation) the commuting non-Clifford, Pauli rotations in our group to commuting Pauli Z (diagonal) rotations.The permutations under this same mapping will become regular (classical) permutation matrices.This new group is Clifford isomorphic to the generalized semi-Clifford groups discussed.Now, we state our group structure theorem for generalized semi-Clifford gates.
Theorem 5.2.Every group, G, of generalized semi-Clifford gates on n qubits in CH must be Clifford-isomorphic to a subgroup of 5Πn Here we have combined the diagonal Clifford gates into D l and denoted any group of permutations in CH on n qubits by Πn and the Clifford group on l qubits as C l .While the structure of these groups is written similarly to the semi-Clifford group case, there are many distinct groups, Πn , which are not subgroups of some larger group of permutations in CH.In other words, each Πn denotes many distinct groups; one for each maximal permutation group on n qubits.
Examples of generalized semi-Clifford groups are provided in Appendix B. We conclude this section by giving a recipe that can be used to construct most generalized semi-Clifford groups in CH.We will construct groups which have non-Clifford diagonal rotations, and note that all other groups are Clifford-isomorphic to these.
1. Fix the number of qubits, 0 ≤ m ≤ n, which can support the full Clifford group.We will call these the Clifford qubits and refer to the other qubits as non-Clifford qubits.and c m i is a Clifford gate on the remaining m Clifford qubits.It is necessary though not sufficient to require that the generators have permutation matrices in CH.In this case we must also require that all elements (products of generators) have permutations in CH.
3. Additional Λ n (X) gates (n-controlled NOT gates) with control(s) on the non-Clifford qubits and target on the Clifford qubits can be added to the existing generators or as new generators, provided that when combined with the existing permutations they only generate permutations in CH.See Appendix E for more details.
This recipe can be used to construct 'most' generalized semi-Clifford groups since the Clifford group on the Clifford qubits could be further restricted, allowing for a (potentially) larger set of permutations between (restricted) Clifford and non-Clifford qubits.

Applications: Transversal Gate Classification
We use a result of O'Conner, Kubica, & Yoder [6] as a starting pointing in our examination of possible transversal gates in a qubit QECC.There they show that all transversal gates implementable on a stabilizer code must be in CH at some finite level.They actually prove a stronger result which allows for low-depth circuits and includes permutations on qubits (relabeling of qubits).Here, we use their result that all such gates must be in CH and look at the additional constraints that arise from the requirement that all such gates (for a given code) must form a group.
Without assuming the generalized semi-Clifford Conjecture, we can place restrictions on the permutation gates implementable as transversal gates.In Appendix C we classify (up to Clifford multiplication) all non-Clifford permutation gates on 3 qubits and show they are all equivalent to a single Toffoli gate or the Identity.Furthermore, any group of permutations implemented via transversal gates can only have one such Toffoli gate.In other words, for any subset of three logical qubits in an [[n, k, d]] stabilizer code, at most a single distinct Toffoli gate can be implemented transversally.
In Limitations of Transversal Computation through Quantum Homomorphic Encryption, Newman and Shi [23] show that no stabilizer code can implement a classical reversible universal gate set 6 .In that paper, a corollary seems to imply that no such code can implement even a single Toffoli gate transversally.A more careful reading (or simply asking one of the authors) shows [24] that their proof forbids transversal Toffoli gates on any set of three (or more) logical qubits where the target can be applied to any of the logical qubits.They refer to a gate (or set of gates) with this property as a uniform Toffoli gate.
Stabilizer codes exist which have Λ 2 (Z) (CCZ) transversally and, therefore, a code with logical X and Z definitions 'flipped' on one qubit would transversally implement Λ 2 (X) (Toffoli).Note this code would (likely) no longer implement the Λ 2 (Z) gate.This shows that, at least for non-Clifford permutation gates, the restrictions we derive are tight.Additional bounds on permutation gates on four or more qubits can likely be proven using the techniques introduced here, though the number of cases to consider increases quickly.
Note that the 15-qubit Reed-Muller code can implement the group X ⋉ ⟨T ⟩ transversally.Here X is the group {I, X} and ⟨T ⟩ is all products of the T gate.This group is a dihedral group.For a single qubit, the gate X is the only non-trivial permutation gate, and is therefore a maximal permutation group.An interesting question is: do other codes with more than one logical qubit exist which have a transversal gate group with both a maximal permutation group and non-Clifford diagonal gates?Furthermore, if qubit stabilizer codes do not exist which implement such transversal gate groups, what are the additional constraints?
7 Applications: Efficiently Simulatable Gates Note: this section is quite speculative and is included to, hopefully, inspire further research into these topics.
The maximal groups in the Clifford Hierarchy-groups consisting of elements within the Clifford Hierarchy that cannot be made larger by adding additional elements within the Clifford Hierarchy-are interesting objects warranting future study.Specifically, studying their connection with easy-to-simulate gate sets may prove fruitful.One such maximal subgroup, the n-qubit Clifford group, is ubiquitous in quantum information theory and is universal for a complexity class (parity P denoted ⊕P) which is strongly believed to be strictly weaker than the complexity class of polynomial-time circuits, P [25].It also has the powerful property that it is a maximal finite subgroup of SU (2 n ) meaning that the addition of any unitary gate to the Clifford group generates an infinite group.This raises the question: Do the other maximal groups in the Clifford Hierarchy have interesting properties?Specifically, are they easy to simulate?
In addition to the Clifford group the other class of groups we found in the Clifford Hierarchy were the generalized symmetric groups.Recall these groups have elements which are permutations multiplied by a diagonal gate.The XP stabilizer formalism [26] can be used to describe single-qubit X and diagonal gates in CH or even n-qubit Pauli X strings and n-qubit diagonal gates.General n-qubit permutations are efficient the simulate as they are equivalent to the complexity class P since these n-bit permutations are precisely the universal gates of reversible classical computation.Since many permutations are not in CH, the generalized symmetric groups in CH are potentially less powerful than P. Understanding the complexity (or lack thereof) of simulating these groups is an interesting open question.The lack of a full classification of the permutation gates in CH is currently a hindrance to this problem.
Transversal gates can be thought of as the symmetries of the underlying code [27].The Eastin-Knill Theorem [28] already tells us that no encoded transversal gate set can be universal for quantum computation (the complexity class BQP) additionally Newman and Shi [23] show that a universal reversible gate set cannot be transversal; proving that the transversal gates available to any stabilizer code generate a group of gates that is strictly weaker than P could have implications for physical processes thought to be modeled by error correcting codes such as decoding Hawking radiation from black holes [29,30,31].It should be noted, however, that proving this type of separation is likely to be extremely difficult.

Summary and Future Work
We introduced a necessary and sufficient canonical form that semi-Clifford or generalized semi-Clifford elements must satisfy to be in the Clifford Hierarchy.We also identified families of semi-Clifford and later, generalized semi-Clifford gates, which are subgroups of certain generalized symmetric groups.The groups we identified were shown to contain the diagonal gates in the Clifford Hierarchy as a strict subgroup.While we found a complete set of constraints for the generalized semi-Clifford groups, a finer-grained characterization of the permutations in the Clifford Hierarchy would further elucidate their structure.
Currently all known gates in the Clifford Hierarchy are generalized semi-Clifford, and it is conjectured that this holds for all gates in the Clifford Hierarchy.If true, we have classified (up to possible exceptions mentioned earlier) all groups contained in the Clifford Hierarchy.We note that even if this conjecture is proven false, all groups may still be of this form.To see why this could be true, note that many single elements in CH such as HT cannot be members of any group in CH since they generate an infinite group on their own G = ⟨HT ⟩.If elements exist in CH which are not generalized semi-Clifford, they may be forced to have such a structure.
An interesting open problem is to classify groups akin to the generalized symmetric groups found here for qudit stabilizer code.

Acknowledgements
This work stems from a project I started long ago at the Université de Sherbrooke and was inspired by conversations with David Poulin.I dedicate this work to his memory.I'd like to thank Matthew Weippert for a careful reading of an earlier version of this manuscript, Bryan Eastin for providing feedback and for pointing out some subtleties of transversal gates, and Winton Brown for general feedback on the ideas discussed in this manuscript.The errors that remain are entirely my own.

A Proof of the Generalized semi-Clifford Canonical Form
The goal of this section is to prove that a permutation gate, π, and a diagonal gate, d, are in the Clifford Hierarchy iff π and d are each in the Clifford Hierarchy.Bear with us as we introduce notation and prove some useful lemmas; we will, eventually, prove the stated result.
We define the group of n-qubit diagonal gates with 2 l root of unity entries (with l ≥ 1) as Diag n l .This is a finite subgroup of U (2 n ) and The permutation group, Π n , is the group of 2 n × 2 n permutation matrices (later these same matrices will act on n qubits).Π n is in the normalizer of any group Diag n l and the group G n l = ⟨Π n , Diag n l ⟩ is a semi-direct product of Diag n l and Π n which is typically written as We can write p as p = p X p Z (up to a phase) and since p X is a permutation and p Z is a diagonal gate, we have that U, U † , and p are all in G n l .p is in G n 1 which is contained in all G n l for l > 1.Since any G n l is closed under multiplication, we have that U pU † ∈ G n l .
Lemma A.2. Let πd ∈ G n l and πd ∈ CH 1 (the Pauli group).Then, π = p X for some Pauli X string and d = p Z for some Pauli Z string.
Note that every element in the n-qubit Pauli group can be expressed as a combination of a permutation, p X , and a diagonal gate, p Z .The lemma is then a consequence of the semi-direct product.
Since every element in the n-qubit Clifford group cannot be expressed as πd, it is not immediately clear whether πd ∈ CH 2 implies that π is a Clifford permutation and that d is a diagonal Clifford element.This however can be shown, and we do so in the 'bonus lemma' at the end of this section.

Lemma A.3. Let π k be a permutation matrix in CH
for all Pauli strings p, but (up to a ±1 phase) we can write this as for all p X and p Z .Since this must be true even if p X = I or p Z = I, we conclude that The former is a permutation matrix and the latter is a diagonal gate in Diag 1 .
From Zeng et al. [10] we have the following lemma: where C 1 , C 2 are arbitrary Clifford gates.
Lemma A.5.Any d ∈ Diag n l is in the Clifford Hierarchy at some level.This is the case, since it can be expressed as d = j exp i α j π 2 k j Z j where Z j are Pauli Z strings and α j are integers.When terms with the same Pauli strings are combined and the fractions α j 2 k j are reduced, the level of d is the maximum k j .
In contrast, many elements of Π n for n ≥ 3 are not in CH at any level.
Lemma A.6.Conjugation of an element d ∈ Diag n l by an element π ∈ Π n yields a diagonal gate in CH at some (possibly higher) level.πdπ −1 must be in Diag n l since π is in the normalizer of Diag n l .Furthermore, it must be in CH at some level by Lemma A.5. Lemma A.7.
Note that e iθP = I ⊗n cos θ + iP sin θ and verification of the above equation is straightforward.

Lemma A.8. Conjugation of an n-qubit Pauli string, p, by a diagonal gate (on n qubits)
To see this, note that d = j exp i α j π 2 k j Z j with k j ≤ k for all j.Also, note that j exp i 7 where +(−) indicates that p commutes (anticommutes) with Z j .However a commuting term will be cancelled by its corresponding term in d −1 and an anticommuting term will combine with its corresponding term in d −1 picking up a factor of 2. Since all k j are now reduced by at least one, we conclude that We define the sets G n [k] by elements, πd in G n with π ∈ CH k and d is any diagonal matrix in CH.Since all permutations in CH k are also in CH k+1 we have the following nested relation: To prove that π k D ∈ CH, we must show that π k DpD † π † k is in CH for all p.We can write this as: where the product of all gates in the parentheses is a diagonal gate in CH (for all p Z ) by Lemma A.6 and by closure of the group Diag n l (for some, large enough, l).We will denote this product as D ′′ in what follows.By the discussion in the previous paragraph, we know that (for all p X ) which by our inductive hypothesis is in CH, we conclude that any element From the discussion in Thm.A.9 we see that πp Z π −1 is always a diagonal gate in CH for any permutation π and any Pauli Z string, p Z .Then, π ∈ CH iff πp X π † is in CH.To see this, note that by Thm.A.9 if πp X π † ∈ CH, then πp X π † πp Z π † ∈ CH for all p Z and if πp X π † / ∈ CH, then by definition π / ∈ CH.This next proof is similar.We define the sets Gn [k] by elements, πd ∈ Π n ⋉ Diag n with π ∈ CH k and d is any diagonal matrix which is not in CH.Since all permutations in CH k are also in CH k+1 we have the following nested relation:  7).In what follows, p X will denote this specific Pauli X string which we will use to show that πd / ∈ CH.We can write πdp ∈ CH where π 2 is a permutation not necessarily distinct from π 1 .Such a p 1,2  X and π 2 must exist or π 1 would be in CH.And since π 2 / ∈ CH we also have that π 2 p 2,3 X π † 2 = π 3 / ∈ CH.And more generally, π t p t,t+1 X π † t = π t+1 / ∈ CH.These permutations are not necessarily distinct and the progression may 'loop', but we can continue the progression (even if a loop occurs) to arbitrary length t, and each π t will not be in CH.
X is one such Pauli string and therefore where d ′ 1 is given by Lemma A.8 and And by assumption π 2 d 2 ∈ CH k−1 .We can proceed in this manner choosing p t,t+1 X since it must be true for all Pauli strings, p. Whatever level k we started with, we will eventually get to level k = 1 and there we have that π t d t ∈ CH 1 .Since this must be a Pauli group element, P , which can be expressed (up to a phase) as a product of p X p Z , where p Z is a diagonal Pauli gate, and p X is a permutation (Pauli) gate, we have that π t d t = p X p Z and via the splitting property ∈ CH (at any level) and p X ∈ CH 1 .We have a contradiction and our assumption that π 1 d 1 ∈ CH k must not be true. .Assume π is in CH at some level higher than k.We will use k + 1, but any higher level will work.Then, by a similar argument as Thm.A.11, we can always choose p k+1,k X such that πp k+1,k X π † ∈ CH k .We eventually get to the case where πp 3,2  X π † is Clifford (or higher if not using k + 1), but must be in the Pauli group since πd ∈ CH k .We arrive at a similar contradiction which implies that π ∈ CH k .
Let πd ∈ CH 2 , then πdpd † π † ∈ CH 1 for all Pauli strings p.Then, by A.11.2 π ∈ CH 2 .Since πd = C, a Clifford gate, we have that d = π † C which is also Clifford on account of the Clifford elements forming a group.This implies that d is also Clifford which completes our proof.
Note that π ∈ CH k and d ∈ CH k do not imply that πd ∈ CH k as the following circuit identity shows: Here both T and Toffoli are in CH 3 , but the product as illustrated in the circuit above is in CH 4 .Also, while we have shown that πd ∈ CH k implies π ∈ CH k , we have not proven that πd ∈ CH k implies d ∈ CH k , only that it implies d ∈ CH (at some level).We leave it as an open problem to prove this or to find a counterexample.A counterexample would consist of a gate πd ∈ CH k where d is a diagonal gate in CH, but not in CH k .

B Some Examples of Groups in the Clifford Hierarchy
For one and two qubits we can use the constraints derived in this paper to find all groups in CH satisfying the constraints.

Case: n = 1
For a single qubit the only permutation (Clifford or otherwise) is Pauli X and the only semi-Clifford groups in CH are Clifford-isomorphic to subgroups of The former is a generalized symmetric group which is also a dihedral group corresponding to the symmetries of a 2 k -sided polygon.The latter is the one-qubit Clifford group.It has been proven that all gates in CH on one-qubit are semi-Clifford and therefore all singlequbit groups in CH must be Clifford-isomorphic to a subgroup of one of these groups.
It is also known [6] that all transversal logical gates in qubit stabilizer codes must be in CH.Since transversal gates must also form a group, the only transversal logical gates for an [[n, k = 1, d ≥ 2]]7 qubit stabilizer code must be Clifford-isomorphic to a subgroup of one of the groups shown above.This is similar to the result proven in [32].Note that Wirthmüller's result is more elementary in that it does not use disjointness results (or the cleaning lemma) to prove their claims.

Case: n = 2
For two qubits, all elements in CH are semi-Clifford and all groups are Clifford-isomorphic to a subgroup of one of the following groups Here C 2 Π = ⟨CX (1,2) , CX (2,1) , X 1 , X 2 ⟩ is the two-qubit Clifford-permutation group, H and S generate the one-qubit Clifford group, and C 2 is the two-qubit Clifford group.

Case: n ≥ 3
For n ≥ 3, we have non-Clifford permutations and the constraints become more complicated.Furthermore, it has not been proven that all elements in CH are generalized semi-Clifford.Even if we assume the generalized semi-Clifford conjecture, the number of distinct groups grows rapidly with n and finding (and listing) them all would quickly become unsustainable.We can, however, still provide some examples of generalized semi-Clifford groups.
First, we identify some permutation groups in CH which have non-Clifford permutations.In the groups presented below, C indicates the full group of Clifford permutations on qubits a-b (with 1 being the topmost qubit and proceeding downwards).It can be verified (with some work) that all permutations generated by these groups are in CH.
We also give some examples of a set of (gate) generators for Diag n l the 2 n × 2 n diagonal unitary matrices with 2 l root of unity entries: Here i indicates any single qubit, i, j any pair of qubits, etc.
We can construct new groups with the semi-direct product; since these groups (and elements) satisfy the constraints to be a group in CH, we have that any subgroup of the following are in CH: 3 .These are just examples which can be extended to Diag l with higher (larger l) roots of unity or to different groups of permutations or to permutations on more qubits.

C Permutation Gates in CH on 3 qubits
Earlier, we showed that a generalized semi-Clifford gate must have a permutation in the Clifford Hierarchy to be in the Clifford Hierarchy itself.To get an idea of how restrictive this requirement on permutations is, we find all the classical permutations on three qubits (that is 8 × 8 permutation matrices) which are in CH.Note that all Clifford permutations must be in CH and we will look only at the non-Clifford permutations here.For permutations on three qubits, these are generated by Toffoli gates.We will associate the Toffoli with target on qubit 1 with generator 'a', the Toffoli with target on qubit 2 with generator 'b', and the Toffoli with target on qubit 3 with the generator 'c'.With this association, we have the following group presentation: Here g i , g j , g k can represent any generator, but g i ̸ = g j ̸ = g k ̸ = g i .The group relations are given by easily verified Toffoli gate identities.This group is finite and all distinct words are given below: {1, a, b, c, ab, ac, ba, bc, ca, cb, aba, abc, aca, acb, bac, bca, bcb, cab, cba, abac, abca, abcb, acab, acba, bacb, bcab, cabc, cbac, abcab, acbac, bacba, bcabc, cabca, cbacb, abcabc, acbacb, bacbac}.
Many of these words are equivalent up to Clifford operations and we have the following classes of non-Clifford (and non-trivial) 3-qubit permutations: a, ab, aba, abc, abac, abca, abcab, abcabc.
To show that a gate, U , is not in CH at any level it suffices to show that for at least one Pauli string p where V is a gate not in CH.
We already know that a single Toffoli is in CH 3 .Then, using the relation: we see that permutations in aba class are also in CH 3 since they are Clifford-equivalent to a single Toffoli.In Zeng et al. [10] they showed that which shows that ab and abc classes are not in CH.
Note that the example for class abc also proves that class abca is not in CH since For class abac we have the following circuit identity: For class abcab we have the following identity: And finally, for class abcabc the example from class abcab also shows it is not in the Clifford Hierarchy. • We see that the only classical permutations on three qubits in CH are Clifford permutations and (up to Clifford permutations) a single Toffoli gate.

D Identifying Permutations in CH
We have shown that for a generalized semi-Clifford gate to be in the Clifford Hierarchy, its permutations must be in the Clifford Hierarchy.While it is easy to check whether a diagonal gate is an element in CH (verify that all entries are 2 k roots of unity), determining which permutations are in CH appears to be more challenging.
Generally, a gate, U , is at level k in the Clifford Hierarchy, denoted CH k , iff U pU † = V k−1 for all 4 n Pauli strings p and V k−1 is an element of CH k−1 .Assuming that membership in CH 2 , the Clifford group, can be easily verified, we see that checking if U is in CH 3 requires checking 2n Pauli group generators and verifying that each U pU † is in CH 2 .Then, since U p 1 p 2 U † = U p 1 U † U p 2 U † and since CH 2 is a group, we can see that if it is true for the generators it must be true for all elements.We can imagine a black box which checks if U pU † is in CH k .Then, 2n queries must be made to check if U ∈ CH 3 .For levels k > 3, all 4 n strings must be checked (queried) generally.This gives an upper bound on the number of queries to be made of 4 n(k−3) 2n.From, Corollary A.9.1, we see that permutation gates require only 2 n(k−3) n queries since only Pauli X strings must be checked.This is still exponential.Furthermore, each query generally involves multiplication of 2 n ×2 n matrices.
Still, there are some classes of permutations which can be shown to be in CH.Here we identify one such class.We will look at circuits of multi-controlled NOTs, denoted C n (X) for n ≥ 1.These include CNOT and Toffoli.Note that each gate consists of n controls (in the computational basis) and one target.We will define a time slice of a circuit as some set of C n (X) gates which can be implemented simultaneously in the circuit.That is, their support is on different wires.We will define the Control-Target (CT ) mismatch between time slices as the number of controls(targets) of permutation gates in one time slice of a circuit which share the same wire with targets(controls) in another time slice.Theorem D.1.If a permutation can be written as a circuit, U , such that the CT mismatch is zero between any two time slices, then U is in CH.
Proof.Note that CT mismatch of zero is equivalent to requiring that all time slices commute.Then, since any time slice can be diagonalized by conjugation with local Clifford gates, simply conjugate each target by H. And, since the CT mismatch is zero, all time slices can be diagonalized by the same local Clifford gates; U is therefore Cliffordisomorphic to a diagonal gate element in CH which shows that U must be in CH.

Lemma D.2.
A Pauli X string can be 'passed through' a permutation gate, C n (X), without increasing the CT mismatch in the circuit.
We will prove the result for a weight-one Pauli X string, and note that by repeating the result (with other weight-one Pauli X strings), it can be applied to an arbitrary X string.Using the following circuit identity: we see that the Pauli X string can be passed through any C n (X) gate without increasing the CT mismatch.The additional C n−1 (X) gate has targets and controls at the same locations as the C n (X) gate and will have the same or lower CT mismatch with all other gates in the circuit.Note that this circuit identity, while derived independently, is similar to the 'Pauli Sandwich Trick' of O'Connor and Yoder [33].Proof.It is well known that C n (X) is in CH at level n+1 [10].We only need to check Pauli X strings by Lemma A.9.1.By Lemma D.2 we see that we can pass Pauli X strings through permutations and the resulting permutations must commute with all other permutations.This allows us to treat each time slice separately, as well as each gate in a time slice if there is more than one.Then, the permutation circuit is in CH at the level of the highest-level individual gate, as claimed.
We close this section with some open problems and a cautionary tale.
Conjecture D.1.A permutation is in CH at the third level iff it can be written as a circuit of commuting Toffoli (C 2 (X)) gates (possibly preceded and followed by Clifford permutations).
From Thm.D.3, any network of commuting (CT mismatch zero) Toffoli gates is in CH 3 .Also, from Thm. D.3 we see that if the permutation gates commute, then no C n (X) gates with n ≥ 3 are permitted since they belong to CH k>3 .What remains to be proven is that any circuit of C m (X) gates with m ≥ 2 and CT mismatch greater than zero (noncommuting permutations) is not in CH 3 .

Conjecture D.2. If a permutation π is in CH
We have been careful to use the phrase "if a permutation can be written as a circuit..." We warn the reader that determining if a permutation can be written in this manner is likely to be difficult, at least in general.Consider the fact that permutations are universal for reversible classical computation, and that the problem of determining whether or not a given reversible circuit is equivalent to the identity is known to be NP-Hard.Given this it is highly unlikely that an efficient algorithm exists to determine the level in CH of a general permutation.

E Permutation gates with support on C qubits
In this section we look at adding permutation gates which have support on both the Clifford and non-Clifford qubits and the additional restrictions that arise in these cases.These extensions are only relevant for groups such as ⟨Π n , D n−m l × C m ⟩ which have a non-Clifford and an (unconstrained) Clifford component.We write all gates in this section in terms of permutations, diagonal gates and Clifford gates, but note that the restrictions below are valid for other groups Clifford-isomorphic to these groups.We also assume that permutations with support on both types of qubits are compatible with arbitrary diagonal gates in CH on the non-Clifford qubits and arbitrary Clifford gates on the Clifford qubits.This means that some groups with restricted diagonal gates and/or restricted Clifford gates may exist in CH with a larger set of permutation gates between the Clifford and non-Clifford qubits.Though we have evidence that this does not occur.
First, note that if all elements in Π n have support exclusively on the n − m qubits with D n−m l gates (hereafter referred to as non-Clifford qubits), then these two groups never 'interact' and no additional restrictions are needed.Additionally, if Π n has elements that are Clifford permutations which have support exclusively on the m Clifford qubits, no additional restrictions are needed.If either (or both) of these cases occur, we can fully realize the group (or any subgroup of) (Π n−m ⋉ D n−m l ) × C m in CH.Since Clifford permutations are part of the Clifford group, they are not written as separate permutations.
We can immediately rule out a large class of permutations.Permutation gates with target (and potentially, control(s)) on the non-Clifford qubits and with at least one control on the Clifford qubits, will cause the number of non-Clifford qubits to increase.This is true even when the permutation is a CN OT gate as shown below: Here the top qubit is a non-Clifford qubit and the bottom qubit is (was) a Clifford qubit.Even if the non-Clifford diagonal gates are severely restricted to some subgroup such that no non-Clifford gates can 'propagate down', Clifford gates such as √ X ≜ HSH can still 'propagate up' to the non-Clifford gates.
√ X is neither a permutation nor a diagonal non-Clifford gate and would create (via multiplication of elements in G) an element which is not generalized semi-Clifford.We conclude that permutation gates with any target on the non-Clifford qubits and at least one control on the Clifford qubits are not permitted, given our assumption of arbitrary diagonal gates on the non-Clifford qubits 8 .Since this implies that the permutation gates that are (potentially) allowed only have targets on the Clifford qubits, we denote this group on n qubits as Π n ↓ .Note that any diagonal element on the non-Clifford qubits must commute with any element π ∈ Π n ↓ .That is for any d ⊗ I m ∈ D n−m l × C m we have πd = dπ.Also, for any permutation, π ∈ Π n−m , with support only on the non-Clifford qubits and π ↓ ∈ Π n ↓ , we have that ππ ↓ π † = π ′ ↓ .In other words, elements of Π n−m are in the normalizer of Π n ↓ .This is easy to show since the support of any element in Π n ↓ is equivalent to a diagonal gate on the n − m non-Clifford qubits.We conclude that elements in Π n ↓ place no additional constraints on elements in Π n−m ⋉ D n−m l .Some elements of Π n ↓ , however, must be restricted when acting on Clifford qubits.We give the following cases which require restrictions on group(s) Π n ↓ and/or C m : (1) A gate, C t (X) ∈ Π n ↓ , with t ≥ 2 (a non-Clifford permutation) which has supp(C t (X)) = t + 1 ≥ 3 on the Clifford qubits.Then, since the Clifford group is a maximal finite group and this new gate is non-Clifford, the full 3-qubit Clifford group and this element must generate a infinite group which clearly has elements not in CH.Additional restrictions on one (or both) of the groups must be made.
(2) A gate, C t (X) ∈ Π n ↓ , for t ≥ 2 (a non-Clifford permutation) has supp(C t (X)) = t + 1 ≥ 2 (target and at least one control) on the Clifford qubits.Then, since we assumed that any element of the 2-qubit Clifford group is present on these qubits, we can use products of Hadamards on the Clifford qubits with C t (X) to implement a permutation not in CH.This group is still finite, but it contains permutations not in CH.See circuit below9 : This also requires that one (or both) of the groups is subject to additional restrictions.Since we have made the choice to keep the full Clifford group we restrict the group ∈ Π n ↓ .If we restrict each element of Π n ↓ to have support on only one qubit among the Clifford qubits (it must be a target by the discussion above), then we find that any element of this subgroup of Π n ↓ can be combined with (Π n−m ⋉ D n−m l ) × C m without any (additional) constraints.We will denote this subgroup of Π n ↓ with support equal to one on the Clifford qubits as Π n ↓,1 .Note that elements of Π n ↓,1 can have support on different (or the same, for that matter) Clifford qubits; however each element has support on only one Clifford qubit.It is easy to show that Π n ↓,1 is abelian.Now we can give a (slightly) larger classification of groups in CH.If we demand that permutations in Π n are compatible with arbitrary diagonal gates in CH on the non-Clifford qubits and arbitrary Clifford gates on the Clifford qubits, then the following are necessary and sufficient conditions.
Groups of semi-Clifford elements in CH are Clifford-isomorphic to a subgroup of the following: Here, Π n C↓,1 denotes a Clifford element in Π n ↓,1 .These elements are all CN OT gates.Groups of generalized semi-Clifford elements in CH are Clifford-isomorphic to a subgroup of the following: We have looked at relaxing the full Clifford group requirement in Equ.E.2 to see when a Toffoli gate with target and one control on the (now relaxed) Clifford qubits and at least one control on the non-Clifford gates can be performed.In other words we want to know what Clifford gates can appear C ? (in the circuit below, see Equ.E.3) such that the group generated by these gates and the Toffoli gate are in CH.
In this case we have strong evidence that the C ? must be of the form where D 1 l is reduced to the trivial subgroup.This is already contained in our classification above.For this classification to be complete we need to show that any non-Clifford permutations acting on the Clifford qubits always restricts the Clifford gates in this manner.(1) and (2) above show that the Clifford gates must be restricted, but we have not proven that they must be restricted to the groups in our classification above.We leave this as an open problem.

F Diagonal Gate Groups in CH
In which three ways of looking at the same thing are presented.
Note this section is not necessary for any of the results contained in this paper.I found this way of looking at the diagonal gates in CH useful and decided to share it.In Cui et al. [11] they classified all the diagonal gates in the Clifford Hierarchy for qubits and for qudits as well.We find that it is helpful to view these gates via three complementary pictures.The first is the Z rotation picture which readily shows what level in CH an element or group of elements is in.In the Z rotation picture, we write a diagonal element, d, as a product of Z rotations as follows: Here α j is an integer, k j is a positive integer, and Z j is a Pauli Z string.A diagonal gate is in CH iff it can be written this way and d is in the k = max k j level in the Hierarchy.In If d / ∈ CH, it must have a Z rotation about some angle π r with r ̸ = 2 k for any k.We will write this as r = 2 k p where p ̸ = 2 k .Then d 2 must have a Z rotation about 2π r and since p does not divide 2, we have that d 2 / ∈ CH.Note that this does not extend to d 3 since π 3 rotations cubed are proportional to Identity which is clearly in CH.In the gate picture, we write a diagonal element, d, as a product of well-known diagonal gates.Any diagonal gate in CH on n qubits can be written as some combination of gates: A gate Λ m (Z 1/2 l ) is in CH l+m .All gates on n qubits with l + m ≤ k form the group, D n k .In the circuit picture all elements are distinct which allows us to count the number of elements in D n k .
Finally, in the matrix picture, we have all 2 n × 2 n matrices with entries in the 2 k th root of unity.To fix the U (1) gauge, we will always choose the upper-left entry in the matrix to be 1.We refer to these groups as Diag n k .We have the following relation between groups: D n k ⊆ Diag n k ⊆ D n k+n ⊆ Diag n k+n .In other words, D n k2 can always be chosen to be large enough to contain all elements of Diag n k1 .Therefore, both Diag n and D n contain all diagonal elements in CH.The group Diag n k has the property that it is preserved under conjugation by any permutation matrix.This follows by noting that all elements in Fig. 2 commute and the square of any element in Diag n k is an element in Diag n k−1 .

G Diagonal Gates in the Qubit Clifford Hierarchy
In an effort to make this paper more self-contained, we provide a simple proof of the diagonal gates in the qubit Clifford Hierarchy.A more general proof classifying all diagonal gates in any prime qudit Clifford Hierarchy is provided in [11].First, note that any 2 n × 2 n unitary diagonal matrix, d, can be written as a product of Pauli Z rotations with Z j running over all distinct Pauli Z strings and θ j ∈ [0, 2π).Each Pauli string is unique and there are 2 n such strings (one for each diagonal element in a 2 n × 2 n matrix).Note that the 'all Identity' string is included in this count, even though it only applies a global (trivial) phase.It is well known that an element is in the Clifford group if and only if it can be written as a product of π/4 Pauli rotations.We can, therefore, write an arbitrary diagonal Clifford element as with α j = {0, ±1, ±2, ±3, ±4}.Here the Z j are distinct Pauli Z strings.Note that a product of distinct π/4 Pauli Z rotations can equal the identity.This is a nuance to consider when counting distinct gates but will not pose a problem here.Now for a diagonal gate to be in the third level of CH it must, under conjugation, take all Pauli strings to a Clifford element.We can express this requirement as dP i d † = C d P i ∀P i since exp (iθ j Z j ) P 1 exp (−iθ j Z j ) = P 1 , if [P 1 , Z j ] = 0 exp (iθ j Z j ) P 1 exp (−iθ j Z j ) = exp (i2θ j Z j ) P 1 , if {P 1 , Z j } = 0 for each Z j noting that d is a product of Z j rotations.Finally, since each Z j anticommutes with some Pauli string (actually many), we have the following requirement: exp (i2θ j Z j ) = exp i j π 4 Z j .
We conclude that θ j must be a multiple of π/8 for all j.Now that we have classified the diagonal CH 3 gates, we can proceed to find the diagonal gates in the 4th level of CH which, under conjugation, take all Pauli strings to a diagonal gate in CH 3 times a Pauli string.A similar proof shows that the diagonal gates in CH 4 must be products of diagonal rotations with θ j ∝ π/16, and more generally, that a diagonal gate element in CH k must be a product of diagonal rotations with θ j ∝ π/2 k .We have sketched a proof outline here, but note that a straightforward proof by induction is required to make this proof outline rigorous.

H Some properties of Generalized Symmetric Groups pertaining to this work
Generalized symmetric groups can be expressed as semi-direct products of the symmetric group on N elements, S N , and N copies of a cyclic group Z M .Z N l has a unitary representation as N × N diagonal matrices with entries in Z m expressed as complex M roots of unity (e i2π/M ), and S N has a standard representation as N × N permutation matrices.We denote these generalized symmetric groups as S(M, N ).For finite M, N , these groups are finite and have size |S(M, N )| = M N N !.
Here all the representations correspond to unitary gates on n qubit which are sized 2 n × 2 n matrices and N = 2 n .Additionally, due to the constraints on diagonal gates in CH, we always have M = 2 k , expressing the fact that diagonal gates here must have entries which are some 2 k th root of unity.These groups S(2 k , 2 n ) are of order (2 k ) 2 n (2 n !) = 2 k2 n (2 n !).
Elements of S(2 k , 2 n ) can always be expressed as a product of a permutation, π, with a diagonal matrix, d.We can write this as g = (π, d) = πd.Then, it is easy to show that for any two elements we have We are interested in subgroups of S(2 k , 2 n ) since these all correspond to groups in CH.Generally finding all such subgroups seems difficult, but we note that for all subgroups of S(2 k , 2 n ), the 'permutation part' of each element (the π's in each g = (π, d)) must form a subgroup of the permutation group.
We sidestep much of the difficultly of finding all such subgroups by placing constraints on generators, such that any set of generators satisfying the constraints listed in this paper will generate a valid subgroup of S(2 k , 2 n ).Furthermore, since this is a finite group and, therefore, finitely generated, we can express all such subgroups this way.
By examination of the product of an element g with itself we see that if g = (π, d) and π m = I, then g m is a purely diagonal entry.When these diagonal entries are non-trivial, we have (non-trivial) purely diagonal subgroups within the subgroup of S(2 k , 2 n ).

. 1 )
Here we have combined the diagonal Clifford gates into D l and denoted the group of Clifford permutations on n qubits by C n Π and the Clifford group on l qubits as C l .The groups C m Π ⋉ D m l are sometimes called generalized symmetric groups [21, 22] 4 .We use the notation C m Π ⋉ D m l to indicate the semi-direct product of the m-qubit Clifford permutation group (a subgroup of the 2 m × 2 m permutation group) with the diagonal gate group D m l .It is easily verified that C m Π is in the normalizer of D m l and that C m Π ∩ D m l = {I} (the intersection of the groups is trivial).

2 .
Choose a set of generating elements g i = (π n−m i d n−m i ) ⊗ c m i where each π n−m i is a (2 n−m × 2 n−m ) permutation matrix in CH which acts on the n − m non-Clifford qubits, each d n−m i is a diagonal gate in CH which acts on the n − m non-Clifford qubits,

Theorem A. 9 .
If a permutation gate, π ∈ CH, and a diagonal gate, d ∈ CH, then πd ∈ CH.We prove this theorem by induction on the sets G n [k].Since any permutation in CH is in G n [k] for large enough k and all diagonal gates in CH are in each set, G n [k], proving the theorem for all G n [k] proves the stated theorem.Proof.Base case k = 2: For k ≤ 2 all permutations are Clifford and by Lemma A.4, any Clifford times a

Corollary D. 2 . 1 .Theorem D. 3 .
Since multiplication of U on the left and right by Clifford permutations (Xs and CNOTs) does not change the level in CH we can extend Theorem D.1 to allow arbitrary Clifford permutations on the left and right of U .Also, since Pauli X strings can be 'passed through' a permutation circuit without increasing the CT mismatch, we can allow arbitrary X strings between time slices.Any permutation circuit with CT mismatch zero is in CH at the level of the highest-level gate in the circuit.
{e} meaning their overlap is trivial.The semi-direct product ensures that any element of G n l can be written as πd where π ∈ Π n and d ∈ Diag n l .Furthermore,π 1 d 1 = π 2 d 2 ⇐⇒ π 1 = π 2 and d 1 = d 2 .Therefore, any element of G n l can be uniquely written as πd.The inverse of πd= d † π † = π † (πd † π † ).A gate, U , is in CH k+1 ,the Clifford Hierarchy at level k + 1, if U P U † ⊆ CH k for all Pauli strings p ∈ P. A gate U is in CH, the Clifford Hierarchy at any level, if U P U † ⊆ CH for all Pauli strings p ∈ P .If U pU † ⊈ CH for any Pauli string p ∈ P , then U / ∈ CH.
Lemma A.1.Let U ∈ G n l , then U pU † ∈ G n l for any n-qubit Pauli string, p.
10.If a permutation gate, π ∈ CH, and a diagonal gate, d / Proof.Base case k = 2: Here, π is Clifford and d / ∈ CH.Assume that g = πd ∈ CH.Then, d = π † g, but π † is a Clifford gate since the Clifford gates form a group, and π † g ∈ CH since multiplication by Clifford gate does not change the level in CH.We then have that d ∈ CH, a contradiction.We conclude that all elements in Gn [2] are not in CH.Assume, πd ∈ Gn [k − 1] =⇒ πd / ∈ CH.Let πd be an element in Gn [k].We want to show that there exists some Pauli string p such that πdpd † π † / ∈ CH.Since d / ∈ CH, there must exist some p X (since all p Z commute with d) such that dp X d † / ∈ CH and this equals p X d ′ for some diagonal matrix d ′ (this is a consequence of Lemma. A.
and by our inductive hypothesis, we have that πp X π † πd ′ π † / 10rollary A.10.1.By Theorems A.9 and A.10we have that for π ∈ CH, πd ∈ CH ⇐⇒ d ∈ CH.Theorem A.11.If π / ∈ CH then πd / ∈ CH.Proof.We prove this theorem by contradiction.Let π 1 / ∈ CH.Assume that π 1 d 1 ∈ CH k for an arbitrary diagonal gate, d 1 .Since π 1 / ∈ CH we have that there exists a p 1,2 X Therefore, π 1 d 1 / ∈ CH k .But since this proof works for arbitrary k, we conclude that π 1 d 1 / ∈ CH.By Thms A.11, A.9, and A.10 we conclude that πd ∈ CH iff π ∈ CH and d ∈ CH.This establishes the canonical form for generalized semi-Clifford gates used in this paper.We can add left and right Clifford operators to any πd ∈ CH since by Lemma A.4, this is also in CH at the same level as πd.If πd ∈ CH k , then π ∈ CH k .This follows from a similar proof as in Thm.A.11.Let πd ∈ CH k .Assume that π / ∈ CH k .It must be in CH by Thm.A.11 (or else we would have already reached a contradiction) [34] et al., they showed that all n-qubit Z rotations by a fixed angle π/2 k generate the group D n k .This is the group of diagonal gates on n qubits in CH k .Note that all Z rotations by a fixed angle do not necessarily correspond to distinct elements in the group.The group properties are most easily seen in this picture, and we include some results pertaining to the group D n k here.0Λ 1 Λ 2 Λ 3 Λ 4 Λ n-1 ... 0 Λ 1 Λ 2 Λ 3 Λ 4 Λ n-1 ...Figure 2: Comparison of diagonal gate groups in CH.Points in figures correspond to controlled-Z rotations by angle π/2 k .The number of controls is labeled across the top and the rotation angle is on the left.The groups are generated by these multi-controlled rotations.The figure the left shows the family of groups, D k , which are the diagonal gates at level k in CH.The figure on the right shows the groups, Diag k , of matrices with entries in the 2 k th root of unity.Here the gates act on up to n qubits and the generators are on all appropriate sets of qubits.For example, the Λ 2 (Z π 2 ) (CCZ gate) generators are on all n 3 qubits.Each group can be generated by the gates (on all appropriate sets of qubits) which are the 'lowest' points in each column in the shaded region corresponding to that group.For anyd ∈ D n k , d 2 ∈ D n k−1 .This can be easily seen by looking at the product of Z rotations in Equ.F.1.A similar observation was made in Campbell and Howard[34].For any diagonal gates d ′ / ∈ CH and d ∈ CH, d ′ d / ∈ CH.To see this, assume thatd ′ d ∈ CH.Then, d ′ d = d 2 =⇒ d ′ = d 2 d † .And since the diagonal gates on the right-hand side are in CH via group closure of D n k , we have that d ′ ∈ CH, a contradiction.For any d / ∈ CH, we have that πdπ † / ∈ CH for any permutation π.For any diagonal gate, d; conjugation by permutations does not change its eigenvalues.A diagonal gate is in CH (see Equ. F.1) iff it has eigenvalues which are 2 k roots of unity.A diagonal gate d / ∈ CH must therefore have at least one eigenvalue which is not of this form.Since conjugation by permutations does not change this eigenvalue and maps diagonal gates to diagonal gates, we conclude that πdπ † / ∈ CH.