How smooth is quantum complexity?

The"quantum complexity"of a unitary operator measures the difficulty of its construction from a set of elementary quantum gates. While the notion of quantum complexity was first introduced as a quantum generalization of the classical computational complexity, it has since been argued to hold a fundamental significance in its own right, as a physical quantity analogous to the thermodynamic entropy. In this paper, we present a unified perspective on various notions of quantum complexity, viewed as functions on the space of unitary operators. One striking feature of these functions is that they can exhibit non-smooth and even fractal behaviour. We use ideas from Diophantine approximation theory and sub-Riemannian geometry to rigorously quantify this lack of smoothness. Implications for the physical meaning of quantum complexity are discussed.


I. INTRODUCTION
The computational complexity of a classical algorithm measures the physical resources that the algorithm requires to run. Although its precise definition depends on the model of computation in question, the classical computational complexity is robust in the sense that equivalent models of computation give rise to equivalent complexity measures, up to an overhead in computational resources that is polynomial in the input size. For example, the computational complexity of an algorithm on N input bits can be defined as its halting time C 1 (N ) on a Turing machine or as the number of elementary Boolean operations C 2 (N ) in its Boolean circuit representation. Equivalence of the Turing machine and Boolean circuit models of classical computation then guarantees that C 2 (N ) = O(poly(C 1 (N )). This idea of equivalence up to polynomial functions yields a notion of "asymptotic complexity" that is independent of one's preferred model of classical computation.
The extension of these classical definitions to quantum computers is not unique, allowing for various notions of quantum complexity with very different properties. A quantum algorithm on N qubits can be thought of as a unitary operator on the N -qubit Hilbert space; in this sense, each definition of quantum complexity yields a distinct function on the space of unitary operators G = SU (2 N ). A standard choice, that mimics the classical circuit complexity, is to fix some set of elementary gates A ⊂ G and define the complexity C(U ) of an operator U ∈ G as the number of elementary gates that must be multiplied to obtain U . However, this formulation of quantum complexity is rife with ambiguities that do not arise in the classical setting. For example, the set of elementary gates A can be chosen to be discrete and finite or continuous and infinite, leading to very different functions C(U ) in each case. Nevertheless, this notion of quantum computational complexity turns out to be robust enough for practical purposes, allowing one to define quantum complexity classes by analogy with their classical counterparts 1 .
Thus, at least from the viewpoint of quantum computer science, such ambiguities in the definition of quantum complexity C(U ) are not very serious. However, recent work by Susskind and collaborators on the late-time dynamics of black holes [2][3][4][5] has argued that the quantum complexity should be viewed as a fundamental physical quantity, analogous to the usual thermodynamic entropy in some respects but with important differences in others 3 . In particular, it has been proposed 6 that within the AdS/CFT correspondence, the dynamics of quantum complexity on the boundary of AdS spacetime uniquely captures certain non-trivial late-time features of black hole dynamics in the bulk, long after the timescale at which thermalization sets in.
If correct, this intriguing conjecture has consequences far beyond the specific context of black hole physics. First, it implies that there may be a universal definition of quantum complexity that is determined by physical principles alone. This stands in contrast to the usual definition of classical computational complexity, which is rather arbitrary from the physicist's viewpoint. Second, it suggests that the quantum complexity might be a useful tool in the broader setting of many-body physics, for example, in distinguishing highly entangled states of condensed matter systems. Both these possibilities call for a study of the quantum complexity as a physically interesting quantity in its own right.
With this motivation, our paper provides a unified perspective on the various notions of quantum complexity. We first show how three standard measures of the complexity of a quantum circuit -the discrete gate complexity, the circuit depth and the continuous complexity distance -define related generalizations of classical computational complexity to the quantum setting. We next explore the analytical properties of these complexity measures, viewed as functions on the space of unitary operators, which have previously been argued to exhibit non-smooth and possibly fractal behaviour 4,5,7 . The main technical result of our paper is a rigorous account of this lack of smoothness.

II. THREE NOTIONS OF QUANTUM COMPLEXITY
The classical notion of computational complexity, for example based on Boolean circuits, operates in discrete time with a discrete set of elementary operations. In contrast, the unitary group has the structure of a smooth manifold. Thus in attempting to define the computational complexity of a quantum algorithm on N qubits, viewed as a unitary operator U ∈ G = SU (2 N ), there is no a priori reason to restrict oneself to either a discrete notion of computational "time" or a discrete set of elementary operations, beyond a desire for harmony with established classical definitions.
Successively relaxing these requirements of discreteness in time and discreteness of gates leads naturally to three distinct notions of quantum complexity. First let us recall that there are two fundamentally distinct types of gate set A ⊂ G: 1. exactly universal : A is infinite and uncountable, and every U ∈ G can be expressed as a finite product of elements in A.

computationally universal :
A is finite, and the group generated by elements of A and their inverses is dense in G.
One further distinction, of potential importance for applications of quantum complexity to condensed matter systems or local quantum fields, is between spatially local and k-local gate sets. Previous discussions of the quantum complexity tend to focus on elementary gate sets A that are k-local and all-to-all 4,8 . Demanding instead that the gate set A be local in space leads to some small differences compared to the non-local case, which we address in later sections.
The distinction between computationally universal and exactly universal gates sets leads to correspondingly distinct notions of quantum complexity: 1. (discrete time, discrete gates) Let the gate set A = {g 1 , g 2 , . . . , g r } ⊂ G be computationally universal. Then for a given tolerance > 0, the gate complexity of a unitary operator U ∈ G is defined as Here the minimization is over all k ∈ N, i j ∈ {1, 2, . . . , r} and n 1 , n 2 , . . . , n k ∈ Z. The matrix norm can be chosen freely; in this paper we will use the Hilbert-Schmidt norm A = [Tr(A † A)] 1/2 . Among the three definitions of quantum complexity considered here, the gate complexity is most closely analogous to the classical computational complexity.
2. (discrete time, continuous gates) Now suppose that the gate set A is exactly universal, but computational "time" is discrete, and at most W = O(poly(N )) gates may be applied in a given time step. For example, A might be the set of all operators on two qubits, of which at most W = N/2 can be applied simultaneously. In this setting, a natural measure of the quantum complexity is the circuit depth σ(U ) of the shallowest circuit required to simulate U . Up to a factor polynomial in N , this is equivalent to the least number of distinct gates in A required to simulate U .
3. (continuous time, continuous gates) Finally, one can consider both an exactly universal gate set A and allow the unitary U of interest to be simulated in continuous time. The "cost" of simulating U is then most naturally formulated as a problem in Hamiltonian control 8,9 . Concretely, one introduces a cost function f (H) that defines a norm on the space of 2 N × 2 N Hermitian matrices, and for given U, V ∈ G, defines their complexity distance C(U, V ) in terms of the least costly path from the identity U to V in G, to wit where the infimum is over all absolutely continuous 10 paths γ : The complexity of a specific operator U ∈ G is then given by C(U ) := C(1, U ), where 1 denotes the identity in G. This formulation of quantum complexity is usually referred to as "complexity geometry". For suitable choices of f , C(U, V ) is the geodesic distance between U and V with respect to a Riemannian metric on G. More generally, f endows G with the structure of a sub-Finsler manifold, with respect which the complexity distance C(U, V ) defines a so-called Carnot-Carathéodory distance 10,11 .
These three broad notions of quantum complexity and their basic properties are summarized in Fig. 1 and Table  I. Among these definitions, viewed as functions on G, the circuit depth is simplest to capture analytically 12 . A particularly tractable example is the case of a single qubit G = SU (2), for which the gate set A = {e iφZ , e iθY : φ, θ ∈ [0, 2π)} is exactly universal by Euler angles. Then unitaries U ∈ G that are generic in measure are realized by circuits of minimum depth σ(U ) = 3, corresponding to their Euler angle parameterization U = e iχ1Z e iχ2Y e iχ3Z . More generally, consider N qubits with G = SU (2 N ) and suppose that the exactly universal gate set A in question is parameterized by K = O(poly(N )) continuous parameters. Since the real dimension of the manifold G is 4 N − 1, the circuit depth of a unitary U that is generic in measure must satisfy the inequality Thus the circuit depth σ(U ) is bounded below almost everywhere by a function exponentially large in N . In fact, both the discrete gate complexity C (U ) and the continuous complexity distance C(U, V ) exhibit similar worst-case exponential scaling 4 in N to the circuit depth σ(U ). It is therefore usually assumed 13 that these definitions are more-or-less equivalent from the viewpoint of quantum computing 1,14 , and differ only in their ease of calculation. However, if the complexity is viewed as a fundamental physical quantity in its own right 6 , then the distinction between these different complexity measures becomes important.
The most striking such distinction arises in the local analyticity properties of these complexity measures. In particular, both the gate complexity and the complexity distance have a more intricate mathematical structure than the circuit depth and can exhibit highly non-smooth behaviour. The purpose of the remaining sections is to quantify this lack of smoothness rigorously. Our results are organized as follows. We first prove the existence of efficiently universal gate sets for which C (U ) exhibits worst-case scaling in , C (U ) = Ω(log 1/ ), densely in G. This clarifies the manner in which C (U ) tends to a nowhere continuous function as → 0. We next prove that the complexity distance C(U, V ) is at worst continuous but not differentiable as V → U in generic directions.
These results give precise meaning to various qualitative discussions of the "fractal" geometry of quantum complexity in the literature.

A. Background to results
For the gate complexity Eq. (1), let A denote the group generated by elements of A and their inverses, which by assumption is dense in G. To gain some intuition, first consider the limit C 0 (U ) := lim →0 C (U ). Because the group A has measure zero in G, C 0 (U ) = ∞ almost everywhere. Thus as → 0, C (U ) tends to a nowhere continuous function on the group G, analogous to the nowhere continuous Dirichlet function of real analysis. (Notice that for a finite group with A = G, C 0 recovers the "word metric" studied in geometric group theory; we refer to Ref. [15] for a discussion of analogies between geometric group theory and quantum complexity.) The lack of continuity of C 0 , viewed as a function from G to the extended real line, is usually assumed to be regulated by the introduction of > 0; in this sense the quantum complexity defines a regularized notion of word metric for Lie groups. Indeed, for any computationally universal gate set, the Solovay-Kitaev theorem provides a constructive algorithm 16 to approximate any given U ∈ G within > 0 with C (U ) = O(log c 1/ ) where c ≈ 4. It was shown by Harrow, Recht and Chuang 17 that the Solovay-Kitaev estimate could be improved for the class of so-called "efficiently universal" gate sets, which allow all unitaries U to be -approximated using at most C (U ) = O(log 1/ ) elementary gates. This result was also shown to be optimal, in the sense that the worst-case complexity of U ∈ G is bounded below by Ω(log 1/ ).
The log 1/ scaling of the worst-case complexity follows by an elementary counting argument, which works by thickening points of A in G by -balls until the entire group is covered 17 . However, it is not clear from this argument how such "complicated unitaries" are distributed within the Lie group G. The main result of this section is that there exist efficiently universal gate sets for which complicated unitaries are dense in G. In other words, every unitary in G is arbitrarily close to another unitary whose complexity scales as Ω(log 1/ ) as → 0. Since A is also dense in G, it follows that every neighbourhood of G contains both a unitary with finite complexity independent of and a unitary with complexity diverging as log 1/ as → 0. This illustrates how the discontinuous behaviour of C 0 is inherited by the regularized gate complexity, C with > 0.
In fact, the mathematical idea necessary to capture this behaviour did not appear until relatively recently. The foundation of our analysis is the "non-commutative Diophantine property" introduced by Gamburd, Jakobson and Sarnak 18 and subsequently refined by Bourgain and Gamburd 19,20 , that is essentially a non-Abelian analogue of the Diophantine properties satisfied by the real numbers 21 . As a rule, Diophantine properties tend to be the preserve of number theorists, rather than physicists; a notable exception is the KAM theory of perturbed integrable systems, which demonstrates that quasiperiodic tori whose frequencies satisfy Diophantine bounds are stable to the onset of chaos 22 . In the complexity language, KAM tori have "complicated resonances", that cannot be achieved at any finite order in perturbation theory. Other examples include the sensitivity of the Aubry-André model to the commensuration of its potential 23 and the sensitivity of the quasiparticle content of the gapless spin-1/2 XXZ chain to its anisotropy 24 . Our analysis of the gate complexity C (U ) exploits its similarity to these phenomena, insofar as the gate complexity is also sensitive to the irrationality properties of the real numbers [17][18][19][20]25 .
For the special case G = U (1), lower bounds on the gate complexity follow by standard results in the Diophantine approximation of real numbers 21 . The extension to gate complexities in non-Abelian unitary groups, G = SU (d) with d ≥ 2, is only made possible by some relatively recent mathematical advances in Lie group theory [18][19][20]26 , that were alluded to above. The remainder of this section is structured as follows. We first familiarize the reader with Diophantine bounds in the simplified setting of U (1), which contains most of the ideas necessary for understanding the non-Abelian case. We then provide a worked example of the singular behaviour of C (U ) for the basic physical case of G = SU (2). Finally, we extend the result to a class of efficiently universal gate The basic ideas of our proof in the non-Abelian case can be understood by applying standard results in Diophantine approximation 21 to lower bound the gate complexity on a dense subset of the group G = U (1). Due to the projective nature of quantum mechanics, this example is somewhat unphysical, but is nevertheless instructive.
When G = U (1), a single generator g 1 = e iα with α/π irrational is computationally universal, in the sense that g 1 is dense in U (1). The complexity of U = e iφ ∈ G associated with the gate set A = {g 1 } is given by Thus we consider n such that Let m denote the unique integer such that Then Using the inequality (2/π)|x| < | sin x| for |x| < π/2, it follows that To proceed further, we make the additional assumption that α 2π is an algebraic irrational number. We then have the following result: Proposition 1. Let φ ∈ [0, 2π) and δ > 0. Then there exists φ with |φ − φ| < δ such that Proof. Since algebraic numbers are dense in R and α/2π has finite degree by assumption, there exists φ algebraic such that |φ − φ| < δ and φ /2π is rationally independent from α/2π. Let n ∈ Z with |e iφ − e inα | < . Then φ satisfies Eq. (9) for some m ∈ Z. Also, by a standard result in Diophantine approximation 21 , for any exponent τ > 2 there is a constant K(α, φ , τ ) such that Using the definition of m, it follows by Eq. (9) that The result follows upon setting τ = 3.
C. Gate complexity in SU (2) Let us now turn to the more difficult case of G = SU (2). For concreteness, consider the gate set A 2 = {e iπαZ , e iπαY } where Y, Z denote the usual Pauli matrices and cos πα ∈ Q\{0, ±1, ±1/2}. It follows by Niven's theorem that α is irrational; thus the gates in A generate dense subsets of the circles {e itZ , t ∈ [0, 2π)} and {e itY , t ∈ [0, 2π)}. By Euler angles, A 2 is dense in G and A 2 yields a computationally universal gate set on SU (2).
Moreover, by a theorem of Swierczkowski 27 , the group A 2 is free; this means that its Cayley graph is a tree and therefore defines a (rooted) Bethe lattice with coordination number z = 4 in the compact manifold SU (2). This "fractal" geometry suggests discontinuous behaviour of the quantum complexity, as has been suggested in the literature 4 ; we now make this intuition precise.
The main technical apparatus that we will require is as follows: . . , g r } with g i ∈ SU (2). A satisfies the non-Abelian Diophantine condition if there exists a constant D = D(A) such that for all words W l = g i1 g i2 . . . g i l = ±1 2 of length l in A , the inequality holds.
where M 2 (Q) denotes the set of 2 × 2 matrices with algebraic elements. Then A satisfies the non-Abelian Diophantine condition.
It is clear that the definition Eq. (13) is analogous to a real Diophantine condition, although the lower bound in the non-Abelian case is exponential rather than polynomial in the word length. It is also clear that our twoelement gate set A 2 = {e iπαZ , e iπαY } satisfies the non-Abelian Diophantine condition. In fact, this implies that A 2 is efficiently universal 17,19 , in the sense that any element of SU (2) can be -approximated with worst-case complexity O(log 1/ ). We now demonstrate that unitaries with complexity Ω(log 1/ ) are dense in SU (2). Proposition 3. Let U ∈ SU (2) and C (U ) denote its gate complexity defined with respect to A 2 . Then for all δ > 0, there exists U ∈ SU (2) with U − U < δ and a non-universal constant D(α, U ) such that Proof. Pick U ∈ SU (2) ∩ M 2 (Q) with U − U < δ and U / ∈ A 2 and let W (2) n denote a word of length n in A 2 that -approximates U . Then by Proposition 2 applied to the gate set A 2 ∪ {U }, there exists a constant D(α, U ) such that By unitarity of U , it follows that Then by assumption which implies (note that it is possible 18 to set D > 1). Thus we have achieved a lower bound on the length of words thatapproximate U , and in particular which was to be shown. It is immediate that the conclusions of Proposition 3 extend to any computationally universal gate set A = (g 1 , g 2 , . . . , g r ) on SU (2), provided that the g i have algebraic elements. As noted previously 19 , all such gate sets are efficiently universal. It follows that our results hold for the entire class of known (at the time of writing) efficiently universal gate sets on SU (2), which includes familiar examples such as the "Clifford+T" gate set acting on a single qubit 25 .

D. Gate complexity in SU (d)
Finally, we discuss the general (and most physical) case of quantum complexity of unitaries in general special unitary groups, SU (d), with d > 2.
Unfortunately, this case is also the most difficult and there are not very many explicit results available. We will therefore proceed somewhat indirectly. Let us first note that we can use A 2 defined above for SU (2) to construct an efficiently universal gate set on SU (d), given by the embedding 17 where Since this gate set is efficiently universal, it is certainly computationally universal and therefore generates a dense subgroup of G = SU (d). We then have the following result, which follows by a direct generalization 20,28 of Proposition 2 to SU (d): Let U ∈ SU (d) and C (U ) denote its complexity defined with respect to A. Then for all δ > 0, there exists U ∈ SU (d) with U −U < δ and a non-universal constant D(A, U ) such that The proof proceeds similarly to that of Proposition 3. Note that the lower bound of Eq. (22) is "fractal", in the sense that the prefactor D(A, U ) depends 18 on the irrationality properties of A and U . An analogous observation holds for the simpler U (1) case, Eq. (12), for which the least permissible τ for given φ (not necessarily algebraic) is related to its irrationality measure. Such "fractal" lower bounds are quite unusual in physics; a well-studied example arises in the transport theory of the spin-1/2 XXZ chain 29 .

E. Locality versus non-locality
The discussion up to and including Theorem 1 proves the existence of efficiently universal gate sets in SU (d) such that unitaries with Ω(log 1/ ) complexity are dense. One point that we have not considered so far is the issue of locality. For concreteness, consider a system of N physical qubits on a ring, with Hilbert space dimension d = 2 N , and suppose that the only experimentally accessible gates are those acting on at most two qubits at once. The space of all exact, all-to-all, two-qubit gates is described by K = O(N 2 ) continuous parameters. If one additionally imposes spatial locality, for example, allowing only two-qubit gates that act on nearest neighbour qubits, the number of continuous parameters shrinks to A natural question is whether our results on the gate complexity can be formulated for sets of computationally universal gates A that are local in the above sense. This indeed turns out to be achievable, though the construction we propose is again somewhat indirect (and certainly not unique). Let us take "local" here to mean two-qubit gates acting on nearest neighbours, which allows for K = N distinct gate configurations (note that our arguments extend straightforwardly to all-to-all gate sets). The first step is to choose a pair of rotations that are algebraic and densely generate SU (2), for example {e iπαZ , e iπαY } with cos πα = 1/3. Then the embedding Eq. (20) can be used to construct a gate set A with 6K elements that densely generates each nearest neighbour two-qubit copy of SU (4). Since the full set of nearestneighbour two-qubit gates is exactly universal 30 in the full group G = SU (2 N ), the group A must be dense in G. Moreover, each matrix in A is algebraic by construction. It follows that the gate set A satisfies the hypotheses of Theorem 1.
The upshot is that it is possible to construct local, efficiently universal gate sets such that unitaries with Ω(log 1/ ) complexity are dense in G. This is true whether one considers spatially local or all-to-all fewqubit gate sets. However, one shortcoming of our construction is that the geometry of the Cayley graph of A , which has been argued to capture important features of the quantum complexity 4,15 , is not especially obvious.
If one instead relaxes the requirement of locality and asks only that the elementary gates be expressible as finite products of local operations, then a more explicit characterization of the Cayley graph becomes possible. Specifically, applying the Breuillard-Gelander theorem 26,31 to the dense subgroup A < G yields a pair of gates A = {g 1 , g 2 } that freely generate a dense subgroup of SU (2 N ), are expressible as finite products of local gates, and satisfy the hypotheses of Theorem 1. In particular, the Cayley graph of A is a rooted Bethe lattice with coordination number z = 4 (see Fig. 1 for a depiction), belying the physical intuition 4 that the coordination number of the Cayley graph of a computationally universal gate set on N qubits must scale with N .

A. Riemannian complexity geometry
We now turn to Nielsen's notion of complexity geometry 8 for continuous sets of elementary gates A, which applies ideas from the theory of Hamiltonian control to the problem of constructing arbitrary unitary operators through the repeated action of few-qubit gates. While the control theoretical formulation of quantum complexity allows for fairly arbitrary cost functions in principle, it is simplest to focus on cost functions that derive from an underlying Riemannian metric 3,8 .
For concreteness let us again consider quantum algorithms on N qubits. Then the Hilbert space dimension is d = 2 N , and the goal is to describe the complexity geometry of the group G = SU (d). We shall refer to elements of the Lie algebra g (viewed as the tangent space at the identity) in terms of Hermitian matrices, i.e. by writing iH, with H Hermitian and traceless. Following Nielsen, let P denote a projector onto k-local Hermitian matrices with k ≤ 2 and Q a projector onto those with k > 2. Further define the "penalty factor" q ≥ 1 and introduce an inner product on g. By right translation, this can be extended to a Riemannian metric on all of G, and when q = 1, recovers (up to a constant factor) the bi-invariant metric defined by the Killing form.
Using this inner product, we define the complexity distance of two unitary operators U, V to be where the infimum is over all absolutely continuous paths γ : For finite q, the complexity distance C(U, V ) is simply the geodesic distance from U to V with respect to the Riemannian metric Eq. (23). However, if one takes q = ∞ (the most physical choice from the viewpoint of locality), the inner product . , . ceases to be invertible. In this limit, Nielsen's metric is most naturally interpreted as defining a sub-Riemannian geometry 8,9,32 , for which only tangent directions consisting of k-body operators with k ≤ 2 are allowed. This observation allows one to deduce several generic features of the q = ∞ limit using standard results on sub-Riemannian geometry, which do not seem to have been applied previously to the quantum complexity (although some of the resulting concepts were discussed for the special case of a single qubit 7 ).

B. Sub-Riemannian complexity geometry
We first introduce some key definitions 10,11 . Let M be a real n-manifold and ∆ ⊂ T M a smooth sub-bundle of the tangent bundle of M . The distribution ∆ is called bracket generating if any tangent vector v ∈ T p M can be expressed as a linear combination of vectors , . . . with X j ∈ ∆. A sub-Riemannian manifold consists of a triple (M, ∆, g) where ∆ is a bracket-generating distribution and g is a Riemannian metric on M . A curve γ : [0, 1] → M is called horizontal ifγ(t) ∈ ∆ γ(t) whereverγ is defined.
For Nielsen's geometry with q = ∞, we take M = G and define ∆ to be the space of k-body operators in g with k ≤ 2, extended to all of G by right translation. The metric g on G can be taken to be the standard biinvariant Riemannian metric though more general choices are allowed. Then the triple (G, ∆, g ∆ ) is a sub-Riemannian manifold. Given these definitions, the complexity distance of two unitary operators U, V is defined as the length of the shortest horizontal curve connecting U to V , to wit with γ satisfying Eq. (25). Letting d(U, V ) denote the geodesic distance with respect to the standard (q = 1) metric, Eq. (26), it is clear that the complexity distance is bounded below by the usual geodesic distance, i.e.
The metric defined by C(U, V ) is usually called a Carnot-Carathéodory distance 11 (though this seems to be something of a misnomer, given that the distributions appearing in Carathéodory's formulation of the second law of thermodynamics are integrable 33 ). When the distribution ∆ is bracket generating, the following result holds: Theorem 2. (Chow 11 ) Let M be a connected manifold and ∆ a bracket-generating distribution. Then any two points in M can be joined by a piecewise smooth curve that is horizontal.
In the context of Nielsen's complexity geometry, this means that for any U, V ∈ G, there exists a piecewise smooth curve from U to V such that the instantaneous Hamiltonian H(t) comprises purely k-body terms with k ≤ 2. In particular, the complexity distance C(U, V ) is always finite. However, these curves are expected to look much "rougher" than geodesics in the Riemannian metric. This intuition can be made precise as follows.
inductively by allowing successive commutators. Namely, we set ∆ [1] = ∆ and define Now let X 1 , X 2 , . . . , X n be a frame of sections of T G and define integers m k such that X 1 , X 2 , . . . , X m k is a frame of sections for ∆ [k] (thus m k is the number of linearly independent vectors in ∆ [k] at a given point). The degree d j of the vector field X j quantifies its commutator depth, and is defined so that with ∆ [0] := {0}. In the complexity language, vector fields with d j = 1 correspond to "easy" directions in the space of Hermitian operators while vectors with d j > 1 correspond to "hard" directions. One of the basic results of sub-Riemannian geometry relates this structure of "easy" and "hard" directions to the local behaviour of the complexity metric.
To formulate this result, let us first define the flow exp U (X) that takes U to the point γ(1) on the integral curve This defines an exponential map exp U : R n → G, of the form We define the "box" Box(r) in R n as These anisotropic boxes in R n capture the geometry of balls B U (r) = {V ∈ G : C(U, V ) < r} in the complexity metric. In particular, the following result holds: Theorem 3. (the "ball-box theorem" 11 ) Balls in the complexity metric are uniformly equivalent to images of boxes under the exponential map. Specifically, there are strictly positive continuous functions A, r : G → R + with A > 1 such that This result has two important consequences for sub-Riemannian complexity geometry. First, it implies this geometry is fractal, in the sense that the Hausdorff dimension of the metric space (G, C) is equal to 11 n H = n j=1 d j > n, and therefore exceeds its real dimension n = 4 N − 1. This fact was recently noted in the literature without proof 5 . It follows intuitively from Eq. (36), which suggests that the volume of a complexity ball scales anomalously with its radius r, as ∼ r n j=1 dj . Second, this result suggests that moving in a generic direction from a unitary U to another unitary V at a Riemannian distance d(U, V ) = δ, the complexity distance behaves as C(U, V ) ∼ δ 1/s , where s = max j d j > 1. More formally, the identity map relating the metric spaces id : (G, d) → (G, C) is known 10,11 to be α-Hölder continuous with Hölder exponent α = 1/s, which implies the inequality for some constant M U > 0 and δ sufficiently small. This indicates that the complexity distance is continuous but possibly not differentiable as V → U . A precise statement is as follows: is continuous as V → U but does not have one-sided directional derivatives as V → U in generic directions.

Proof.
First introduce "privileged coordinates" 34 y 1 , y 2 , . . . , y n about the point U , which satisfy a U (|y 1 | 1/d1 + |y 2 | 1/d2 + . . . + |y n | 1/dn ) ≤ C(U, V ) (38) for some constant a U > 0. Here, y 1 , y 2 , . . . , y n denote the privileged coordinates of V , while U has privileged coordinates y = 0 by construction. Choosing V to approach U in a generic direction v, i.e. defining V (t) by its privileged coordinates y j = v j t with |v j | > 0 and sufficiently small t, we have We deduce that approaching from generic directions in the tangent space at U , the one-sided directional derivative lim t→0 + C(U,V (t)) t does not exist. Meanwhile the Hölder condition Eq. (37) implies that C(U, V ) → 0 as V → U .
At this point, several comments are in order. First, the results described above can be adapted to sub-Finsler metrics 10 , and in this sense capture the most general case of Nielsen's complexity geometry for bracket-generating distributions ∆. Second, the lack of one-sided directional derivatives of the sub-Riemannian complexity distance C(U, V ) as V → U distinguishes it from the Riemannian geodesic distance d(U, V ). While neither function is differentiable at V = U , the Riemannian distance admits one-sided directional derivatives as V → U along smooth curves.
We now briefly discuss the question of local versus nonlocal gate sets in the context of the sub-Riemannian complexity distance. As noted above, the local geometry of complexity balls is entirely determined by the structure of "easy" and "hard" vector fields encoded by the sequence of integers (d 1 , d 2 , . . . , d n ). Suppose now that in Nielsen's definition we impose spatial locality rather than two-locality, i.e. demand that the "easy" directions in g comprise only spatially local two-qubit operators. As discussed in Section III E, this modifies the dimension of the vector space K = dim(∆) of easy directions from K = O(N 2 ) for all-to-all, two-local gates to K = O(N ) for spatially local two-qubit gates. This in turn leads to a redefinition of the integers (d 1 , d 2 , . . . , d n ) and a corresponding increase in the Hausdorff dimension n H , but since both distributions are bracket generating 30 there are no other substantive changes.
C. Approaching the q = ∞ limit For large but finite q, Nielsen's metric Eq. (23) is Riemannian. This means that the complexity distance function C(U, V ) admits one-sided directional derivatives along smooth curves through U (though it is still not differentiable at V = U ). Moreover, the complexity geometry is no longer truly fractal because the Riemannian exponential map is locally well-behaved 33 , raising the question of how far the singular features of the q = ∞ limit are inherited by the complexity geometry with q < ∞. This point was previously discussed for the special case of a single qubit 7 . We now generalize these considerations to the complexity geometry of N qubits; our discussion will be less rigorous than in preceding sections.
As noted previously 4,5,7 , the relevant geometrical idea is the "cut locus" Γ U of a given U ∈ G, which is the set of points V ∈ G for which there exists more than one lengthminimizing geodesic connecting U and V . For large q, we expect that the nearest points V * ∈ Γ U to U have the property that the sub-Riemannian geodesic connecting U to V * is equal in length to the Riemannian geodesic connecting U to V * . Writing d(U, V * ) = δ, we therefore expect in a generic direction, where s was defined above. Thus the distance δ to the nearest cut point V = U such that C(U, V ) is not smooth scales with q as δ ∼ q −s/(2(s−1)) . (41) For a single qubit with s = 2, this recovers a previous result 7 . Notice that as q → ∞, the cut locus Γ U becomes arbitrarily close to U in almost all directions. This is one way to understand the singular nature of the limit q = ∞.

D. Complexity distance versus gate complexity
Finally, one can ask how far the continuous complexity distance emerges naturally as a continuum limit of the discrete gate complexity. The existence of such a limit would be strong evidence in favour of a universal notion of quantum complexity.
Remarkably, an equivalence between discrete gate complexity (i.e. a word metric) and continuous complexity distance (i.e. a Carnot-Carathéodory metric) does exist for nilpotent Lie groups, for example, the Heisenberg group. Roughly speaking, this arises due to an equivalence between the volume of Cayley graphs at radius r and the volume of their limiting sub-Riemannian balls at radius r, both of which scale with the same anomalous Hausdorff dimension, e.g. as ∼ r 4 for the Heisenberg group 35,36 .
However, for unitary groups any such local equivalence between discrete and continuous complexity geometries breaks down. This is easily seen by comparing the volume growth of the Cayley graph on two free generators at radius r, which scales exponentially as ∼ 3 r , with the volume of a complexity ball, which scales polynomially as ∼ r n H . The existence of exponentially growing Cayley graphs in unitary Lie groups, compared to nilpotent ones, reflects the basic distinction between semisimple and solvable Lie algebras, and can be viewed as a consequence of the Tits alternative in group theory 35,37 . This appears to rule out a correspondence between discrete and continuous notions of quantum complexity down to the smallest scales of the unitary group G in question.

V. DISCUSSION
We have proposed a unifying perspective on the various notions of quantum complexity and shown how they can be distinguished by their smoothness properties, or lack thereof. Our results clarify how the gate complexity tends to a nowhere continuous function of its argument as → 0, and make precise the sense in which Nielsen's complexity geometry becomes fractal as q → ∞.
At the time of writing, it is still not clear how far there exists a "unique", or universal, definition of quantum complexity, nor indeed whether such a definition can be expressed in terms of the complexity measures studied in our paper. One possible route to tackling this question would be making sense of how the different notions of complexity depicted in Fig. 1 emerge as limits of one another. The breadth of mathematical ideas involved in their formulation, together with the group-theoretical obstruction identified above, suggests that this task will be far from trivial. Meanwhile, the idea that there might exist such a universal notion of quantum complexity 6 motivates further study of complexity measures in realistic many-body quantum systems.