Fast Navigation with Icosahedral Golden Gates
Abstract.
An algorithm of Ross and Selinger for the factorization of diagonal elements of PU(2) to within distance was adapted by Parzanchevski and Sarnak into an efficient probabilistic algorithm for any element of PU(2) using at most effective factors from certain well-chosen sets associated to a number field and a prime . The icosahedral super golden gates are one such set associated to . We leverage recent work of Carvalho Pinto, Petit, and Stier to reduce this bound to , and we implement the algorithm in Python. This represents an improvement by a multiplicative factor of over the analogous result for the Clifford+ gates. This is of interest because the icosahedral gates have shortest factorization lengths among all super golden gates.
Key words and phrases:
Quantum computing, quaternion algebras1991 Mathematics Subject Classification:
Primary 68Q12, 81P65, 11R52; Secondary 51F251. Introduction
Lubotzky, Phillips, and Sarnak, in a series of papers [11, 12, 13, 14], explicitly constructed topological generators with optimal covering properties for the compact Lie group . Such generators for projective unitary groups find an interesting application in quantum computing where a fundamental design challenge is to determine an optimal, fault-tolerant decomposition of a quantum gate. For classical computing a single bit state is an element of . A classical gate implements functions on binary inputs. The only nontrivial single bit logic operation is NOT, which takes 0 to 1 and 1 to 0 (though it is also possible for the codomain to contain more than one bit). In the quantum setting, single qubit states are points
up to a mutual phase in each component, such that
A gate here cannot output more than one qubit, and thus must be a projective unitary.
A universal gate set is a finite set of gates, , that can approximate, in the bi-invariant metric on the compact Lie group, any matrix arbitrarily well. That is, the group generated by must be topologically dense in . The Solovay–Kitaev theorem [17] guarantees that universal gate sets can efficiently approximate quantum operations for unitaries on a constant number of qubits. Universal gate sets typically consists of a finite group together with an extra element , which we will take to be an involution, so that the subgroup generated by and covers with minimal -count, and simultaneously navigates efficiently. That is, given some gate in and desired precision , there is an efficient algorithm (polynomial-time in the input size) that with high probability finds a short word in to that precision, typically of length . The deep insight of Sarnak [24] is that the construction and optimality of universal single-qubit quantum gate sets can be understood in terms of the arithmetic of quaternion algebras. Specifically, identifying with a subgroup of the group of units in a definite quaternion algebra over a totally real number field provides a coherent framework within which one can systematically address the question of optimality of topological generators for
The question we address within this context is that of finding the “best” topological generators of among those universal gate sets, the super golden gates of Parzanchevski and Sarnak [19], which are known to possess optimal covering properties and efficient navigation. In particular, there are only finitely many super golden gates [19, p.870–871] and the respective finite subgroups can be realized as the group of symmetries of of the Platonic solids: for the tetrahedron, ; for the cube and the octahedron, ; and for the dodecahedron and icosahedron, .
We demonstrate that the icosahedral super golden gates admit a factorization directly analogous to the one obtained by Stier [25], and that this gives the best-known preconstant to the first-power logarithm in the approximation length. The exact factor of the improvement is . This improvement is due to the fact that the icosahedral super golden gates have a growth rate that is on the order of , while gate set studied in [25], the Clifford+ gates, have growth rate of order . We note also that the icosahedral super-golden-gates represent the greatest number of distinct gates with bounded -count.
The commonly used Clifford+ gate set provides a set of elementary gates that is universal and consists only of a small number of gates, all of which are very well compatible with many established error correction schemes and can be physically implemented in all quantum technologies that seem promising for large-scale quantum computations [18]. In this case the finite group is the Clifford group of order 24 in At least one non-Clifford gate must be added to the basic gate set in order to achieve universality. A common choice for this additional gate is the -gate (or -gate). The -gate is not the only possible extension of the Clifford group but it is considered to be the most practical one. This is due to the availability of fault-tolerant implementations of the -gate. For this reason, the Clifford+ gate set is considered the most promising candidate for practical quantum computing. We recall, for the convenience of the reader, some of the salient details of the single qubit Clifford+ gate set. Let
We take [24, 21, 25]. The Clifford+ universal gate set is an example of a golden gate set [24, 19]. The remarkable observation of [24] is that the and gates of the Clifford+ gate set come from the definite quaternion algebra
Kliuchnikov, Maslov, and Mosca [6] characterized the group and demonstrated an efficient algorithm to factor exactly, by carefully studying the powers of in the denominators of matrix entries. Ross and Selinger [21] then focused on diagonal matrices near to , with the goal of finding -close factorizations of length ; the base of 2 is intrinsic to the structure of the Clifford+ gates. By studying upright sets in the plane, which function analogously to the simplices of Lenstra’s algorithm [7, 20], they achieved the leading coefficient of (in that restricted case). Parzenchevski and Sarnak [19] generalized Ross and Selinger’s approach to any golden gate set (with the base of the logarithm correspondingly changing per the gate set), and by considering Euler angles reached the coefficient of for approximations to generic elements. Working with the (finite) LPS Ramanujan graphs (see §2.1.3 and [14]), Carvalho Pinto and Petit [1] factorize in the equivalent of This approach is adapted by Stier [25] for the same coefficient with Clifford+ gates. We combine aspects of the techniques of [1, 25], in the proposed icosahedral setting, to reduce this bound to
2. Super Golden Gates
We recall here essential ideas related to the arithmetic of quaternion algebras [27, 28], -arithmetic groups [16, §C], and Ramanujan graphs [10] which lead to the icosahedral super golden gates [19].
2.1. Quaternion Algebras
A quaternion algebra over a field is a central simple algebra of dimension four over (cf. [15, §5.2] or [5, p.15]). It follows from Wedderburn’s structure theorem on simple algebras [3] that every quaternion algebra over any field is either isomorphic to or a division algebra with center [8]. If the characteristic of is not 2 then it is always possible to find a basis for over such that
where . We designate such an algebra by
Evidently is of the form
(2.1) |
where . In this notation, Hamilton’s quaternions arise as
The conjugate of as in (2.1), denoted by , is equal to . For each we define the (reduced) norm map by
and the (reduced) trace map by
We note that every element satisfies the quadratic equation
It is possible to make everything completely explicit by embedding in by, for example,
Evidently, if is a square in , then . A necessary and sufficient condition for is that is the norm of an element in with respect to [28]. Of course, one may interchange and in this remark.
Specializing to quaternion algebras over the rational field , or over one of the completions or (the completion ), let be a quaternion algebra over and let be a prime (or ). We define
Either or is a division algebra over . In this case we will have that and say that is ramified at When we will say that is unramified or split at If is ramified at it is called a definite rational quaternion algebra—that is, if is definite then
If is split at , it is called an indefinite rational quaternion algebra—that is, if is indefinite then
2.1.1. Definite quaternion algebras over totally real number fields
We now turn to the quaternion algebras that are the objects of interest in this paper, definite quaternion algebras over totally real number fields. Let be a quaternion algebra over a number field be a place of , and be the completion of at . Recall that a totally real number field is a finite algebraic extension of all of whose complex embeddings lie entirely in For example, the field is totally real for positive, integral If every infinite place of is ramified in we say that is a totally definite quaternion algebra. Consequently, if is a totally definite quaternion algebra over a number field then is necessarily totally real. Moreover, if is a quadratic field, the number of finite places which are ramified in is even.
2.1.2. Unit groups in orders in definite quaternion algebras over totally real number fields
Let be quaternion algebra over a field and let be the ring of integers in . An element is integral if . An order is a -algebra of integral elements such that [26, p.2]
Observe that as an example of an order we always have
(2.2) |
If is an -order in a definite quaternion algebra over the totally real field then the group of units of reduced norm 1, i.e.
(2.3) |
is a finite group [28, p.289]. These finite groups will correspond to the groups of rotational symmetries of the platonic solids [28, p.172–173].
2.1.3. Ramanujan graphs
Two key ideas are needed for the construction of golden gate and super golden gate sets: a -arithmetic unit quaternion group and a Ramanujan graph. We outline the essential ideas of Lubotzky, Phillips, and Sarnak’s [14] “LPS” construction of these objects.
Ramanujan graphs are graphs whose spectrum is bounded optimally. Let be a finite connected -regular graph and its adjacency matrix.
Definition 2.1.
The graph is called a Ramanujan graph if every eigenvalue of satisfies either or
LPS Ramanujan graphs [2] arise as Cayley graphs of (for the finite field on elements). When considering these graphs we interchangeably refer to their elements by their group-theoretic properties as matrices and their graph-theoretic relations as vertices. [14] establishes that for any prime there are infinitely many ()-regular Ramanujan graphs. We use the notation where and are distinct primes congruent to 1 modulo 4 to represent such graphs. The construction comes from number theory by way of the generalized Ramanujan conjecture [19, p.873]. The symmetric space can be identified with a ()-regular infinite tree. acts from the left on . The generalized Ramanujan conjecture, a theorem in this case, implies that the quotient of by any congruence subgroup of , a ()-regular graph, is a Ramanujan graph. By considering an appropriate congruence subgroup of we can identify the quotient of this symmetric space with a Cayley graph associated to or , depending on the value of the Legendre symbol [22].
2.1.4. -arithmetic unit quaternion groups
Golden gate and super golden gate sets for require the construction of a -arithmetic group (a special case of -arithmetic groups, where is a collection of places of ). Let be an algebraic group defined over with compact. A -arithmetic group is a subgroup of , and has congruence subgroup . That is, in our compact Lie group we take only rational numbers whose denominators are powers of a fixed prime as coefficients in the matrices.
One can also make the same construction over the ring of integers of a totally real number field , at which point the role of is played by a prime ideal of , so that the inverted elements (those allowed in denominators) are now all of .
2.2. Golden gates
Golden gates are special unit groups in quaternion algebras over totally real number fields derived from the -arithmetic groups [24]. They give variants of optimal generators for and connect the arithmetic of quaternion algebras to quantum computation on a single qubit. The “golden” characterization is to be understood by way of an interesting link between -arithmetic unit groups coming from unit quaternion groups and the Ramanujan graphs , which we explicate below.
Recall once more that in classical computation, one decomposes any function into basic logical gates such as XOR, AND, and NOR, and that in quantum computation, the classical bits are replaced by qubits, which are vectors in projective Hilbert space , and that the logical gates are all the elements of the projective unitary group Let be a subgroup of and denote by the set of -fold products of elements in . If is dense in (with respect to the standard bi-invariant metric ) then is universal. That is, any gate can be approximated with arbitrary precision as a product of elements of .
The notion of of a golden gate set is much stronger, requiring [10]:
-
(1)
Optimal covering of by : for every the set distributes in as a perfect sphere packing (or randomly placed points) would, up to a negligible factor.
-
(2)
Approximation: given and , there is an efficient algorithm to find some (the -ball around ) such that with (almost) minimal.
-
(3)
Compiling: given as a matrix, there is an efficient algorithm to write as a word in of the smallest possible length.
These requirements ensure that any gate can be approximated and compiled as an efficient circuit using the gates in .
2.3. Super golden gates
Each super golden gate set is composed of a finite group and an involution , which lie in a -arithmetic group for a prime ideal of the integers of a totally definite quaternion algebra , over a totally real number field . We require that:
-
(1)
acts simply transitively on the neighbors of any given vertex in , the ()-regular tree, for the norm of .
-
(2)
is an involution which takes a vertex to one of its neighbors.
-arithmetic unit quaternion group act transitively on the vertices of the corresponding . The -arithmetic groups which act transitively on the vertices of are called the golden gates and the -arithmetic groups which act transitively on both the vertices and edges of are called the super golden gates.
3. Icosahedral Super Golden Gates
Recall that there are only finitely many such super golden gate sets and in each case the finite group is identified with the group of rotational symmetries of a platonic solid: for the tetrahedron, ; for the cube and the octahedron, ; and for the dodecahedron and icosahedron, . Each of these finite groups can be precisely identified with a -arithmetic unit quaternion group coming from one of the following quaternion algebras [24]:
-
•
tetrahedral gates: ;
-
•
octahedral gates: ; and
-
•
icosahedral gates: .
We consider the quaternion algebra over the golden field [19, p.895]. A maximal order in is given by the ring of icosians. The unit group is the platonic icosahedral group, generated by , where is the golden ratio, and In , this corresponds to
We take as our involution
For the prime ideal one has , and the generated group is the full ()-arithmetic group of . As such, we establish:
Theorem 1.
Subject to standard number-theoretic heuristic conjectures, there exists a factorization of any to precision using -count at most
In particular, if is near to a diagonal matrix then we just apply the approach in §5 (for additive error) to get a path of length at most , and otherwise run the approach in §6.
Notice that no other choice of golden gates is both super and has a greater logarithm base, so that these are the “best” generators given the present state of knowledge.
4. Nearby Elements in PU(2), and Factoring in
In this section, we establish a key technical lemma regarding approximations in the matrix group, and the method for exact synthesis for elements of the relevant subgroup.
For satisfying we write
and for we write
We restate below [25, Lemma 5] which holds independent of our choice of universal gate set.
Lemma 1.
Select absolute constants and put . Take and in either or and write them as and . If for some and then for
we have the approximation to , satisfying
Loosely, this result can be thought of as a sufficient condition to transform one unitary into (approximately) another based only on a weak condition and by “tuning” with diagonal (rotation) matrices on either side. The condition is merely that the “starting” and “target” matrices have top-left entries nearby in absolute value, and that neither is very near to 1.
We now move to factorizing. Put for the sequel. Observe that is is a positive real number, and the generator of above. For our purposes, we will encounter elements of only as -quaternions with norm a power of , envisioned as elements of the Cayley graph for , which [19] shows acts transitively with respect to the distance measure of -count, which can be detected by counting the power of in the quaternion norm, after quotienting out -scalars. This leads to the following factoring algorithm.
Algorithm 1.
Let be a set of representatives of lifted to . Given a lift of some element of with -count , it can be factored by determining which (unique) gives rise to of -count , which in turn requires no more than 60 multiplications of three matrices. is found if and only if has all coefficients divisble by in .
This algorithm has the base case of simply comparing against all 60 elements of , another trivial computational task. The idea of the general case is that has the representation
where is not the identity for . Then will be projectively equal to , giving rise to
for (coprime to ).
5. Algorithm for Short Paths to Diagonal Elements
5.1. Algorithm
We proceed by, for given diagonal element and , seeking with . Knowing that is projectively equal to an element
for satisfying
(5.1) |
for some , we also have that it is sufficient to satisfy
(5.2) |
(note that this is precisely [21, (13) and Problem 7.4] (see there for the derivation)), following the readily computable observation that and setting the goal , since [21] operates with respect to the operator norm. Observe, unfortunately, that (5.1) is a quadratic constraint and (5.2) is a linear constraint. We now explain how to transform them into a practicable sequence of integer programs.111Fundamentally, this is the same idea as in [21], as their study of upright ellipses accomplishes the same task as Lenstra’s algorithm.
Fix . We seek satisfying (5.1) and (5.2). Define . Artificially add the constraint
(5.3) |
Observe from (5.1) that . Then, we have the sequence of implications (mainly by algebraic manipulation)
(5.4) |
and so we have reduced our consideration to just one of the four variables. As , we explicitly work with the Galois group elements
where is ’s Galois conjugate , both of which are real embeddings, yielding the additional constraints
(5.5) |
Now, putting for some , (5.3), (5.4), and (5.5) transform into
Problem 1.
Given , find satisfying the five linear constraints
Problem 0.
Given and , find satisfying the four linear constraints
Again, the existence of such a pair is determinable in time, by Lenstra’s algorithm.
Finally, if we have solutions to Problem ‣ 5.1 and Problem 1, we seek to solve
Problem 23.
Given , , and , find satisfying (5.1).
Here we change techniques. The objective is to write as a sum of squares in . Assuming efficient factorization in (or , also a PID), Problem 23 is efficiently solvable via Theorem 3 (the general approach being basically identical to the classical algorithms for or , cf. [21, §C] for the latter).
We have succeeded in the core of the algorithm. To handle given , begin by fixing . For given , attempt to solve Problem 1; for each solution, attempt to solve Problem ‣ 5.1; for each solution, attempt to solve Problem 23. If this results in a tuple satisfying all three problems, halt and return
Otherwise, if all possibilities have been exhausted, increment .
5.2. Analysis
We refer the reader to [19, §2.3]’s analysis of timing and correctness for Ross and Selinger’s algorithm generalized to any golden gate set, where the conclusion is that for desired precision , the factorization length becomes with required computational time remaining .
6. Algorithm For Short Paths
Here we largely adopt the structure and wording from [25, §4 and §5], as the core concepts and heuristics that make the algorithm work are the same in the icosahedral setting.
6.1. Algorithm
Select absolute constants . Take any where , and pick . We wish to approximate in using of the form
(6.1) |
having , the factorization length, minimized, and so we begin with . (We also have .) In particular, the objective is to approximate as where approximate well-chosen diagonals computable using §5, and has factorization computable using Algorithm 1. We will see that is designed to have factorization typically shorter than that of and , giving rise to the desired improvement.
In order to apply Lemma 1 we need to have near (that is, within ). Because which is fixed, it suffices to find candidate values for with , rewritten to
(6.2) |
Viewing as an element of , we also have , i.e. . As , it follows that , and so
(6.3) |
Now, let . Considering as an integer lattice, we adapt (6.2) and (6.3) and seek to solve
(6.4) | ||||
(6.5) | ||||
(6.6) | ||||
(6.7) |
which are convex constraints on ’s lattice components. Since this is an integer programming problem in two dimensions, we apply Lenstra’s algorithm [7, 20] to efficiently list all such lattice points . For each , using Theorem 3, we attempt to write as a sum of two squares; if possible, say , we then attempt to write as a sum of two squares. If possible, say , so we simply halt and return corresponding to (6.1). However, if may not be represented as a sum of two squares, we simply move on to the next value of and try this process again. If this fails for all arising from , we increment and run Lenstra’s algorithm for the new inequalities.
6.2. Analysis
We begin the analysis by establishing the -count and tightness of the approximation. In particular, and with factorization lengths of each up to . By Lemma 1, . Therefore, (by the triangle inequality) and since has a factorization of -count up to , this constitutes a factorization of an element in ’s neighborhood of -count up to .
The efficiency of this algorithm—that is, that it runs in time —is because we expect to halt when (so only calls are expected), and only call polynomially-many polynomial-time subroutines. The dominant subroutines are calls to Lenstra’s algorithm which as shown in [7] runs in time polynomial in the size of the constraints for any fixed dimension . Indeed, here we have only dimensions, linear constraints (two per absolute value), and the largest value in the constraints is , so the runtime is polynomial in .
The reason we expect to halt when is that heuristically, we expect to halt when the area enclosed by (6.4)–(6.7) is . Conveniently, the region is a rectangle since the vectors and are orthogonal, so assuming in the limit that (so that (6.5) and the “bottom” inequality of (6.4) are redundant), we compute length-times-width of
whence we find as expected.
When attempting to write elements of as a sum of two squares, we primarily rest on a belief, in the style of Cramér’s conjecture and a conjecture of Sardari [23, ()] that sums of squares are dense in . Seeking to analogize [23, ()] in particular, we note that the operative aspect is that a dense cluster of lattice points will represent at least one sum of two squares, and that such a point thus will be found quickly through Lenstra’s algorithm.
The significance of this result is to accomplish a factorization in in analogue to [25], but using a gate set with additional desirable properties beyond those enjoyed by the Clifford+ gates.
7. Implementation Details and Examples
Our algorithm has been implemented for proof-of-concept purposes in Python, and the code is available at https://math.berkeley.edu/~zstier/icosahedral. Included in this implementation are:
-
•
An implementation of Lenstra’s algorithm for special cases (convex.py).
-
•
The rings , , and (rings.py and quaternions.py).
-
•
Solutions to sum-of-two-square problems in (rings.py).
-
•
Factorization of elements of which are of norm a power of (quaternions.py).
-
•
Efficient factorization of diagonal elements of , as outlined in §5 (diagonal.py).
-
•
Efficient factorization of general elements of , as outlined in §6 (approx.py).
In the remainder of this section, we demonstrate the efficacy of this factorization technique on the two more “classical” single-qubit quantum gate generators; recall
In both cases, pick precision .
For the first example of , we yield
where correspond to the parenthesized terms following; this achieves precision in of . The -count is 19; compare this with the predicted . We remark that the discrepancy can be attributed to computational limitations: at key steps in the algorithm, we must run the Tonelli–Shanks algorithm for finding quadratic residues modulo some prime , which has worst-case behavior . Therefore it is only practical to abandon on instances where some prime factor is at least , something that occurred more than 328 times before the above-stated approximation was found.
For the second example of , the central element is determined to be the following:
( serves the same function as above). It has -count 9; compare this with the predicted . As before, the discrepancy can be attributed to non-vanishing of factors for explicit and to having to abandon possibilities with very large prime factors. The outer diagonal elements are determined to be the following:
(, serves the same function as above). They both have -counts of 18, with 75 collective abandoned cases; compare this with the predicted . Multiplying out gives distance in of (that this difference equals the previous one is a coincidence; they disagree at the third decimal place).
8. Concluding Remarks
This work represents a theoretical, heuristic, and proof-of-concept demonstration of a state-of-the-art methodology to construct single-qubit quantum gates, optimizing for using as few expensive gates as possible, and in particular representing an improvement of over the previous best method [25]. However, the area of efficient quantum hardware selection is far from fully explored. While [19] demonstrates that efficiently computing a length- factorization is NP-complete (for an arbitrary -element into golden gates associated to prime ), it may still be possible to achieve length- factorizations for . Another possibility is in the study of multiple qubits simultaneously, as has been initiated for by Evra and Parzanchevski [4].
9. Acknowledgements
TRB was supported, in part, by the Institute for Advanced Study and Medgar Evers College. ZS was supported by a National Science Foundation graduate research fellowship, grant numbers DGE-1752814/2146752. We are deeply indebted to Peter Sarnak for introducing us to this to this problem and for the many conversations that led to production of this paper. We are also grateful to Carlos Esparza and John Voight for their suggestions.
References
- [1] E. Carvalho Pinto and C. Petit. Better path-finding algorithms in LPS Ramanujan graphs. Journal of Mathematical Cryptology, 12(4), 2018.
- [2] G. P. Davidoff, P. Sarnak, and A. Valette. Elementary number theory, group theory, and Ramanujan graphs, volume 55. Cambridge university press Cambridge, 2003.
- [3] R. Dubisch. The wedderburn structure theorems. The American Mathematical Monthly, 54(5):253–259, 1947.
- [4] S. Evra and O Parzanchevski. Ramanujan complexes and Golden Gates in PU(3). Geometric and Functional Analysis, 2022.
- [5] S. Johansson. A description of quaternion algebras. preprint, 1997.
- [6] V. Kliuchnikov, D. Maslov, and M. Mosca. Fast and efficient exact synthesis of single qubit unitaries generated by Clifford and T gates. Quantum Information & Computation, 13(7&8), 2012.
- [7] H. W. Lenstra Jr. Integer Programming with a Fixed Number of Variables. Mathematics of Operations Research, 8(4), 1983.
- [8] D. W. Lewis. Quaternion algebras and the algebraic legacy of hamilton’s quaternions. Irish Math. Soc. Bull, 57:41–64, 2006.
- [9] The LMFDB Collaboration. Number field 4.0.400.1: .
- [10] A. Lubotzky and O. Parzanchevski. From Ramanujan graphs to Ramanujan complexes. Philosophical Transactions of the Royal Society A, 378(2163):20180445, 2020.
- [11] A. Lubotzky, R. Phillips, and P. Sarnak. Explicit expanders and the Ramanujan conjectures. In Proceedings of the eighteenth annual ACM symposium on Theory of computing, pages 240–246, 1986.
- [12] A. Lubotzky, R. Phillips, and P. Sarnak. Hecke operators and distributing points on the sphere. I. Communications on Pure and Applied Mathematics, 39(S1):S149–S186, 1986.
- [13] A. Lubotzky, R. Phillips, and P. Sarnak. Hecke operators and distributing points on . II. Communications on Pure and Applied Mathematics, 40(4):401–420, 1987.
- [14] A. Lubotzky, R. Phillips, and P. Sarnak. Ramanujan graphs. Combinatorica, 8(3):261–277, 1988.
- [15] T. Miyake. Modular forms. Springer Science & Business Media, 2006.
- [16] D. W. Morris. Introduction to arithmetic groups. arXiv preprint math/0106063, 2001.
- [17] M. A. Nielsen and I. L. Chuang. Quantum Computation and Quantum Information: 10th Anniversary Edition. Cambridge University Press, 2010.
- [18] P. Niemann, R. Wille, and R. Drechsler. Advanced exact synthesis of Clifford+ circuits. Quantum Information Processing, 19(9):1–23, 2020.
- [19] O. Parzanchevski and P. Sarnak. Super Golden Gates for PU(2). Advances in Mathematics, 327:869–901, 2018.
- [20] A. Paz. A simplified version of H.W. Lenstra’s integer programming algorithm and some applications. 1983.
- [21] N. J. Ross and P. Selinger. Optimal ancilla-free Clifford+ approximation of -rotations. Quantum Information and Computation, 2016.
- [22] N. T. Sardari. Diameter of Ramanujan graphs and random Cayley graphs with numerics. arXiv preprint arXiv:1511.09340, 1, 2015.
- [23] N. T. Sardari. Complexity of Strong Approximation on the Sphere. International Mathematics Research Notices, 2019.
- [24] P. Sarnak. Letter to Aaronson and Pollington on the Solovay–Kitaev Theorem and Golden Gates. 2015.
- [25] Z. Stier. Short paths in PU(2). Quantum Information and Computation, 21(9&10), 2021.
- [26] A. Strömbergsson. An application of an explicit trace formula to a wellknown spectral correspondence on quaternion groups. Preprint available at http://www.math.uu.se/~astrombe/papers/JLny2.ps, 2000.
- [27] M.-F. Vignéras. Arithmétique des algèbres de quaternions, volume 800 of Lecture Notes in Mathematics. Springer, Berlin, 1980.
- [28] J. Voight. Quaternion algebras. Springer Nature, 2021.
Appendix A is norm-Euclidean
Put and .
Proposition 1.
is the ring of integers of .
Proof.
Consider the canonical -basis of , namely . One readily computes its discriminant to be 400, equal to ’s, as per [9]. ∎
Consider the norm function , defined on and taking integral values on . (The absolute value here is customary but superfluous, as one of ’s -automorphisms is complex conjugation.)
In what follows, balls of radius are centered at the origin and closed and with respect to the -norm.
We shall treat interchangably with its formulation as the -space .
Theorem 2.
is norm-Euclidean; that is, is a Euclidean domain with respect to the Euclidean function .
Proof.
We use the standard reformulation that is norm-Euclidean if and only if for all there is for which . Therefore we shall attack the latter statement.
Put . Then, we readily compute
Define . Then we can also compute, for fixed and any other with ,
(A.1) |
and we shall presently obtain an effective, non-asymptotic form of this fact.
Viewing as -spaces and as the standard lattice, we can translate any element of using to one with -norm at most (that is, ), by subtracting off the “rounded” element—round each component to the nearest integer. So, it remains to verify whether every element of the vector space has (which turns out to not actually hold!). To attempt to accomplish this, we look at a refinement of . In particular, consider for well-chosen . We cover with -translates of , so that for each , for all , by (A.1) we have . The balancing act, then, is to choose small enough so that is manageable for a computer, but large enough so that is sufficiently small. There is a catch, where it is not actually the case that we can ensure that for all ; however, for those which violate this condition, we can attempt to circumvent the obstruction by translating to (where ) and then taking .222As it turns out, picking so that it shifts exactly one component towards 0 by exactly 1 is sufficient when any is necessary at all.
We now establish (A.1), after which we will be able to select . Keeping , put . Fully written out, is (the absolute value of) a degree-four polynomial in eight variables with 170 total terms, so we spare the reader its full statement. Letting ,333So that for all . however, we have that
Then, picking and , for each as well as , , , and , we test whether the right-hand side of the above is bounded by 1 for any of those five choices. The code appearing in Figure 1 verifies that this indeed comes to pass. ∎
Remark 1.
It would appear that this method would readily adapt to a computation to determine that additional number fields are norm-Euclidean, so long as one knows a basis for its ring of integers and correspondingly computes an appropriate analogue to the local effective bound KQnorm(w,x,y,z,r). Unfortunately we have been unable to reproduce this success with any other biquadratic number field of the form , .
Appendix B Irreducible elements and sums of two squares in
As in [21, §C], here we shall summarize results about classifying irreducible elements in and an efficient algorithm for writing certain elements of as a sum of two squares.
For this section, let (in contrast to as in §A). We readily compute .
Recall that is a Euclidean domain with respect to , and that (cf. [19, §4.1.4]). Also recall that is ’s Galois conjugate, which happens to equal . Extend ∙ -linearly to all of .
Proposition 2.
Let be irreducible in . If then is irreducible in . If then there is an algorithm (running in time ) to compute a -irreducible element dividing .
Proof.
If is reducible in then there exist non-units with and accordingly ; that is, .
-
•
Observe that and that neither of are quadratic residues modulo 5. This proves the first part of the proposition, as if then can never equal .
-
•
To prove the second part, we first show that if then there exists satisfying . Indeed, rewrite the equation to . Now,
with the third equality following by quadratic reciprocity. Let be any modulo- square root of . Then suffices. Set . Then but as ’s -part is not divisible by , so is not irreducible. Thus will be a non-unit divisor of , as desired. ( cannot be a unit because otherwise will also be a unit, but then there are no prime divisors of also dividing , a contradiction.)
The timing of the above method is due to the extended Euclidean algorithm for modular inverses, and the standard Euclidean algorithm for GCDs in a Euclidean domain, which have respective runtimes and .
∎
The only case not covered in the above is , which trivially factors as .
Algorithm 2.
Assume that there is an efficient blackbox algorithm to factor in time . Then there is an algorithm which factors in time .
Proof.
Factor as . Each prime is factorizable in time , by Proposition 2. There are such primes. ∎
To each irreducible , let its associated prime be the least (positive) prime factor of ; that is, when is a -irreducible times a unit, and otherwise.444Let us quickly establish why the associated prime is well-defined. Suppose are -primes with . Let be irreducibles such that if or , and otherwise; and define similarly. Then , so as irreducibles we have dividing either or , and similarly for , hence since and are themselves irreducible. Thus, is divisible by at most one prime at most twice.
Lemma 2.
For any , it is not the case that both and can be written as a sum of two squares.
Proof.
Suppose not, so write and . Then we may take the product
for some . The right-hand side expands out with 1-part555Viewing so that the “1-part” and “-part” are the corresponding components in the canonical isomorphism. equal to , but has 1-part equal to 0, so , and therefore , a contradiction. ∎
Proposition 3.
Let be irreducible, with associated prime . If then there is an efficient algorithm in time to write either or as a sum of two squares.
Observe that ( here signifying Euler’s totient function), so by Chebotarev’s density theorem the above-asserted algorithm manages to write of primes as sums of two squares.
Proof.
Before beginning in earnest, first remark that 2 factors in as , and that are irreducible because , a -irreducible.
-
•
Suppose (i.e. ). Then there exists even satisfying , that is, . Let , computed in , and set and . We claim that either or equals a squared unit times . Indeed, suppose is an irreducible divisor of . We wish to show that divides exactly one of . (Clearly it divides at least one of them, by .)
-
–
Say is an irreducible dividing and both . Then . By our choice of this is impossible.
-
–
Suppose now we let be one of . Then in order to have (where and are independent signs) we must have where . Solving for and by looking at real and imaginary parts, we have
and solving yields , so in order for to exist we must have is odd. This is a contradiction to our assumption that is even, regardless of the choice of and , thus in fact we have neither of dividing either of .
Thus, if divides with multiplicity (so that factors in as ), we must have that divides with multiplicity at least and with multiplicity 0; and so666Depending on choice of GCD algorithm, there may be a unit factor in front, but we assume not without loss of generality. while . Thus . If then .
-
–
-
•
Suppose (i.e. ). Then compute
so that there exists even which is not a multiple of 5 satisfying , that is, . Let , computed in , and set and . We claim that . Indeed, suppose is an irreducible divisor of (in ). We wish to show that divides exactly one of . (Clearly it divides at least one of them, by .)
-
–
Say is an irreducible dividing and both . Then . By our choice of this is impossible.
-
–
Suppose we let . Then as , we have
and so in fact divides neither of .
-
–
Suppose now we let be one of . Then in order to have (where and are independent signs) we must have where . Solving for and by looking at real and imaginary parts, we have
and solving yields , so in order for to exist we must have is odd. This is a contradiction to our assumption that is even, regardless of the choice of and , thus in fact we have neither of dividing either of .
-
–
It is here that we require Theorem 2, that is norm-Euclidean, as this ensures that GCDs are efficiently computable, using an Euclidean algorithm with respect to the Euclidean function (the norm). As before, the bottlenecks are in the extended and standard Euclidean algorithms, which are both of runtime . ∎
Observe that we can also include the -irreducibles and .
Theorem 3.
For , factor it as
where are all irreducible, with associated primes , and . Then either or may be written as the sum of two squares if, for all , one of the following holds:
-
•
;
-
•
;
-
•
;
and, for arbitrary not a priori satisfying all three criteria, this whole procedure (i.e., either determining a sum of two squares, or rejecting on the basis of some failing all three conditions) runs in time .
Proof.
For each , consider and defined as follows:
-
•
If then .
-
•
If then and are as computed using Proposition 3.
-
•
If then and .
Now, we do the standard (inductive) trick where . Since we have that equals either or , the resulting product from performing the trick times gives a sum of two squares equal to where . If then we return the pair , and otherwise we return .
For the runtime analysis, simply factor using Algorithm 2 and then for each resulting factor, apply Proposition 3 after checking that one of the three criteria holds (immediately halting and rejecting if any factor fails). ∎