Fixed-Depth Two-Qubit Circuits and the Monodromy Polytope

For a native gate set which includes all single-qubit gates, we apply results from symplectic geometry to analyze the spaces of two-qubit programs accessible within a fixed number of gates. These techniques yield an explicit description of this subspace as a convex polytope, presented by a family of linear inequalities themselves accessible via a finite calculation. We completely describe this family of inequalities in a variety of familiar example cases, and as a consequence we highlight a certain member of the"XY-family"for which this subspace is particularly large, i.e., for which many two-qubit programs admit expression as low-depth circuits.


Introduction
Compilers for quantum computers have two primary tasks. One is to convert a hardwareagnostic description of an algorithm to a hardware-aware description suitable for execution on a particular physical device. This is an involved process, owing both to the idiosyncratic limitations of quantum computational devices and to the extremely large space of quantum programs. Ideal, "pure" quantum programs, which do not interact with the outside world until termination, can be interpreted as points in the projective unitary group P U (2 q ) (i.e., unitaries neglecting the effects of global phase), where q is the number of qubits in the system. For all q > 0, the group P U (2 q ) is infinite, and so quantum compilers must draw on methods from continuous mathematics to accomplish their task.
Optimized expression of a program, a compiler's second task, is of particular interest to programmers of quantum devices which do not yet enjoy fault tolerance. If each instruction has the potential to introduce error into the computation, then after sufficiently many instructions are enacted, the state of the quantum device will no longer even approximate the programmer's in-tent. Correspondingly, optimization passes in a quantum compiler which lower circuit depth provide a form of noise mitigation, and hence they contribute not just to expedience but to correctness.
In light of this, optimality results for decompositions are of interest to quantum compiler designers. In the presence of recursive compilation schemes (e.g., Quantum Shannon Decomposition [44,Theorem 13]), such results for low numbers of qubits are particularly interesting, as they improve the overall output of the compilation routine by a scalar factor. Some of the most advanced such results to date include: Shende, Bullock, and Markov [43] showed (using an existing framework, see e.g. [31]) that all two-qubit programs can be expressed using three applications of the CZ-gate, 1 interleaved with singlequbit rotations; Zhang, Vala, Sastry, and Whaley [50] showed that all two-qubit programs can be expressed using two applications of the B-gate, interleaved with single-qubit rotations; the same group showed that a wide class of exponential families of two-qubit gates can be used to implement an arbitrary two-qubit program, using three applications interleaved with single-qubit rotations [49]; and the same group gave near-optimal decompositions into controlled prescribed gates, ultimately relying on a convexity theorem [?].
This first set of results has two particularly interesting features. First, the methods they describe are computationally tractable: one can actually construct their circuits by using standard algorithms in linear algebra. Second, they use the same techniques in a follow-up paper [45] to analyze the subspace of programs which take no more than two CZs to implement, and they conclude that "almost all" two-qubit programs take three invocations of CZ to implement. Comparing this with the results of the other authors suggests an interesting quality metric on native gate sets: let L S (U ) be the minimum number of two-qubit gates needed to implement U as a circuit with gates drawn from S. We then conclude that the expected values satisfy L CZ = 3, L B = 2, and L H ≤ 3 for most gate sets of the form H = {H t = exp(th) | t ∈ R} with h a fixed anti-Hermitian matrix.
Although physical devices with native multiqubit operations other than CZ have been implemented, optimality results and expected gate counts for these other native gate sets have not yet appeared. In this paper, we offer tools for the analysis of these problems at the following level of generality: Theorem (Corollary 26). For S a finite set 2 of two-qubit operations and for n ≥ 0, let P n S ⊆ P U (4) be the following set of two-qubit programs for S j ∈ S and A j , B j ∈ P U (2). In a certain coordinate system to be described below, P n S can be expressed as a union of (2|S|) n convex polytopes, each described by a (typically highly redundant) family of linear inequalities of size exponential in n.
We use these results to explore the space of possible choices for the native gate set, with an emphasis on those appearing via Rigetti's choice of interaction Hamiltonian [10] (cf. also [42]): the gates CZ, iSWAP, CPHASE, and XY, where by XY we intend the unitary family Our methods in the case of S = {CZ} recover results of Shende, Bullock, and Markov [43,45].
In the other cases, we make the following conclusions: Corollary (Remark 38). The sets P 2 iSWAP and P 3 iSWAP are the same as the corresponding sets for S = {CZ}. Hence, P 2 iSWAP occupies 0% of the volume of all two-qubit programs, and L iSWAP = 3.
The two most interesting features of this result are that the availability of gates in the XY-family can have a dramatic effect on the optimal gate depth of a generic two-qubit program, and that the bulk of this effect is seen from a single gate from this family. At the magic value of α = 3π/4, we provide an explicit routine for checking membership in this preferred subspace.
Our methods also lend themselves to an analysis of problems in approximate compilation. Each of the sets P n S described above is a proper subset of the space of all two-qubit programs, and for a two-qubit program U it is natural to search for the two-qubit program within P n S "closest" to U and to give a precise expression for this distance. We give a protocol describing the use of our techniques in this situation, and we give explicit computations of the best approximant and its minimum distance for certain interesting gates (e.g., SWAP) and interesting gate sets (e.g., XY 3π into triples of rotations. We begin by fixing notation: 4 Theorem 1 (YZY-Euler decomposition, [15, pg. 189-207]). Any single-qubit program U ∈ P U (2) can be expressed as a triple of rotations: where 0 ≤ β ≤ π. (Moreover, for 0 < β < π, the values 0 ≤ α, δ ≤ 2π are essentially unique.) Proof. This follows as a special case of the Cartan decomposition, which we briefly recount for a generic Lie group G. Such a decomposition rests on the choice of an involution θ on G, referred to as a Cartan involution on G. The function θ breaks the Lie algebra g of G into two parts: the derivative D 1 θ has nontrivial eigenspaces of weights 1 and −1, denoted e and o respectively, and g = e ⊕ o. The Cartan decomposition refers to a corresponding decomposition at the level of Lie groups: by selecting a maximal abelian subalgebra t ≤ e and exponentiating t and o to the Lie subgroups T and O, one has In this context, "abelian" means [t 1 , t 2 ] = 0 for any t 1 , t 2 ∈ t.
Rather than simply remit this decomposition to the literature, we make wholly concrete its application to P U (2). Begin by selecting the involution θ 1 (U ) = U T , whose associated eigenspaces e and o are given by Further selecting the maximal abelian subalgebra t = σ Z , the Cartan decomposition associated to this data asserts that any U ∈ P U (2) can be decomposed as Finally, we turn to the algorithmic determination of these parameter values. Inspired by this product form, we consider the Cartan double of U : γ 1 (U ) = U · θ 1 (U ) = U U T .
In terms of the decomposition, this gives Indeed, U U T is a symmetric unitary matrix and hence admits a basis of real eigenvectors. These can be used to determine the value of α, and the eigenvalues of γ 1 (U ) can be used to determine the value of 2β (and hence β); and the value of the parameter δ can then be determined from Y δ = Z −β · Y −α · U . The claim 0 ≤ β ≤ π can be guaranteed by beginning with −π ≤ β ≤ π and, in the case β ≤ 0 is negative, commuting Y π through the expression.
Before continuing on to the two-qubit case, we remark on some variations on this result which are specifically useful to quantum computing.
Remark 2. In the practice of microwave-driven superconducting qubits, there is some preferred rotation-say, Z t -which is a "virtual" operation, implemented as a frame shift, and hence is both instantaneous and immune to device error. Because of this, it would be preferable to have a variant of the decomposition of Theorem 1 in which Z t appears twice, as it would produce circuits with superior execution properties. One can accomplish this by conjugation: given an operator U , its conjugation by Q is defined by U Q = Q † U Q. This operation enjoys the following properties: • A torus is a connected abelian subgroup of a compact Lie group (e.g., P U (n)), and a torus is maximal when no larger torus contains it. For any two maximal tori T 1 and T 2 , there exists an operator Q such that T Q 1 = T 2 [22, Lemma 11.2]. 5 For example, the families Y t and Z t are both maximal tori in P U (2), and they are conjugate by the operator Q 1 = X π 2 : One can then use Q 1 to transform the outer components of Theorem 1 from Y t to Z t , which gives the desired decomposition: Remark 3. Alternatively, one can apply Q 1conjugation to the set-up of the theorem, rather than its inputs, to reach the same conclusion. Starting with the Cartan involution θ(U ) = U T , we define a new involution 6 and its associated doubling We now turn to the analogous structure theorem for two-qubit operators: The parameter values are unique, and for generic parameter values the local gates are also unique.
Proof. As before, the Cartan involution θ(U ) = U T and associated Cartan doubling γ(U ) = U U T give a decomposition of an operator V into a product O L DO R , where these factors satisfy hence O L and O R are orthogonal and D is symmetric, hence diagonal. As in Remark 2, the 6 There is a similarity relation γ Q 1 theorem as stated arises by conjugating this decomposition by a particular operator Q, To see the constraints on the parameters α, β, and δ, we require an explicit formula for CAN Q : This linear system can be solved for any diagonal matrix diag(d 1 , d 2 , d 3 , d 4 ) satisfying d + = 0, and the resulting parameters can furthermore be taken to lie in the range [−π, π]. Since diagonal operators are stable under conjugation by signed permutation matrices, which are themselves members of P O(4), one may insert such operators into the expression to obtain several equivalent decompositions. One checks that the effects of these signed permutation matrices are generated by permutations and the operator (α, β, δ) → (π − α, π − β, δ).
It follows that there is a unique representative satisfying the indicated inequality.

Corollary 5.
If Theorem 4 yields the same canonical parameters for a pair of two-qubit operators U and V , then there exist single-qubit operators A, B, C, and D satisfying .
(In this case, U and V are said to be locally equivalent.) Proof. Apply the Theorem to produce Solving the second equation for the canonical gate gives and substituting it into the first yields Remark 6. As in the single-qubit case, this decomposition is algorithmically effective: given a two-qubit gate U , by selecting angle values α, β, and δ the operator spectrum of γ(U Q ) can be made to agree with that of CAN(α, β, δ); a special-orthogonal matrix diagonalizing γ(U Q ) recovers A and B; and, from this, one can then solve for C and D [45,Proposition IV.3]. The keystone of Shende, Bullock, and Markov is a process for manufacturing circuits with low CNOT-count for realizing particular values of CAN(α, β, δ). In general, they show that this requires three applications of CNOT, and they moreover show which gates are accessible within two (resp. one, resp. zero) applications of CNOTs: these are those gates whose canonical parameter δ is fixed at zero (resp. both β and δ are zero, resp. all parameters are zero). With these circuits in hand, they then apply Corollary 5.
Remark 7. In the current practice of quantum computing, single qubit operators typically experience device errors at a rate 1-2 orders of magnitude less than multi-qubit operators, which underscores a compiler designer's desire for decompositions that use two-qubit gates as sparingly as possible. From this perspective, the canonical decomposition neatly cleaves any two-qubit interaction into outer pieces, which are completely Figure 1: Summary of the one-qubit invariants of Section 2 and their interrelations canonical decomp.
canonical parameter spectrum of D, or spectrum of γ Q (G), or arguments to CAN. assailable by decomposition into single-qubit gates and which hence are representable with good fidelity, and an inner piece, which is completely unassailable by single-qubit gates, for which a general theory of decomposition into native interactions is not known, and which is especially prone to poor fidelity if a decomposition is inefficient. In reaction to this, we will focus all of our attention on the manufacture of families of canonical gates with the shortest circuits possible.
3 The multiplicative eigenvalue problem and the monodromy polytope Shende, Bullock, and Markov's description of those two-qubit programs accessible within a fixed number of applications of CNOT relies on specific commutation relations and explicit computation (cf. Appendix B). We will study a more general version of this same question: Problem 8. Let S be a set of two-qubit gates.
1. Describe the subspace P n S ⊆ P U (4), for S j ∈ S and A j , B j ∈ P U (2).
2. Given G ∈ P n S , algorithmically produce local gates A j , B j which realize G as such a circuit.
A solution to the entirety of Problem 8 would yield a depth-optimal compilation algorithm targeting S: given a two-qubit program U , one could compute its canonical parameters, use Problem 8.1 to discern the minimal P n S to which they belong, use Problem 8.2 to manufacture a circuit of the prescribed depth and with the prescribed canonical parameters, and finally use Corollary 5 to produce a circuit modeling U . A solution only to Problem 8.1 would yield a method for computing the following interesting value: Definition 9. Let L S (U ) be the minimum number of two-qubit gates appearing in any circuit implementation of U using the gate set S. We define the expected circuit depth of S to be This value measures the efficiency of the gate set S: the smaller L S Haar , the more efficient S is at encoding programs into circuits.
Sufficiently enticed, we begin with the first nontrivial case where n = 2 and where S 1 and S 2 are fixed: Problem 10. Let E and F be fixed two-qubit gates.
1. Describe the subspace P ⊆ P U (4), 2. Given G ∈ P , algorithmically produce local gates A 1 , A 2 , A 3 , B 1 , B 2 , and B 3 which realize G as such a circuit.
In this section, we show that this reduces to a well-known problem in representation theory, the multiplicative eigenvalue problem, whose solution comes in the form of the monodromy polytope.
Using Corollary 5, we can discern whether a given program G belongs to P by computing all of the canonical parameters of the programs in P and checking whether that set includes those of G. In order to make use of this, one would require a compact description of this set of parameters. To begin exploring whether this is feasible, let us go through the motions of computing the canonical parameters of G ∈ P -or, equivalently, computing the spectrum of the Cartan double γ(G Q ). Begin by applying Q-conjugation to the supposed decomposition of G to get In turn, E Q and F Q have orthogonal decompositions: where D E and D F are diagonal and O E,L , O E,R , O F,L , and O F,R are all orthogonal. Combining these decompositions yields Description of reduction. The canonical parameters of G are equivalent data to the spectrum of γ(G Q ). Because γ(G Q ) is similar to D 2 E OD 2 F O T and because operator similarity preserves spectra, it is equivalent to compute the spectrum of D 2 E OD 2 F O T . As G ranges over P (i.e., as the local gates in the circuit vary), the terms O range over P O (4).
For the second part, suppose that we can construct an O so that D 2 E OD 2 F O T has a prescribed operator spectrum. We may then work backward: where the local gate A 2 ⊗ B 2 is determined by the formula The circuit then has the prescribed canonical parameters.
Problem 11 is a restricted instance of the multiplicative eigenvalue problem: Problem 12 ([1]). Let U 1 , U 2 , and U 3 be unitary operators.
1. Multiplicative eigenvalue problem: Describe the possible spectra of all triples U 1 , Effective saturation problem: Given a triple of operator spectra satisfying the conditions of Problem 12.1, algorithmically produce U 1 , U 2 , and U 3 realizing these spectra and satisfying What is immediately clear is that the collection of spectral quadruples satisfying Problem 11.1 can be converted to satisfy Problem 12.1. Supposing that we have suitable operators D E , D F , D G , and O satisfying the similarity relation above, there must exist a unitary U satisfying which can be rewritten as This shows that the spectra of D 2 E and D 2 F agree with those of U 1 and U 2 , and the spectrum of D 2 G agrees with that of U † 3 . What is not obvious is that the reverse implication is also true: given U 1 , U 2 , U 3 satisfying 1 = U 1 U 2 U 3 , we would like to know whether it is always possible to factor out orthogonal matrices and rearrange terms to produce a sentence of the form This turns out to be so, which is a nontrivial result in symplectic geometry: Theorem 13 ([16, Theorem 3]). Suppose that D 1 , D 2 , D 3 are diagonal operators which satisfy the conditions of Problem 12.1. 9 Then there exist operators V 1 , V 2 , V 3 which diagonalize to D 1 , D 2 , D 3 , which satisfy V 1 V 2 V 3 = 1, and for which V 1 and V 2 are orthogonally diagonalizable, i.e., i.e., solutions to Problem 12 give rise to solutions to Problem 11.
Proof. Start by applying the Theorem: for E a matrix with columns an eigenbasis of V † 3 .
Problem 12.1 has been completely resolved by Agnihotri, Meinrenken, and Woodward. Because even the statement of their result is quite technical, the newcomer may find it too opaque, and so we pause to first investigate some simple cases by hand. We hope that this serves to motivate the full statement of Theorem 23 to follow.
Example 15 ([26, Proposition 3.1]). Let us return to the setting of Remark 2, where we we hypothesized that Z-rotations were less expensive to implement in hardware than Y-rotations, and were thus led to study a decomposition of a single-qubit operator U into the form U = Z ε Y ζ Z η . Let us now further suppose that the supply of Y-rotations is limited: we are only able to implement those whose parameters are drawn from a fixed set. We would then be interested to know, given a program U with canonical decomposition what are the conditions on ζ such that U admits expression as with α and δ drawn from the fixed set of parameters? To address this, we study the characteristic polynomial of the Cartan double γ Q 1 (U ), as computed from the canonical decomposition of U and from its putative expression as a circuit with constrained Ys: tr(γ Q 1 (U )) = 2(cos α cos δ − cos β sin α sin δ), tr(γ Q 1 (U )) = 2 cos ζ, hence ζ = cos −1 (cos α cos δ − cos β sin α sin δ) .
The role of β is thus to modulate the interference of α and δ, and it imposes the following linear inequality on ε: However, the precise dependence of ζ on β is decidedly nonlinear. 10 Example 16. In extremely favorable situations, the two-qubit case can also be manually analyzed. Let us consider the gate family , and let us consider the instance of Problem 10.1 for E = SWAP t 1 and F = SWAP t 2 . Using the reduction to Problem 12, we will describe the possible spectra for operators of the form where D 2 t j is the diagonal matrix formed from the spectrum of γ Q (SWAP t j ) and V is an arbitrary unitary.
Our first observation is that the eigenspace of weight exp(−i t j 4 ) of U j is 3-dimensional, and hence the intersection of these two eigenspaces for U 1 and U 2 is at least 2-dimensional. It follows that there exists an orthonormal 2-frame {b 1 , b 2 } of eigenvectors for U 3 : In particular, we find U 3 to be block-diagonal in this partial basis: no matter what full orthonor- in this basis. It will be convenient to choose the full orthonormal basis so that b 3 spans the complement of {b 1 , b 2 } in the 3-dimensional eigenspace for U 2 and b 4 spans the 1-dimensional eigenspace. In this basis, the subblock governing the action of for some auxiliary unitary matrix W . The resulting operator spectra are shifts by λ −1 of those those studied in Example 15, hence subject to the same inequalities also shifted by λ −1 . 11 We now turn to the vocabulary needed to enunciate the full solution to Problem 12.1 given by Agnihotri, Meinrenken, and Woodward. Based on our experience with the linear inequality families above, there is a particular presentation of operator spectra which we are likely to find useful: Definition 17 (cf. [25,Chapter 4]). For a special unitary matrix U , we may uniquely present its spectrum LogSpec U = (a 1 , . . . , a n ), where a 1 ≥ · · · ≥ a n ≥ a 1 − 1, a + := j a j = 0.
We refer to the collection of all such n-tuples as A, the fundamental alcove of SU (n), and we will write LogSpec U for the associated point in A.
The above definition is standard for special unitary matrices, but we will also require the following nonstandard modification: 12 and let U ∈ SU (4)/C 2 be a member of the quotient group, which we may present as a coset {Ũ , −Ũ } ⊂ SU (4). 11 We leave it to the reader to imagine how complex the elementary analysis of the generic case (i.e., without degenerate eigenspaces) can become. 12 One could make a similar definition for SU (n)/Cm with m | n, but we will need only this particular case.
The logarithmic spectra of these matrices are related by a form of rotation: By appropriately picking either LogSpec U = LogSpecŨ or LogSpec −Ũ , we see that we may uniquely specify a sequence LogSpec U which further satisfies either where (LogSpec U ) j denotes the j th component of the quadruple LogSpec U . We similarly refer to the collection of all such quadruples as A C 2 , the fundamental alcove of SU (4)/C 2 .
Remark 19. Definition 17 is the natural target of the logarithmic spectrum of a special unitary operator, and it forms a convex polytope. Definition 18 is useful because it is the natural target of the logarithmic spectrum of the Cartan double of a projective unitary operator: However, it does not quite form a convex polytope: the closure A C 2 is a convex polytope, but the values a * satisfying a 3 + 1/2 = a 1 and a 4 + 1/2 > a 2 , which constitute half a face of A C 2 , are missing from A C 2 .

Definition 20.
In line with the program outlined above, we will be especially interested in the assignment which we abbreviate to Π(U ).
Definition 21. The extremal points of the polytope A C 2 lie at the following coordinates: The subspace A C 2 of A C 2 is given by deleting the subspace of convex combinations of e 2 , e 3 , and e 6 in which e 6 carries a nonzero coefficient.

Definition 22.
For r, k > 0 be positive integers, let Q r,k denote the following set of sequences: We are now in a position to state the solution to Problem 12.1. We will give a more complete exposition of this result, its context, and its proof in Appendix A, but for our intended application we need only the following statement: be the associated logarithmic spectra.
Select r, k > 0 satisfying r + k = n, select a, b, c ∈ Q r,k , and take d ≥ 0 so that the associ- Figure 14 and Figure 3) satisfies N c,d ab (r, k) = 1. The following inequality then holds: We define the monodromy polytope (for SU (n)) to be the polytope determined by all such inequalities.
Conversely, given alcove sequences α * , β * , δ * which belong to the monodromy polytope, then Before proceeding to use this result in any complex way, we show how it can be used to recover the contents of Example 15. 13 Example 24 (cf. Example 15). In Figure 3, we provide a table of quantum Littlewood-Richardson coefficients relevant for P U (2). Coupling these to Theorem 23 then gives the following family of inequalities: or, in terms of α 1 , β 1 , δ 1 ≥ 0 alone, The resulting polytope is portrayed in Figure 4. Isolating δ 1 -or, equivalently, studying a vertical ray in the Figure above a particular choice of (α 1 , β 1 )-yields A geometrical interpretation of this restriction is shown in Figure 5.
In our study of two-qubit programs, we have already announced the importance of the composite and we will accordingly want to employ a variant of Theorem 23 that applies to SU (4)/C 2 .  Corollary 25 (cf. Remark 80). Theorem 23 holds for SU (4)/C 2 , under the condition that the indicated family of inequalities all simultaneously hold either for δ = LogSpec U 3 or for δ = ρ(LogSpec U 3 ).
Proof. If U 1 , U 2 , and U 3 are elements of SU (4) such that U 1 U 2 ≡ U 3 in SU (4)/C 2 , then there is some j so that U 1 U 2 = (−1) j U 3 as elements of SU (4). If j is even, then Theorem 23 applies directly to give the same statement. If j is odd, then Theorem 23 applies with U 3 replaced by −U 3 , which has the effect of replacing δ by Additionally, not only do Theorem 23 and Corollary 25 resolve Problem 10.1, but its form is sufficiently polite that we can also bootstrap it into a solution to Problem 8.1: Corollary 26. Let S be a gate set whose image through Π is a (finite) union of convex polytopes. The image of P n S through Π is then also a (finite) union of convex polytopes.
Proof. We have assumed the base case: Π(P 1 S ) is a union of convex polytopes. Assuming that Π(P n−1 S ) is a union of convex polytopes, each constituent polytope is described by a finite collection of linear inequalities. The monodromy polytope is itself also described by a finite collection of linear inequalities. Select polytope constituents of Π(P 1 S ) and of Π(P n−1 S ). By imposing those linear inequalities describing the constituent of Π(P 1 S ) on the first coordinate, imposing those linear inequalities describing the constituent of Π(P n−1 S ) on the second coordinate, and using Fourier-Motzkin elimination to project to the final coordinate, we produce a subset of Π(P n S ) which is described by a finite collection of linear inequalities. It follows that this too is a convex polytope, and the entire set Π(P n S ) is the union of the convex polytopes formed in this way.
Remark 27. For gate sets S of interest to us, it is often the case that S appears as a subset of P 2 S . This condition entails the nesting properties P n S ⊆ P n+1 S and Π(P n S ) ⊆ Π(P n+1 S ) for n ≥ 2.

Definition 28.
Recall from Definition 9 the gate set quality metric L S Haar . By Corollary 26, we now know the sets Π(P n S ) to all be unions of polytopes, which have easily calculable volumes. Inspired by this, and using the fact that L S is constant on fibers of Π (i.e., Corollary 5), we propose the following alternative definition: where vol A C 2 indicates the Euclidean volume as a subset of the polytope A C 2 , normalized so that A C 2 itself has unit volume. These are not generally equal: their difference is mediated by the Jacobian of Π, considered as a function on the subset of canonical gates, as well as the sizes of the fibers of Π. The quantity L S Haar has the advantage of capturing a more traditional notion of average, but L S A C 2 has the advantage of being reliably computable by finite means.
Due to their similar definitions, it is often the case that we can make claims about both quantities simultaneously. In these situations where we intend to make a statement about both, we will omit the superscript.

Monodromy polytope slices for the standard gates
In this section, we consider the "standard gates" that appear in the paper of Smith, Curtis, and Zeng [46, Appendix A] and their effect as members of a native gate set. Each of these gates or gate families specify via Π either a particular point in A C 2 or a line segment in A C 2 , which in either case can be specified via a family of linear inequalities. By consequence of Remark 27, the space of programs which are accessible via circuits of native gates of a fixed depth then appears as a projection of linear slice of the monodromy polytope. Our goal is to give descriptions of these projections.

The CZ gate
The sets Π(P 0 CZ ) and Π(P 1 CZ ) are singletons and hence automatically convex polytopes: In order to compute Π(P 2 CZ ), we intersect the polytope described in Theorem 23 with the six hyperplanes describing the conditions α * = e 2 and β * = e 2 : Lemma 29 (cf. [43,Proposition III.3]). The convex polytope Π(P 2 CZ ) is described by The extremal points of Π(P 2 CZ ) are {e 1 , e 2 , e 3 }, with circuit realizations given in Figure 16.
Proof. Using the quantum Littlewood-Richardson coefficients we apply Theorem 23 to deduce the inequalities Because of the additional constraint δ + = 0, we learn that these nonnegative quantities are in fact exactly zero: This plane passes through three of the extremal vertices of A C 2 , hence Π(P 2 CZ ) is contained inside of the triangle formed as the convex hull of those three vertices. In order to show that this inclusion is actually an equality, we need only produce witnesses that these three points have preimages in P 2 CZ . One checks that the circuits described in Figure 16 do the job: not only do they image to the appropriate vertex under Π(−), but the mirroring value j in Theorem 23 is not used, so that these vertices belong to the same polytope. Hence, their convex hull is as claimed.
Remark 30. One can avoid divine inspiration by instead producing the entire family of inequalities of Theorem 23, adding the equalities coming from our selection of α * = β * = Π(CZ), optionally pre-reducing the system, calculating all of the points of triple intersection, and throwing out those points which do not satisfy the original family of inequalities. This will, ultimately, produce the same set of extremal points. While this has the benefit of being mechanical, it is quite arduous-and it does not produce the realizations of the extremal points as circuits.
The briefest method for accessing P 3 CZ follows along identical lines: if we can show that the extremal vertices of A C 2 have realizations within Π(P 3 CZ ) and we are allowed to apply convexity, then we can conclude the following equality: with circuits realizing the extremal points given in Figure 17.
Proof. It is automatic that we have Π(P 3 CZ ) ⊆ A C 2 . In order to show the opposite inclusion, we need to supply the necessary realizations (with the necessary mirroring property, as in the proof of Lemma 29). One may check directly that the circuits in Figure 17 will do.
Remark 32. There is also the following alternative approach that mimics the alternative approach to P 2 CZ . By intersecting the full polytope described by Theorem 23 with the family of inequalities which constrain α * ∈ Π(P 2 CZ ) and with the equality which constrains β * = Π(CZ), we arrive at a convex polytope contained in A C 2 × * × A C 2 . Using Fourier-Motzkin elimination to delete the first factor yields Π(P 3 CZ ) by projection to the last factor. This, too, is completely mechanical but is even more arduous.
Remark 33. In order to explain the provenance of the first three circuits in Figure 17, we remark that Lemma 29 shows that CZ ∈ P 2 CZ , and hence we are led to the method suggested by Remark 27. Beginning with the realization of the extremal vertex e 2 ∈ Π(P 2 CZ ), we need only solve for the outer local gates to realize CZ exactly, as in: Using this formula, we may inflate the other realizations of the extremal vertices of Π(P 2 CZ ) into realizations in Π(P 3 CZ ) by substituting the above circuit for CZ in for, say, the left-hand CZ supplied in Lemma 29. The realization supplied for the fourth extremal vertex is a rephrasing of the usual expression of SWAP as a triple of alternating CNOTs, and the fifth we produced by numerical search.
Remark 34 ([45, Proposition V.1]). Critically for quantum compilation, a circuit realization for any point within Π(P 3 CZ ) can be exactly produced algorithmically. The circuit proposed by Shende, Markov, and Bullock is where a, b, and c are certain linear functions of α, β, and δ. In general, exact decompositions do not seem to exist (cf. Remark 62 for a basic such result), and even numerical methods pose a challenge (cf. Section 7).

The iSWAP gate
Now we prove analogous results for the gate set S = {iSWAP}. We will be briefer in the aspects that exactly mimic those for the gate CZ.
Proof. This proof entirely mimics that of Lemma 29, but this time the relevant quantum Littlewood-Richardson coefficients are Moving on to P 3 iSWAP , we have Proof. Again, the proof is almost identical to that of Lemma 31, beginning with an exact realization of iSWAP ∈ P 2 iSWAP by solving for the outer local gates in the realization of e 3 ∈ Π(P 2 iSWAP ): Using this, we can inflate the left-hand iSWAP in the realizations of the extremal vertices in Lemma 36 to produce realizations of those same vertices in Π(P 3 iSWAP ). What remains is to produce realizations of the extremal points SWAP and √ SWAP, where we rely on a standard decomposition.
Remark 38. Combining the results above with those from the previous subsection, we conclude Corollary 39. The expected circuit depth for iSWAP is L iSWAP = 3.
As in the case of CZ, the compilation problem for iSWAP (i.e., Problem 10.2 and its depth-three variant) admits exact solutions. This does not appear to be in the literature, and so we include an analysis here: Proof. This is checked by direct computation. One may ease the computation somewhat by noticing that conjugation by X π 2 ⊗ X π 2 diagonalizes the operator.
Remark 41 (cf. [43,Proposition V.2]). Our strategy for algorithmically producing circuits for points in P 3 iSWAP will be to isolate the troublesome extremal vertex e 4 . Once this vertex does not contribute to the remaining convex linear combination, the remainder is solved by Corollary 40.
Selecting a gate U ∈ P U (4), we seek local gates A and B so that U, A, B)) ∈ Π(P 2 iSWAP ). We apply Lemma 36 to see that this is accomplished by finding values of A and B so that tr γ Q (V (U, A, B)) is real. It turns out that we may take A = Y σ and B = 1, which we see by manual calculation: where we have interpreted the indices modulo 4. In particular, this summation formula enables us to solve the equation by picking a value of σ so that tan σ agrees with Because the tangent function is surjective, there is always such a value.
As one remaining case of interest, we can also describe the collection of gates accessible to a gate set that has both CZ and iSWAP available: iSWAP,CZ ) is the union of Π(P 2 iSWAP ) and the convex polytope which has extremal vertices {e 2 , e 3 , e 4 }.

Corollary 43.
The expected depth for the gate set with CZ and iSWAP is L CZ,iSWAP = 3.
Remark 44. The metrics L S capture the efficacy of S at encoding random two-qubit programs, but programs appearing "in the wild" (as well as sub-programs appearing as components in decompositions) are not random: the program SWAP ∈ P U (4) is a prime example of an uncommonly important two-qubit interaction. Although the equation indicates that there is no salient difference between these different gate sets from the perspective of random programs, indicates that there is an important difference from the perspective of structured programs.
This gate set also admits algorithmic decomposition, which one may verify by direct calculation: there are two entries satisfying Setting α = (δ i + δ j )π and β = (δ i − δ j )π, we then have

The CPHASE and PSWAP gate families
As further demonstration of these techniques, we also consider some combinations of the parametric two-qubit gates which appear in the Quil standard gate set [46].
Proof. The proof is identical to that given for Lemma 29: the same quantum Littlewood-Richardson coefficients impose the same symmetry relation on Π(P 2 CPHASE ), and the reverse inclusion then follows from P 2 CZ ⊆ P 2 CPHASE .
Example 49. As an exercise in the application of these methods, we provide an analysis of the polytopes associated to √ CZ = CPHASE π 2 . Since √ CZ · √ CZ = CZ, we can deduce immediately from Corollary 35 (i.e., from previously known methods) that L √ CZ ≤ 6. Coupling our methods to the software lrs [4,5], we enumerate the vertices of the sets Π(P n √ CZ ) for n ≤ 5 in Figure 20, as displayed in graphical form in Figure 6. These yield the exact calculation a considerable improvement over the naive estimate.
The gate PSWAP is not natively available on charge-coupled superconducting hardware, so we do not explore it very thoroughly here, but for completeness we at least include a calculation of P 2 PSWAP . Lemma 50. P 2 PSWAP agrees with the other depthtwo sets studied so far: Proof. This proof proceeds similarly to that of (2,1)(2,1) (2, 2) = 1, and Π(PSWAP 2πt ) is calculated to be An application of Theorem 23 yields inequalities which enforce the same symmetry conditions on Π(P 2 PSWAP ) as in the previous Lemmas. Because we have P 2 iSWAP ⊆ P 2 PSWAP , we may conclude equality.
Corollary 51. The expected circuit depth for PSWAP is L PSWAP = 3.

Monodromy polytope slices for the XY-family
Combining the ideas which motivated iSWAP and CPHASE, we are also motivated to con- sider the one-parameter family of native twoqubit gates given by This family is interesting for a few reasons: it is one of the only 14 remaining "edges" of A; it can arise naturally as a gate natively available to systems where iSWAP is available, as in [10]; and it itself belongs to the canonical family.
Having noted that XY α belongs to the canonical family, we may compute its associated diagonal coordinates to be In pursuit of an analogue of the results of Section 4.3, we can perform an analysis of the polytope Π(P 2 XY ). The computation is much more involved, but we are rewarded with the following theorem: Theorem 52. The set Π(P 2 XY ) is the union of the polytopes with extremal coordinates as specified in Figure 21. The set Π(P 3 XY ) is the entire solid Proof. We compute along the lines of Remark 30: we intersect the monodromy polytope with the hyperplane equations specifying that the first coordinate take the form (α 1 , 0, 0, −α 1 ) and that the second coordinate take the form (β 1 , 0, 0, −β 1 ); then we apply Fourier-Motzkin elimination to project to the third coordinate; and finally we feed the resulting system to the software package lrs [4,5]. Altogether, this results in the vertex sets listed above.
14 The other remaining edge is the ray connecting I to SWAP, but we addressed this in Example 16. Corollary 53. In particular, Π(P 2 XY ) is of positive volume. More precisely, we compute the expected gate depth for XY to be 15 Remark 54. As an interesting aside, SWAP lies outside of this polytope.
Our main observation is that XY enjoys a property that none of the other gate sets have thus far: P 2 XY is top-dimensional or, said otherwise, has positive volume. In the CPHASE family, we found in Lemma 46 that P 2 CPHASE had zero volume, from which we can also conclude that P 2 CPHASEα has zero volume for every fixed of α, including CPHASE π = CZ (cf. Lemma 29). We here pursue the corresponding question of whether there are any fixed values of α for which P 2 XYα has nonzero volume. 16 In the event that such slices exist, we can ask an additional question: which particular values of α maximize the volume of the slice?

Proof.
Because the finite family of inequalities determining Π(P 2 XYα ) are linearly dependent in α, the curve vol Π(P 2 XYα ) is piecewise cubic in α. One can use this fact, together with sampling [32] and interpolation techniques, to determine a formula for vol Π(P 2 XYα ): as depicted in Figure 8. From this curve, we may directly determine its maximum value. Remark 57. Similarly, one may compute Π(P 3 DB ) = A C 2 , from which we conclude In fact, Π(P 2 XY π/2 ) ∪ Π(P 3 XY π/2 ) = A C 2 , so that Remark 58. In Figure 9, Figure 10, and Figure 11, we illustrate the solids Π(P 2 XYα ) for varying values of α, where we have projected onto the last three coordinates and shaded A C 2 red. We record here (but do not prove) some interesting observations about the solids. First, for 17 Dagwood Bumstead is a comic strip character famous for making really big sandwiches. XYα ) ⊆ Π(P 2 XY α ), from which it follows that vol Π(P 2 DB ) ≥ vol Π(P 2 XYα ) for any 0 ≤ α ≤ 3π/4 as in the Theorem. However, for 3π/4 ≤ α < α ≤ π, neither of Π(P 2 XYα ) and Π(P 2 XY α ) is contained in the other: although Π(P 2 XYα ) continues to lose volume as α approaches π from the left, the solid also continues to pick up "new" two-qubit programs as it shrinks.
It is then of further interest to give a precise description of the polytope Π(P 2 DB ). Lemma 59. Π(P 2 DB ) is a union of two convex polytopes, respectively described the following two families of inequalities: intersected with the fundamental alcove. The extremal points can be found in Figure 22.
Proof. Here we follow the method espoused by Remark 30. The family of inequalities comes directly from reducing the family supplied by Theorem 23.
After calculating all of the points of intersection of the associated equalities and discarding those intersection points which do not satisfy all of the inequalities, the remainder is the set of extremal vertices, as listed above.
Remark 60. The polytope Π(P 2 DB ) is pictured from three angles in Figure 12.
Remark 61. For the interested reader, we also include as Figure 13 a depiction a numerical sampling of vol Π(P 2 X ) as X ranges over (the facets of) the entire monodromy polytope. Points shaded black correspond to those values of X for which vol Π(P 2 X ) is at 0% of the total volume, and points shaded white correspond to 100% of the total volume. In the middle figure, the heat values along the line connecting the westernmost point, labeled I, to the center point, labeled iSWAP, correspond to the graph depicted in Figure 8.
Remark 62. In the course of our analysis of L XY A C 2 , we have avoided giving an effective compilation routine for P 2 XY along the lines of Remark 34 for P 3 CZ . Indeed, one can show under mild hypotheses that such a formula cannot exist. The canonical family forms a 3-dimensional maximal torus in P U (4), but the maximal tori in P U (2) ⊗2 are merely 2-dimensional. It is therefore impossible for any gate S ∈ P U (4) to conjugate a family of local gates onto the canonical family. If S † is additionally locally equivalent to S, then this means that any analogue of Remark 34 for P 2 S must instead be of the form where the outer gates A, C, D, and F are not all constant in the parameters α, β, δ. In practice, it seems that B and E cannot be made linearly dependent on the canonical parameters either, though we do not presently have a proof of this to offer.

Approximate compilation
We now use the above descriptions of the polytopes Π(P n S ) to address the problem of approximate compilation: Problem 63. Given a two-qubit program U and a gate set S whose members S ∈ S have associated fidelity estimates f S , what circuit drawn from S gives the greatest fidelity approximation to U ?
For instance, in this specific setting of S = {CZ}, Lemma 31 shows that every such U can be written as a circuit involving three applications of CZ, whereas Lemma 29 shows that almost no U can be decomposed exactly using just two applications of CZ. Nonetheless, if there is an associated cost to each application of CZ, it may be preferable to deliberately "miss" U (and thereby incur deliberate error) if it affords an opportunity to avoid applying CZ a third time (and thereby avoid indeliberate error). This idea of approximate compilation is not a new one [11, Appendix B], and we begin by recalling some useful results.
Definition 64 ([38], see also [39]). Given a pair of two-qubit programs G and G , we define their average gate fidelity to be Because this comes down to a trace calculation, this value is especially easy to calculate for simultaneously diagonalizable gates, which includes pairs of canonical gates after conjugation by Q: CAN(α, β, δ) and G = CAN(α , β , δ ) be two canonical gates with parameter differences Their average gate fidelity is given by In pursuit of Problem 63, we are also interested in the effect of local gates on Lemma 65. Rewriting the trace in terms of Q-conjugates, we have where D 1 = (C † ) Q and D 2 = (C ) Q are diagonal gates and O 1 = (L † 1 L 1 ) Q and O 2 = (L 2 L † 2 ) Q are orthogonal gates. Letting L 2 and L 2 range, we see from Corollary 14 that we are maximizing a quadratic functional over the monodromy polytope slice associated to D 1 and D 2 . Mercifully, one need not employ this heavy machinery to solve this optimization problem: Lemma 66 ([47, Section III.A]). Suppose that C 1 , C 2 are fixed canonical gates and that L 1 , L 1 are fixed local gates. Letting L 2 and L 2 range over all local gates, the value F avg (L 1 C 1 L 1 , L 2 C 2 L 2 ) is maximized when taking L 2 = L 1 and L 2 = L 1 .

Corollary 67. The spectrum of the gate which gives the best approximation to a two-qubit unitary U depends only on Π(U ).
By combining these results to our descriptions of Π(P n S ) for our preferred gate sets S, we produce the following protocol for approximate compilation. In the following, we take S to be a gate-set with the nesting property of Remark 27 and U to be a two-qubit program to be compiled.
1. Calculate the canonical decomposition associated to U : U = LCL .
3. Use Π(U ) to calculate the point δ n * ∈ Π(P n S ) which maximizes F avg (U, −). Multiply this maximum value by f n S . 18 4. Is this fidelity value smaller than the previous fidelity value? If not, increment n and try Step 3 again. Otherwise, proceed to Step 5.

Find a realization R of δ n−1 *
with canonical decomposition R = L approx · C approx · L approx . 18 We are using f n S as an approximation for the fidelity of the depth n circuit. However, as fidelity is not multiplicative, there is considerable room for the implementer to express their own preference here.

Return
The first half of the protocol depends only on the structure of the polytopes Π(P n S ), from which we may conclude the following result: Proof. This is a direct consequence of coupling the above ideas to Lemma 50.
Remark 69 ([11, Appendix B]). Finding the nearest point in P n S to an arbitrary outside point is numerically accessible, but it does not seem to admit a closed-form solution in general. An exception is the case of P 2 CZ , where the nearest canonical gate to CAN(α, β, δ) is CAN(α, β, 0).

Open questions
In closing the main thread of the paper, we list some follow-on projects where one would expect to find interesting results.

Algorithmic effectiveness and circuit realization
The single most important avenue left open by this work is the actual manufacture of a circuit in P 2 S from a point in Π(P 2 S ) (i.e., Problem 8.2), which we refer to as the realization problem.
Edelman et al. have presented a specialization of Newton's method on a curved Riemannian manifold to the orthogonal group with its natural metric [14]. If one were able to provide approximate solutions to the realization problem, such an algorithm could be used to rapidly increase the accuracy of such a solution-but without approximate solutions, such methods have no guarantee of convergence. 19 Additionally, this method would require foreknowledge of the gates D E and D F in Problem 11, limiting its applicability in parametric settings such as P 2 XY . From the perspective of Appendix A, a solution to the monodromy problem corresponds to a flat connection on the trivial P U (4)-bundle over a punctured Riemann sphere with prescribed monodromy values. The data of an arbitrary connection is easier to describe: it assigns to each path an element of P U (4) via parallel transport, perhaps with some further smoothness conditions. Rade's thesis [40] analyzes the Yang-Mills flow from an arbitrary such connection (with boundary conditions) to a flat representative, and for generic connections its convergence is rapid. One might therefore try to discretize the punctured Riemann sphere and apply a numerical variant of Rade's method. It is not immediately clear, however, how one would introduce the orthogonality constraints present in Problem 11 [16].
Cole Franks et al. [17,9] have described effective numerical methods for solving the additive analogue of the eigenvalue problem. One might explore multiplicative variations on their methods (especially those with the orthogonality constraint kept in mind) which would then adapt to solve the problem posed here.
A separate concern of algorithmic effectiveness is the taming of the exponential upper bound on the size of the family of inequalities coming from Corollary 26. In practice, this bound appears to be a gross overestimate, and we are optimistic that a polynomial bound is possible. As an aside, one of the advantages of Belkale's analysis of the monodromy polytope [6] over that of Agnihotri and Woodward [1] is that his set of inequalities is minimal-so similar considerations have already been taken up by the progenitors of the results shown here. 19 In the particular case of P 2 XY , M. Scheer has pointed out to us the commutation relation [XX + YY, ZI + IZ] = 0, from which it follows that the group of interest can be reduced from P O(4) to a particular four-dimensional subset. However, this subset is not closed under multiplication, which hinders the translation of the methods of Edelman et al.

Alternative interpretations of "optimum"
The particular metric by which we measured the utility of DB over other instances of XY α was the volume of the polytope Π(P 2 DB ). It is not clear that this is the best such metric (nor that there is a best). Here we list some alternative metrics that seem worth exploring.
Firstly, is there a value of α for which the average (or worst) value of average gate infidelity is minimized? Against this metric, an "elliptical" polytope may be more valuable than a "spherical" one. This analysis may also change when considering other approximation metrics than average gate infidelity, e.g., diamond distance.
The Haar volume (or, indeed, most any other natural volume) of a subset of P U (4) is not perfectly related to the volume of its image as a subset of A C 2 . For any such volume vol on P U (4), it would also be of interest to maximize the analogous function vol P 2 XYt over t. (For the Haar volume, it appears that the maximum remains at α = 3π/4, but we do not have a proof that this is so.) Another discrepancy that is worth illuminating is the change-of-coordinates formula comparing L S Haar and L S A C 2 . These integrals vary at least by the Jacobian of Π, considered as a function on the canonical subgroup, which would already be worth computing.
It would also be of interest to understand the local behavior of any of these metrics with respect to small distances in P U (4). This is the domain of coherent unitary error, and one might hope to leverage some of the results of this paper to tailor a compilation method for a coherently errorprone device. Preliminary inspection of this for P 2 CZ indicates that derivatives conspire so that only large coherent unitary error gives rise to significant gain in volume.
Any more nuanced tracking of error has the potential to alter the analysis in Section 6. In particular, separate tracking of unitary and nonunitary error is very likely to affect the outcome of the protocol described there.
C. Iancu has observed that potential native gate-sets are typically not uniform in quality: for instance, on certain hardware architectures it could be the case that √ CZ takes half as long (and hence suffers half as much performance degradation) as CZ, so that the "performance metric" of expected gate depth ought to be reweighted by an appropriate factor coming from the performances of the gates involved. Indeed, in this toy example, one finds contrary to the apparent loss in gateset quality considered in Example 49.

Unexplored polytopes
The material presented here amounts to a toolkit for analyzing the space of programs available to a given native gate set. We have used this as incentive to investigate a particular native gate set because of its depth-two behavior and its relevance to a particular sort of hardware, but this is hardly the only option. As part of the project of exploring the structure of the space of gatesets, it would be of interest to describe those native gate sets S which enjoy Π(P 2 S ) = A C 2 . This set is nonempty, as the B-gate has this property. Are there other singletons? Other finite sets? Other exponential families? Figure 13 could probably be smoothed using the same interpolation techniques as in Theorem 55, yieliding an explicit piecewise formula for vol A C 2 (P 2 S ) as S ranges over the entire solid. The hardware employed by Rigetti is not the only option, and one could re-run this same analysis for other designs. As an example, calculating the subspace of programs efficiently available to Google's fSim gate would likely be a pleasant exercise in these techniques.
The methods of this paper may also bear indirect fruit at higher qubit counts. For example, Wei and Di [48] have given a CZ-based circuit decomposition for operators in the subgroup P O(8) which improves over the best known general such circuit decomposition for operators in P U (8). They leave open the full reach of their result: namely, the local equivalence class of P O (8) within P U (8) belongs in the middle of the chain of inclusions and their techniques continue to apply to this middle term. However, its structure is unknown, save that P O(8) is generically of codimension 12 within it. Preliminary application of our techniques in this context shows that this local equivalence class is detected within P U (8) by a set of linear constraints on the logarithmic spectrum, as well as some further constraint phenomena for which we are unable to account. Giving concrete descriptions these remaining constraints would greatly widen the applicability of the techniques of Wei and Di.
Recent work by Glaudell, Ross, and Taylor leverages the accidental isomorphism SU (4) ∼ = Spin(6) to produce circuit decompositions into a certain discrete gate set [19]. One might wonder whether the methods described here interact usefully with this alternative presentation of twoqubit operations.

Leakiness
The analysis of "leaky gates" in Appendix B is not as thorough as it might be.
Here are some open questions and problems concerning that property: • In Remark 89, we argue that within the local equivalence class of a leaky entangler, there is one where the single-qubit gates involved in the leakiness relation are all Z-gates. However, their parameters may depend on each other in a nontrivial way. Give a description of the possible ways this can happen. The exponential family SWAP α (i.e., the (α/π) th root of SWAP) is probably of interest here.
• Every given example of a leaky gate is leaky on both coordinates. Is this always the case?
• Every given example of a leaky gate has a representative in its local equivalence class with it transpose-symmetric. Is this always the case?
• Our best guess is that the subspace of leaky entanglers coincides exactly with the edges of A C 2 . Is this true?
Davis deserves special credit, as he finally put us on the right path to move from numerical experiment to mathematical proof, and this project might not have come together if not for his crucial advice. Although W. Zeng had been suggesting that we think about approximate compilation for some time, Section 6 is a direct result of A. Javadi-Abhari's very pleasant talk at IWQC 2018. S. Lin helpfully brought to our attention a cascade of mistakes in a previous version of this paper. We additionally had the pleasure of speaking with the mathematicians W. C. Franks, B. Gammage, S. Kumar, E. Lerman, S. Lichak, P. Solis, C. Teleman, R. Wentworth, and C. Woodward, who freely offered their consultation and expertise on matters related to the monodromy polytope. The first author would like to note the indirect but invaluable role that his PhD adviser, C. Teleman, played in this project: the material presented here is much closer to Teleman's domain than the first author's thesis ever was, and acquiring the working knowledge to complete this project would have been much harder without a steady exposure to these ideas over the years. An additional hearty thank you goes to R. Bryant for teaching the first author most of what he knows about Lie theory (and from the second author to the first for the same reason). Finally, the anonymous referees enormously improved the quality of this paper and kindly pointed out a goodly number of errors, for which we are very grateful.
A new proof of a theorem of narasimhan and seshadri. J. Differential Geom., 18 (2)

A The mathematics of the monodromy polytope
In this appendix, we produce some of the details (or, failing that, some soothing exposition) of the mathematics underlying our results in the main text. This effort cleaves into two parts: some generic convexity results in symplectic geometry that give the qualitative solution to the multiplicative eigenvalue problem (and which merit the name "monodromy polytope"), followed by some results around quantum cohomology that give the quantitative solution.

A.1 Qualitative results
Before getting involved with the multiplicative eigenvalue problem directly, we first give a slightly ahistorical account 20 of a generic qualitative result found in symplectic geometry.
Definition 71. A symplectic manifold M is an oriented 2n-manifold equipped with a choice of symplectic form ω, i.e., an n th root of the volume form (or, equivalently, an everywhere nondegenerate 2-form).
Example 72. Examples of such objects are rife in physics: all phase spaces are instances of symplectic manifolds. For an ultra-simple but ultra-concrete example, we might take M = T * R = R 2 with the symplectic form ω = dp ∧ dq, or more generally M = T * R d = R 2d with ω = j dp j ∧ dq j . These arise as the phase spaces associated to d many non-interacting simple harmonic oscillators. In general, a symplectic manifold has this as its local form.
Definition 73. Given an action on a symplectic manifold M by a Lie group G (so that τ * g ω = ω), a moment map is a G-equivariant function Φ : M → g * , where the target carries the coadjoint action.
Example 74. Again, examples of such objects are rife in physics: a nontrivial gauge group gives rise to a G-action on a phase space, and a moment map can be used to describe a G-invariant physical quantity, such as the total energy of a system. In the above example, G = S 1 acts on R 2 by rotation, and the associated Lie algebra g * can be identified with R in such a way that a moment map is given by Φ(v) = 1 2 |v| 2 . Similarly, the d-torus G = (S 1 ) ×d acts on R 2d by rotations of the component planes, and there is an associated moment map R 2d → g * ∼ = R d which sends each particle to its total energy.
A useful tool for manufacturing these objects comes in the form of the following theorem: • (Atiyah [2], Guillemin-Sternberg [20,21]:) Suppose that G = T is a compact torus, and let A be a choice of fundamental alcove within t * . The restriction of the image of Φ to A then forms a convex polytope.
• (Kirwan [27]:) Suppose that G is compact, let T ≤ G be a choice of maximal torus with corresponding dual Cartan subalgebra π : g * → t * , and let A again be a fundamental alcove within t * . The restricted set A ∩ im(π • Φ) is a convex polytope. 20 The solution to this problem is strongly coupled to the solution of the corresponding "linearized" problem: given Hermitian matrices H1 and H2, what spectra can possibly arise as that of AdU 1 H1 + AdU 2 H2 for unitary operators U1 and U2? A conjectural solution to this problem was set out by Horn [24], which spurred the development of a great many results in symplectic geometry and representation theory in an effort to explain his findings, and these tools were ultimately used by Klyachko [28] to settle the matter. Knutson [29] gives a very pleasant overview of this body of work and its surroundings, and although he does not address the multiplicative problem, (generalizations of) these same tools reappear in this context. We intend the word "ahistorical" only in the sense that the tools were developed in response to the visible behavior of the (additive) eigenvalue problem, whereas our exposition presents the tools as generic ideas which we then apply post facto to the eigenvalue problem-a significant misrepresentation of history.
• Theorem 3. Remark 77. The most basic of this chain of results is somewhat believable: in Example 74, the image of the moment map is the positive orthant in t * . Since a general symplectic manifold is constructed locally from that example, the image of a general moment map is constructed locally out of such "corners"-though amplifying this to an equivariant statement (and then to the nonabelian setting) is no trivial feat. The final form of the theorem is considerably harder to visualize, but it is the version that will concern us chiefly.
Example 78 ([3, p. 587], [13]). We focus our attention on an example that physicists may recognize as an instance of Yang-Mills theory. Let G be a compact, connected, simply-connected Lie group (e.g., SU (4)), let Σ be Riemann sphere with b disks excised, and let P be the trivial principal G-bundle over Σ. The space A(Σ; g) of g-valued connections on P may be identified with Ω 1 (Σ; g), and it can be shown to carry the structure of a symplectic manifold using the Atiyah-Bott symplectic form This carries a compatible action by the gauge group G(Σ) of sections of P (i.e., G-valued continuous functions on Σ), which has Lie algebra Ω 0 (Σ; g), and this action moreover admits a moment map Φ AB determined by where F A is the curvature form associated to A and ι : ∂Σ → Σ is the inclusion of the boundary components. Writing G ∂ (Σ) for the term in the kernel sequence is a convex polytope.
Construction. We set Σ = CP 1 \ {1, 2, 3} and G = SU (4), then apply Example 78 to conclude that M (Σ) is a symplectic G-manifold with associated moment map A → ι * A. Fix the following auxiliary data: • Parametrizations B j : S 1 → Σ of the j th boundary component.
• Paths γ j : B 1 (0) → B j (0) begetting loops b j = γ −1 j B j γ j which have the property The loops are commonly assumed to have a further technical property-for instance, some degree of differentiability.
To these data, a connection A associates elements B * j A ∈ Lg * , the local behavior of A near B j , and elements Γ(A, γ j ) 1 0 ∈ G, the action of parallel transport along γ j from the (trivialized) fiber over γ j (0) to the (trivialized) fiber over γ j (1).
It is well-known that the moduli space of flat connections on a trivial G-bundle over a suitable Riemann surface Σ is weakly equivalent to the space of G-representations of π 1 Σ. The procedure for extracting such a representation is by sending a loop in the base to the monodromy of the connection around the loop. One may promote this idea from a weak equivalence into a commuting square with horizontal arrows equivariant symplectomorphisms: where the first horizontal arrow is defined by , the monodromy operator is defined by and the action of G(∂Σ) ∼ = LG 3 on the top-right corner is given by Granting this, we find ourselves at the doorstep of the multiplicative eigenvalue problem. Note first that the operator Mon enjoys two pleasant properties: 1. After using the Killing form to identify g * with the subspace g ⊆ Lg of constant loops, for h ∈ g we have Mon(h) = exp(h), the usual Lie exponential.
2. The G-action on ξ j is then arranged so that the following formula holds: Mon(g · ξ j ) = Ad g j (0) Mon(ξ j ).
These properties combine to give the required link. We apply Theorem 76: take A ⊂ t * to be real diagonal matrices whose entries obey the criteria set out by Definition 17. The image of the moment map then becomes those triples of diagonal matrices (ξ 1 , ξ 2 , ξ 3 ) ∈ A ×3 for which there exist unitary operators c 2 , c 3 satisfying e −2πiξ 1 = c −1 2 e 2πiξ 2 c 2 · c −1 3 e 2πiξ 3 c 3 . Remark 80. Throughout the paper, there are two Lie groups of interest: P U (4) = U (4)/C × , which participates in a nontrivial central extension 1 → C 4 → SU (4) → P U (4) → 1, and the double cover SU (4)/C 2 of P U (4), which also participates in a nontrivial central extension Neither is simply connected, a necessary hypothesis of Corollary 79, which we redress as follows. In general, we may consider compact connected Lie groups G whose universal cover G participates in a finite central extension The Lie algebras of G and G may be identified by π, and the image of the moment map Φ G considered in Corollary 79 is then given by the union over f ∈ F of the images of the moment maps Φ G,f , constructed analogously so as to detect products of the form

A.2 Quantitative results
We now turn to quantitative results: given that the solution set to the multiplicative eigenvalue problem forms a convex polytope, what polytope is it? As in the additive case, this problem passes through representation theory, and in the exposition about the qualitative problem we have already begun to make this contact: a flat connection on a trivial vector bundle is equivalent data to a representation of the fundamental group of the base, and flat connections modulo gauge equivalence correspond to representations up to choice of basis. Theorems of Narasimhan and Seshadri and of Donaldson show that this has a kind of converse: unitary representations of the fundamental group of a compact Riemann surface correspond to "stable" holomorphic vector bundles over the surface [37], and such bundles can be shown to admit a unique flat unitary connection [12]. A vector bundle V is said to be stable when its slope, µ(V ) = deg(V )/ rank(V ), decreases when passing to any subbundle. Informally, a stable bundle is "more ample" than any of its subbundles. However, our surface of interest, Σ = CP 1 \ {1, 2, 3}, is a noncompact Riemann surface. 22 Work of Mehta and Seshadri extends the above correspondence to the noncompact case: a parabolic bundle (on CP 1 ) is a holomorphic vector bundle E, a choice of finite set S ⊂ CP 1 , a choice of flag {E s,i } for each s ∈ S, and a family of weights λ s,i satisfying the strings of inequalities λ s,1 ≥ · · · ≥ λ s,n > λ s,1 − 1 as well as the equality deg E = − s,i λ s,i . A parabolic bundle is additionally said to be semistable when its parabolic slope, a modification of the slope that is offset by the choice of parabolic weights, decreases when passing to any subbundle (and appropriately restricting the parabolic structure). They then show the following result: Theorem 81 ( [34]). Fix a set S and a family of parabolic weights λ s,i . 23 The moduli space of semistable parabolic bundles on CP 1 with these weights is a normal, projective variety, homeomorphic to the moduli space of flat unitary connections on the trivial bundle over CP 1 \ S such that the monodromy operator U s at s has LogSpec U s = (λ s,i ) i .
What this theorem conspicuously does not assert is when the moduli of semistable parabolic bundles is nonempty. In order to assess this, Agnihotri and Woodward give a geometric interpretation of the semistability condition, then connect it to a complicated form of intersection theory known as quantum cohomology. Their ultimate theorem statement is as follows: Definition 82. We make the following definitions: • For r, k > 0 be positive integers with r + k = n, let P r,k be the set of partitions • Let Gr(r, k) be the Grassmannian of k-planes in C n .
• For a partition I ∈ P r,k , its Schubert variety is • The Schubert cell C I ⊂ σ I is the complement of all lower-dimensional Schubert varieties contained in σ I : C I = σ J ⊂σ I σ I \ σ J .
• sending s ∈ S to a general translate of σ Is , q d is the maximal power of q dividing s∈S T Is in the "small quantum cohomology ring" of Gr(r, k).
We now endeavor to explain the contents of this theorem and the connection to the ideas above. The first half is relatively easy to see: suppose that we have a semistable parabolic structure on the trivial bundle over CP 1 . A subbundle of rank k is then classified by a map µ : CP 1 → Gr(r, k), and the inequality imposed by semistability on the parabolic weights is given by s∈S i∈Is where here I s is the position of the subspace µ(s) inside of the parabolic flag at s ∈ S. Taking the intersection of all such inequality families imposed by all such maps then gives the proposed description of the moduli.
The meat of the theorem is in the connection with quantum cohomology, which requires a much more elaborate explanation. We follow a set of summary lectures by Fulton and Pandharipande [18]. Beginning with a sufficiently nice 24 space X and for a choice of class β ∈ H 2 (X), one may construct a moduli space of nodal curves M g,S (X, β) populated by triples (C, Σ, µ) consisting of a projective connective nodal curve C of genus g, a marking Σ : S → C in the nonsingular locus, and a map µ : C → X such that µ * [C] = β and such that µ admits finitely many automorphisms. This moduli turns out to have a compactification M g,S (X, β), and hence its rational cohomology acquires Poincaré duality and an intersection form [30].
Our interest in this construction stems from setting X = Gr(r, k) and g = 0, so that M 0,S (Gr(r, k), β) carries information about the available maps µ in Theorem 83. If we try to simultaneously prescribe the positions I s of µ(s) inside of the parabolic flag at s ∈ S, we will be further led to consider the classes [ev −1 s (σ Is )] ∈ H * M 0,S (Gr(r, k), β) as well as their intersections. To capture these intersections, we define the Gromov-Witten invariant I β associated to an S-labled family of cohomology classes (γ s ) s∈S ∈ H 2 * (X): Example 84 ( [18,Equation 44]). This definition contains the following special case: i.e., I 0 (T i T j T e ) records the structure constants for the cup product. These values are recognized in the literature as Littlewood-Richardson coefficients, N * e ij (r, k). Motivated by this, we use nontrivial classes β to define the following "deformed product": Theorem 85 ([18, Equation 66]). There is a commutative Z q -bilinear product on Z q ⊗ H * Gr(r, k) given by the formula The structure coefficients N * e,d ij (r, k) are called quantum Littlewood-Richardson coefficients. We now reconnect with the multiplicative eigenvalue problem: if the classes [ev −1 s (σ Is )] intersect the subspace of M 0,S (Gr(r, k), β) of curves of degree d to produce a nontrivial homology class, they will induce a corresponding q i -divisible cohomology class to appear in the quantum cohomology product of the classes T Is for some i ≤ d. In the case where d is minimal, they show that the corresponding cohomology class is degree 0, so that the q d -divisibility is exact, and also conversely that a minimally q-divisible cohomology class belongs to such an intersection [1,Lemma 5.5].
Finally, we may actually check this condition in cases of interest because the quantum Littlewood-Richardson coefficients are computable: they are connected to enumerative geometry [18,Section 9], and one can use this to calculate them directly in small-index cases; they are connected to cohomology and so obey associativity-type relations [18,Theorem 4]; and it is possible to assemble both of these sources of information into an algorithm which recursively computes them [7,8]. Since we are specifically interested in the cases of SU (2) and SU (4), we produce a table of the quantum Littlewood-Richardson coefficients appearing in the products on the small quantum cohomology rings for Gr (1,1) in Figure 3 and for Gr(1, 3), Gr(2, 2), and Gr(3, 1) in Figure 14.
Altogether, these results assemble into the following summary theorem. The form presented here is not entirely standard in the literature, but fits well with Buch's software implementation of the algorithm for computing quantum Littlewood-Richardson coefficients [8], as tabulated in Figure 3 and Figure 14.
Let U 1 , U 2 , U 3 ∈ SU (n) satisfy U 1 U 2 = U 3 , and let α * , β * , δ * ∈ A be the fundamental alcove sequence respectively associated to these unitaries through LogSpec. Select r, k > 0 satisfying r + k = n, select a, b, c ∈ Q r,k , and take d ≥ 0; then if N c,d ab (r, k) = 1, the following inequality must hold: Conversely, given alcove sequences α * , β * , δ * ∈ A for which N c,d ab (r, k) = 1 implies Equation Proof. We deduce this from Belkale's theorem, exactly as it is stated in the literature [6, Theorem 7]: 25 Let I 1 , I 2 , I 3 ∈ P r,k be partitions such that the Gromov-Witten invariant associated to the product of Schubert cycles satisfies N * I 3 ,d I 1 I 2 (r, k) = 1. For special unitary operators A 1 , A 2 , A 3 satisfying A 1 A 2 A 3 = 1, the following inequality then holds: Conversely, if α * , β * , δ * ∈ A satisfy all of the inequalities given above, there must exist special unitary operators A 1 , A 2 , A 3 ∈ SU (n) with A 1 A 2 A 3 = 1 and We show that these inequalities are equivalent, up to notation. First, note that the sets P r,k and Q r,k are related by a bijection π, which is constructed as follows. Beginning with a subset I ∈ P r,k and using the reference subset R = {k + 1, k + 2, . . . , k + r} of size r, consider the distances between their j th elements: the distance R 1 − I 1 is bounded by k; the distance R 2 − I 2 is bounded by R 1 − I 1 ; and so on. Altogether, the distances uniquely determine an element of Q r,k . Conversely, given a sequence of displacements D ∈ Q r,k , we produce the subset π : D → {k + j − D j | 1 ≤ j ≤ r} ∈ P r,k .
Suppose, then, that I 1 , I 2 , * I 3 ∈ P r,k are preimages for a, b, c ∈ Q r,k through the bijection π. We may use this to rewrite the sums in the inequality in our theorem statement: Next, note the identity for the logarithmic spectrum of an inverse: which extends over a sum to i∈I LogSpec(U −1 ) i = − i∈ * I LogSpec(U ) i .
Making this substitution in the inequality and moving the sums to the other side, we recover Belkale's formula
However, the first observation-that Smith, Curtis, and Zeng's standard library contains so many leaky gates-is much more of an accident.

Lemma 90. A generic two-qubit gate does not leak.
Proof. At the level of Lie algebras, a leaky gate U satisfies (su(2) ⊕ su(2)) ∩ Ad U (su(2) ⊕ 0) = ∅, witnessed by anti-Hermitian matrices h = c a + bi −a + bi d , Elements of this product are computed by which for a fixed value of U gives a linear system of real equations in the real unknowns specifying the elements of su(2) ⊗ 1 and su(2) ⊗ su (2). We claim that this system is generically of full rank, i.e., there is no solution but the trivial one. This system drops rank only when all determinants of all maximal subminors of the system vanish. As each determinant is an algebraic function on the real algebraic variety determined by SU (4), if these do not all simultaneously vanish everywhere, then they generically do not simultaneously vanish. We therefore need only exhibit a point where the system has full rank for the conclusion to follow. Selecting g = √ iSWAP, we make the manual calculation that the above system of equations is satisfied only for h = 0, h = h = 0. 27 Remark 91. The above mode of proof can be adapted to show that a generic entangler U has associated set P 2 U of positive volume. We rely on the following pair of geometric facts: Lemma 92 (Sard's theorem, [41]  We use these tools to analyze the algebraic function cov : SU (4) × (SU (2) ⊗2 ) ×3 → SU (4) (U, A, B, C) → AU −1 BU C. 27 Alternatively, using Theorem 55, Π(P 2 DB ) has positive volume, hence DB cannot be leaky, hence the linear system studied here has no solutions.
Fixing U to be the B-gate, it is known that cov| U =B is surjective [50], hence Lemma 92 shows that there is a point (X, Y, Z) in the domain at which the derivative D (X,Y,Z) cov| U =B is surjective. This is equivalent to the claim that the family of determinants det M i D (X,Y,Z) cov| U =B do not all simultaneously vanish, where M i ranges over the 18 15 different (15 × 15)-minors. Each of these determinants can be thought of as an algebraic function in the gate used to restrict cov: and the above claim becomes the claim that (f i )| V =B is not equal to the origin in R ( 18 15 ) . In turn, Lemma 93 says that (f i ) −1 (0) has zero volume, so that (f i )(V ) is nonvanishing generically in V , D (X,Y,Z) cov| U =V is surjective generically in V , and the image of cov| U =V has positive volume generically in V .
Remark 94. On the other hand, leakiness is an essential part of quantum error correction codes: the very definition of a nonleaky multi-qubit gate means that a locally correctable error becomes a locally uncorrectable error after application of the entangler. This can severely dampen the functionality of stabilizer-type codes which rely on an understanding of the rate of error propagation. Π