About this map
Sections
What this is
Quantum algorithms are not written from scratch. They are assembled from a small number of reusable steps, and almost every published method is a different route through the same handful of them.
This is a map of those routes. Circles are the things an algorithm can be holding. Lines are the steps that carry you from one to the next. A method is a path across.
Nothing here is generated. Every line was read out of a paper and checked against it.
How to read it
- Something you can hold — a state, a matrix, a circuit, an answer.
- The same, in the middle of a step you have opened.
- A step. Someone has published a way through it.
- A step whose way through has not been pinned to one method.
- A step nothing published fills yet.
- A step you have opened. What is drawn inside it is how it was done.
- There is a record in the repository for this one.
How to move around
- Two fingers move the map. Pinch to zoom, or hold ctrl and scroll.
- Click a step to open it in place — everything else stays where it is.
- Click a name to read the full record without leaving the map.
- Arrow keys move, plus and minus zoom, zero puts it back.
What a line is claiming
A solid line means a paper puts those two steps together and we have the citation. A long-dashed line means the route is recorded but no single method has been named for that step. A short-dashed line means nothing published fills it — the step is real, the way through is not written yet.
A count after a step's name — ×T/h, ×O(κ) — means the route walks that step that many times rather than once. It is the source's own symbol, and the card says what it stands for and what one turn costs. A step with no count is a step no source we read said is repeated, which is not the same as one taken once.
A line drawn nested under another, on the soft shaded band behind it, is a narrower version of the line above it: the same construction, re-analysed or re-tuned, filling the same step. It is why two lines can draw the identical interior and still be two entries. Lines outside the band are alternatives to their neighbours, not versions of them.
The map does not hide the gaps. An empty step is drawn as an empty step.
What is not here yet
The map covers the algorithm literature. The repository covers circuits and primitives. They overlap less than you would expect, and where a method has no record we say so on its page rather than leaving the space blank.
Where something named here does have a record, its name links straight to it.
Method
Number-theoretic Clifford+T synthesis of z-rotations (Ross-Selinger)
Reduce approximation of a z-rotation to a grid problem over the ring plus a relative norm equation, then exactly synthesize the resulting ring element. This is the production method for z-rotations under Clifford+T.
Open the full recordFills the slot: Approximate a continuous rotation in a discrete gate set
Specific to -rotations over Clifford+T (general at higher cost), and ancilla-free. The optimality claim carries a real condition: it requires a factoring oracle, such as a quantum computer. Without one the algorithm is near-optimal only under a mild number-theoretic hypothesis, and its provable efficiency rests on that same hypothesis. Exact synthesis of the resulting ring element is unconditional (Kliuchnikov, Maslov, Mosca).
A target unitary or channel; a precision ; a metric (operator norm or diamond norm); the gate set; and whether ancillas, measurement or mixing are permitted.
Abstract circuit → Discrete-gate circuitgrid-search the ring, then exact-factor
Approximate a target -rotation by a Clifford+T operator with : first approximation: search for a candidate solving the two-dimensional grid problem , , where is -conjugation and are the -region and unit disk, then solve the relative norm equation over by factoring the integer in , and finally hand the resulting exact unitary to Kliuchnikov-Maslov-Mosca exact synthesis to emit the Clifford+T circuit. Absolute optimality (lowest possible -count among ancilla-free, deterministic single-qubit Clifford+T circuits; the paper notes ancilla-, measurement-, or state-distillation-based methods can already beat this bound) holds only given a factoring oracle for ; assumption: absent one, the algorithm is merely near-optimal — its expected -count exceeds that of the second-to-optimal solution by only , not the true optimum, under a hypothesis that each such is asymptotically as likely to be prime as a random odd integer of comparable size.
approximationassumption
A gate word, costed in T-count (or non-Clifford count).
None found yet.
given a z-rotation and a target approximation error epsilon
# specific to z-rotations over Clifford+T -- general SU(2) at higher cost
# -- and ancilla-free
reduce the approximation of the z-rotation to
a grid problem over the ring Z[1/sqrt(2), i]
plus a relative norm equation
# the record states the reduction, not how either the grid problem or the
# norm equation is solved, and this listing states neither
exactly synthesize the resulting ring element
# this stage is unconditional (Kliuchnikov, Maslov, Mosca): it needs
# neither the oracle nor the hypothesis below
return the ancilla-free Clifford+T approximation of the rotation
# T-count 3 log2(1/epsilon) + O(log log(1/epsilon)) in the typical case,
# with expected runtime O(polylog(1/epsilon)). the record names no value
# for the O(log log) term and none is supplied here
# the optimality claim carries a real condition: it requires a factoring
# oracle, such as a quantum computer. without one the algorithm is
# near-optimal only under a mild number-theoretic hypothesis, its provable
# efficiency rests on that same hypothesis, and the T-count it finds is
# m + O(log log(1/epsilon)), m the T-count of the second-to-optimal
# solution
# do not build this -- Selinger's earlier algorithm. the record calls
# Ross-Selinger the production method for z-rotations under Clifford+T; the
# earlier form is kept here only for the contrast in its stated counts:
# T-count K + 4 log2(1/epsilon), K approximately 10 for z-rotations,
# against a proved worst-case lower bound of the same form with K = -9,
# and K + 12 log2(1/epsilon) for an arbitrary SU(2) elementRoss and Selinger: T-count in the typical case, with expected runtime ; without a factoring oracle it finds T-count , where is the T-count of the second-to-optimal solution. Selinger's earlier algorithm gives T-count with approximately 10 for -rotations, against a proved worst-case lower bound of the same form with , and for an arbitrary element.
None found yet.
None found yet.
gridsynth, the reference Haskell implementation in the newsynth package
- Optimal ancilla-free Clifford+T approximation of z-rotations
Neil J. Ross, Peter Selinger · 2014
About
Ross and Selinger built this to answer their own paper's question in practice: given a -rotation and a target , produce the ancilla-free Clifford+T circuit approximating it, and produce it fast enough to be used. Section 10 of the paper is the run: "We implemented Algorithm 7.6 in the programming language Haskell; the implementation is available from [13]." Algorithm 7.6 is the paper's main algorithm, and Section 7.2 names the reduction it rests on "Reduction to a grid problem and a Diophantine equation": enumerate the solutions of the scaled two-dimensional grid problem in order of increasing least denominator exponent; for each, "attempt to find a prime factorization" of an integer derived from , skipping that candidate if none is found; solve by the algorithm of Theorem 6.2; then "use the exact synthesis algorithm of [10] to find a Clifford+T circuit implementing either or " — with — "whichever has smaller T-count". That factoring attempt is step 2(b), and it is the step this record's optimality condition hangs on: "The optimality of the algorithm hinges on step 2(b)."
Methods
The first of two sweeps ran on a single core of a 3.4GHz Intel i5-3570 CPU, approximating at from down to and reporting for each the T-count of the computed operator, the actual error in the operator norm, and a lower bound on the T-count computed by the method of Remark 8.9. Because the enumeration of grid-problem solutions is deterministic, the algorithm tends to find the same one or two solutions whenever it is re-run on the same parameters, so the runtime column was instead averaged over 50 independent runs at random angles for each , and further broken down into average candidates tried per run and time spent per candidate. The second sweep fixed six angles of the form — three with and three without — and ran each at through , to test Conjecture 8.10 on when the worst-case rather than the typical is reached; the paper states no machine for that second sweep, and Table 2 reports T-counts only, no runtimes.
Data
The inputs are analytic, not a corpus: the single operator for Table 1; 50 random angles per for the runtime averages, the paper stating no distribution for them; and for Table 2 the six explicit angles , , , , and . The released program takes the angle symbolically — `gridsynth pi/128` — and, in the page's own words, "will then automatically calculate π/128 to the required number of digits"; it also carries a `-t`/`--table` flag documented as "generate the table of results for the article", with `--count` defaulting to 50.
Code
The Haskell package `newsynth`, whose executable is `gridsynth`, by Peter Selinger and Neil J. Ross, distributed under GNU GPL version 3 or later — "either version 3 of the License, or (at your option) any later version", copyright 2012–2018 — from https://www.mathstat.dal.ca/~selinger/newsynth/ and from Hackage as `cabal install newsynth`. The paper cites version 0.3.0.1 (2015); the project page currently lists 0.3.0.4, released 2018/11/05. The Ross–Selinger algorithm lives in the module `Quantum.Synthesis.GridSynth` and is described there as "the algorithm used by the gridsynth program"; the package also carries `Quantum.Synthesis.CliffordT` for Matsumoto–Amano normal forms, `Quantum.Synthesis.MultiQubitSynthesis` for Giles–Selinger multi-qubit exact synthesis, and modules for cyclotomic and quadratic integer rings, a Diophantine solver and a one- and two-dimensional grid-problem solver. The package's own changelog dates the split: release 0.2 on 2014/03/12 "Added the new \"gridsynth\" algorithm, and removed the old \"newsynth\" algorithm", the old one being Selinger's earlier 2012 method. First public release was inside Quipper 0.4 on 2013/06/19. Precompiled 64-bit binaries are offered for Linux, Windows and macOS.
Results
On one core of a 3.4GHz Intel i5-3570 (Table 1): at , T-count 102 against a computed lower bound of , actual error , runtime 0.0190s over 3.0 candidates; at , T-count 1000 against , 0.3443s; at , T-count 9974 against , 47.9300s; at , T-count 19942 against , 383.1024s. Of that Table 1 lower-bound column the paper writes that the achieved T-count "exceeds this lower bound by at most a very small amount, which is consistent with as predicted by Proposition 8.8(b)", and that the excess "will become zero in the presence of a factoring oracle". The headline is stated as "we were able to achieve approximations up to with a T-count of under 10000 in less than 50 seconds on average", and set against its predecessor on the same machine: "This compares to a T-count of 13300 and an average runtime of 504.8 seconds reported in [14] on the same hardware", [14] being Selinger's 2012 algorithm. The measured runtimes "appear to be ". Table 2, which has no lower-bound column, separates the two regimes instead: at the T-counts were 6636, 6636 and 6630 for the three angles with , against , and 4990, 4990 and 4990 for the other three, against ; the paper reads these as "close to" the two reference values, "[a]s predicted by Conjecture 8.10".
- Optimal ancilla-free Clifford+T approximation of z-rotations
SQCT, the Single Qubit Circuit Toolkit
- Fast and efficient exact synthesis of single qubit unitaries generated by Clifford and T gates
Vadym Kliuchnikov, Dmitri Maslov, Michele Mosca · 2012
About
This is the exact-synthesis stage the Ross–Selinger pipeline hands its ring element to — the step the record calls unconditional. Ross and Selinger call it by name in Algorithm 7.6 step 3, "use the exact synthesis algorithm of [10]", their reference [10] being this paper. Kliuchnikov, Maslov and Mosca proved that in the single-qubit case the unitaries over are exactly those computable by Clifford+T circuits, and gave Algorithm 1, which turns such a unitary into a circuit with a proved optimality guarantee: "We formally show H- and T-optimality of the circuits synthesized by Algorithm 1 in Appendix B." Section 6 of the paper is titled Implementation and consists of one sentence naming the artefact.
Methods
Algorithm 1 was implemented and run as the back end of a two-stage pipeline. The front end was not the Ross–Selinger grid method, which did not yet exist: it was the authors' own implementation of the Solovay–Kitaev algorithm, used to find an approximating unitary over the ring, which Algorithm 1 then decomposed exactly. Rotations were approximated with 0 to 4 Solovay–Kitaev iterations for the published table and with 5 to 7 iterations for the longer runs. One deliberate engineering choice is recorded: of the four small circuits Algorithm 1 selects from at each step — H, HT, HT and HT — the last was written in the equivalent cheaper form HZT, which "significantly reduces the number of Phase gates required to implement a unitary". Separately, the completely bounded trace norm between the exact and approximated controlled-rotation channels was computed by semidefinite programming, since 64-bit machine precision was insufficient, using SDPA-GMP with the GNU Multiple Precision Arithmetic Library and Mathematica to generate the problem files.
Data
The targets are seven analytically specified rotations, for , , , , , and , each at Solovay–Kitaev iteration counts in Table 2. The angle convention is not the one used elsewhere on this record: the Table 2 caption defines , twice the rotation angle of the that Ross–Selinger and the pygridsynth paper write, so this paper's is the of the other two entries. The comparison baseline is Dawson's Solovay–Kitaev code, which the paper gives as "available at http://gitorious.org/quantum-compiler/", run over the library with maximal sequence length 22 and tile width 0.14. The paper states that it publishes the circuits themselves, not only their counts: "Actual specifications of all circuits reported, as well as those synthesized but not explicitly included in the Table 2, due to space constraints, may be obtained from http://qcirc.iqc.uwaterloo.ca/."
Code
SQCT — Single Qubit Circuit Toolkit — written in C++ and requiring a C++11 compiler, built with CMake, depending on Boost 1.48 (`program_options`, `chrono`, `timer`, `system`), the GNU Multiple Precision Arithmetic Library (gmp and gmpxx), the GNU MPFR Library, and Christian Schneider's `mpfr::real` for high-precision floating point. The paper gives the address as http://code.google.com/p/sqct/; that URL now redirects to https://github.com/vadym-kl/sqct, which carries both a GPL-3.0 and an LGPL-3.0 licence file. Its README states the provenance directly — "The program code based on results of http://arxiv.org/abs/1206.5236. It also implements the version of Solovay Kitaev algorithm described in http://arxiv.org/abs/quant-ph/0505030" — and its directory layout separates the two stages: `sk` for Solovay–Kitaev, `es` for exact synthesis, plus `theory` for a numerical proof of the paper's result and tests of the exact synthesis algorithm, and `appr` for optimal round-off of unitaries.
Results
These are figures for the whole two-stage pipeline, not for Algorithm 1 alone: the gate counts below are set by the Solovay–Kitaev front end, and the only column measuring the exact-synthesis stage this entry documents is . Runs used a single core of an Intel Core i7-2600 (3.40GHz), with 2.1GB of RAM required during the unitary approximation stage. In Table 2, — in this paper's doubled-angle convention, so a rotation elsewhere on this record — at gave 34388 total gates: 13722 T and T, 13722 Hadamard, 2 Phase, 6942 Pauli, at trace distance , with 2.86740s spent on the Solovay–Kitaev approximation and 0.11832s on the exact decomposition; at gave 32983 gates, 13188 of them T, at . The paper's own reading of the split is that "the implementation of our synthesis Algorithm 1 (runtimes found in the column ) is significantly faster than the implementation of the Solovay-Kitaev algorithm used to approximate the unitary". Over the full set: "The total runtime to approximate and decompose unitaries ranged from approximately 11 to 600 seconds, correspondingly, featuring best approximating errors on the order of , and circuits with up to millions of gates." Against Dawson's code, arbitrary-precision arithmetic "allowed us to achieve precision up to while Dawson's code encounters convergence problem when precision reaches ", the latter using around 6GB of memory; resynthesizing Dawson's output with Algorithm 1 cut gate counts "by about 10-20%" "[i]n most cases", and in , where Dawson's code could be run "with the sequences of length 9 only", by "about 40-60%".
- Fast and efficient exact synthesis of single qubit unitaries generated by Clifford and T gates
pygridsynth, a native Python reimplementation
- pygridsynth: A fast numerical tool for ancilla-free Clifford+T synthesis
Shuntaro Yamamoto, Nobuyuki Yoshioka · 2026
About
A second implementation of the same algorithm, built because the reference one is Haskell and the surrounding tooling is not: "A Python-native implementation is particularly valuable in this regard, as it enables seamless integration with the existing ecosystem of quantum programming frameworks and facilitates rapid prototyping, benchmarking, and deployment within standard scientific workflows." Its provenance is stated in the paper — "The implementation used in this work is based on the reference implementation by Selinger and Ross [26]", reference [26] being the newsynth page — and acknowledged from the other side: Selinger's own newsynth page lists it under Related work as "PyGridsynth, by Shuntaro Yamamoto and Nobuyuki Yoshioka. A native Python implementation of the Gridsynth algorithm. (Added December 25, 2024)."
Methods
The Ross–Selinger algorithm is reimplemented as the single-qubit -rotation kernel, with the exact-synthesis step rewriting the resulting unitary into a Clifford+T word "with no additional approximation error beyond global-phase bookkeeping". Around that kernel the library adds layers the original does not have: single-qubit unitaries via Euler decomposition plus magnitude approximation; two-qubit unitaries via a three-CNOT template whose residual rotations are absorbed into the surrounding blocks; and via recursive block ZXZ decomposition with a partial-decomposition strategy that leaves diagonal phase matrices undecomposed so they can be absorbed downstream, cutting the constant factor in the T-count. A separate mixed-synthesis workflow approximates a target channel by a probabilistic mixture of Clifford+T circuits, choosing the mixing weights by a linear program over the Pauli transfer matrix rather than the semidefinite program the construction would otherwise need. All arithmetic runs through `mpmath` at arbitrary precision, "handling error tolerances as small as while maintaining numerical stability".
Data
The paper states no provenance for the targets of the unitary-synthesis benchmark: Section 6.1 says only that the synthesis error tolerance was swept, and the Figure 6 caption that "each point corresponds to one synthesis run at a chosen tolerance ". For the mixed-synthesis runs the inputs are generated inside the library: for an -qubit target, perturbations built from randomly generated Hermitian operators — sampled uniformly from the unit sphere and then "relaxed using a repulsive force algorithm to ensure better distribution" (Appendix A) — with the unitary-synthesis tolerance set to for numerical stability, and the perturbations "redraw[n] independently" as is swept.
Code
`pygridsynth`, Python, MIT licence, by Shuntaro Yamamoto and Nobuyuki Yoshioka, at https://github.com/quantum-programming/pygridsynth and on PyPI at https://pypi.org/project/pygridsynth/ (`pip install pygridsynth`). It installs both a command-line executable, invoked as `pygridsynth <theta> <epsilon>`, and a library entry point `pygridsynth.gridsynth.gridsynth_gates(theta, epsilon)`; `mpmath` supplies the arbitrary-precision arithmetic.
Results
The paper benchmarks the library, not the Ross–Selinger -rotation kernel in isolation: it carries no rotation-only sweep, and the kernel's contribution appears only inside the analytic T-count accounting below. Section 6.1 sweeps error tolerance and records, per run, the diamond-norm distance between target and synthesized channel and the total T-count. At the curve is consistent with , which the paper decomposes as magnitude approximation contributing T gates and the two GridSynth -rotations contributing each; at the data align with ; at and they match the analytic bound . Table 2 gives mean wall time for one full unitary-synthesis call as 0.061, 0.308, 1.574 and 7.991 seconds for at , and 0.0873, 0.47, 2.283 and 11.322 seconds at ; the paper names no processor or machine for these timings. For mixed synthesis the measured post-mix error tracks the quadratic law of Lemma 1; the further factor of order that separates the curves for different is empirical only — the paper says it "can be empirically understood as mixture error picking up an additional factor of order " and that "[w]e leave the mathematical proof for such an improvement as a future work", its abstract likewise reading "we empirically find that the synthesis error is reduced from to ".
- pygridsynth: A fast numerical tool for ancilla-free Clifford+T synthesis
None found yet.
References
- Optimal ancilla-free Clifford+T approximation of z-rotations
Neil J. Ross, Peter Selinger · 2014
- Efficient Clifford+T approximation of single-qubit operators
Peter Selinger · 2012
- Fast and efficient exact synthesis of single qubit unitaries generated by Clifford and T gates
Vadym Kliuchnikov, Dmitri Maslov, Michele Mosca · 2012
Where the routes meet
11 problems nothing else needs — the places a reader arrives. Open a line to see what is recorded inside it, or click its name to go there.
13 lines have something recorded inside that you have not opened.
Of the routes that have been taken apart, 15 are built entirely from named slots, 15 hand off part of the work and finish the rest themselves, and 20 are one undivided act. None of the three is a defect; they are different things to reuse.
Every line on this figure, in words
The lines on this figure
Solve a nonlinear ODE dy/dt = F(y)
- Embed a nonlinear system into a linear one — opens into 6 · a way across — click it to open it here
- Solve a linear ODE du/dt = A(t)u + b(t) — opens into 9 · a way across — click it to open it here
- Choose a time discretization or propagator approximation → Quantum linear solve — open
- Choose a time discretization or propagator approximation — opens into 6 · a way across — click it to open it here
- Quantum linear solve — opens into 5 · a way across — click it to open it here
- Simulate Hamiltonian evolution → Estimate an observable — open
- Simulate Hamiltonian evolution — opens into 3 · a way across — click it to open it here
- Estimate an observable — opens into 4 · a way across — click it to open it here
Compile a circuit to a specific device
- NISQ transpilation (retargetable pass pipeline) — opens into 2 · a way across — click it to open it here
- Fault-tolerant compilation (Clifford+T pipeline) — open · opened: what was inside is drawn in its place
- Approximate a continuous rotation in a discrete gate set — opens into 2 · a way across — click it to open it here
Estimate an excited-state energy
- Variational quantum deflation — opens into 3 · a way across — click it to open it here
- Subspace-search variational eigensolver — opens into 3 · a way across — click it to open it here
- Quantum subspace expansion
- Quantum equation of motion
- Folded-spectrum variational eigensolver — opens into 3 · a way across — click it to open it here
- Penalty-constrained variational eigensolver — opens into 3 · a way across — click it to open it here
- Multistate contracted variational eigensolver — opens into 3 · a way across — click it to open it here
Every step you can open
1 of these have an object recorded in the middle; the rest open into the methods that fill them.
- Solve a nonlinear ODE dy/dt = F(y)
- Replace a spatial domain with a finite grid
- Discretize a PDE into one linear system
- Embed a nonlinear system into a linear one
- Solve a linear ODE du/dt = A(t)u + b(t)
- Recast a non-Hermitian generator as Hamiltonian evolution
- Choose a time discretization or propagator approximation
- Quantum linear solve
- Matrix function
- QSP phase factors
- Polynomial approximation
- Block-encode a matrix
- Prepare an input state
- Amplify a success branch
- Simulate Hamiltonian evolution
- Estimate an observable
- Compile a circuit to a specific device
- Satisfy the hardware connectivity constraint
- Approximate a continuous rotation in a discrete gate set
- Recover a noiseless expectation value by post-processing
- Build logical qubits at a target logical error rate
- Estimate a Hamiltonian's ground-state energy
- Choose a parameterised trial state
- Minimise the objective over the parameters
- Estimate an excited-state energy
- Measure what the machine can actually do
- Recover the period of a periodic function
- Estimate the eigenphase of a unitary
- Find the item a check accepts
- Walk a graph to the vertex you want
- Search a cost Hamiltonian for the assignment it minimises
What is on this map, counted
What is here, counted
147 nodes — 31 slots and 116 methods.
76 of the 147 link to a record in the Atlas, between them naming 89 records. The rest name papers and nothing else: this graph describes work the catalogue has not got yet, and the nodes with no record are the list of what a corpus pass has to go and read.
0 slots have no method recorded, and 32 methods have not been taken apart. Both are shown as what they are rather than left blank.
Every claim here rests on a source. This graph cites 140 papers; they and the 172 the Atlas cites alone are registered in one place, with what each reports and everywhere it is cited from. Papers