WorksPhysics and Astronomy
Unitary Synthesis with a Unary Tracker
Abstract
This manuscript studies general unitary synthesis using unary-encoded ancillary register. Our first construction focuses on the -cost of unitary synthesis. We maintain a unary register that coherently tracks the computational-basis label of the data. This allows Boolean lookups to use only CNOTs and shares the precision-dependent synthesis cost across the branches of each cosine-sine decomposition (CSD) factor. For a classically specified -qubit unitary with mixing branches in its CSD, we obtain -count using clean ancillas, where and . We also give a related construction that directly applies the unitary onto a unary register to implement disjoint branches in parallel. Combining this with the quantum Shannon decomposition gives space-depth volume using arbitrary single-qubit gates and CNOTs, which matches the asymptotically optimal bound.
Introduction
Unitary synthesis is the problem of constructing a circuit of elementary quantum gates that implements a classically specified unitary. Its circuit complexity measures the resources required to implement this transformation.
We work with the universal Clifford+ gate set. In fault-tolerant quantum computing, gates can be substantially more expensive than Clifford gates because of the cost of magic-state distillation. The -count is therefore an important resource metric, and reducing it can be worthwhile even when this requires additional ancillas or Clifford operations [4, 2].
Fault-tolerant implementations also require physical qubits and repeated error correction throughout the computation. Their cost therefore depends on both the space occupied and the time for which it is needed, motivating space-depth volume, defined as the total number of qubits multiplied by the total circuit depth, as a resource metric [3].
With these resource metrics in mind, we study how the structure of a unitary affects its synthesis -count. We also consider how to reduce the ancilla requirements of our construction while retaining its asymptotic space-depth volume.
Prior work. An important ingredient in unitary synthesis is loading classically specified information into a quantum circuit. Low, Kliuchnikov, and Schaeffer studied how additional workspace can reduce the -cost of this lookup [4]. Gosset, Kothari, and Wu used boolean functions to select short single-qubit gate sequences, obtaining optimal T-counts for state preparation and diagonal unitary synthesis [2]. Tan applied this programming approach to general unitary synthesis using the cosine-sine decomposition (CSD), grouping bits together to reduce the cost of boolean function computation [9]. Other approaches use block flattening and dilation or block-sparse Hamiltonian simulation to improve the general upper bounds [10, 5].
Our construction follows the CSD and boolean function-based approach. The CSD writes an -qubit unitary as a sequence of multiplexed single-qubit operations: each multiplexer acts on one target qubit, while the other bits select which single-qubit matrix is applied [7, 9]. We call each selected single-qubit rotation a branch. There are such factors, and Boolean lookups select the gate instructions for their branches. This makes the cost of these lookups an important part of the synthesis cost.
Our approach. The current lower bound is gates for general -qubit unitary synthesis at constant approximation error [2]. This motivates us to ask when the CSD approach can reach this scale, up to precision factors. Since there are factors, our strategy is to make their Boolean lookups free in -count and account separately for the cost of maintaining the lookup addresses.
We keep a unary register that coherently tracks the computational-basis label of the data register. On a unary address, any classically specified Boolean function can be loaded using only CNOTs, so these lookups have zero -cost. We show the entire factor can be synthesized using gates for approximation error . The question is then how to maintain this address throughout the entire CSD.
We observe that within each factor of the CSD, only one data bit can change. We therefore only need to update the pairs of unary wires corresponding to the two values of that target bit. A diagonal branch leaves the label unchanged. A purely off-diagonal branch flips the target bit, so an ordinary SWAP updates its unary label. A mixing branch can create a superposition of the two target values, and we use a constant number of Fredkin gates per mixing branch to remove the old target information and restore the new information.
The resulting -count has two contributions: implementing the programmed operations and maintaining the unary tracker. The first is paid once per CSD factor, while the second depends on the number of mixing branches. This brings the bound towards the scale, up to precision factors, when the supplied factorization has sufficiently few mixing branches.
Main result. Write , and let denote the number of mixing branches for the CSD of some unitary . We obtain the following bound.
Theorem 1.1 (Mixing-sensitive unitary synthesis). Let and . Given a classically specified with mixing branches in its CSD, there is a measurement-free Clifford+ circuit using ancillas and -count
For every normalized input , it satisfies
We assume access to an ideal phase-gradient catalytic state.
The count depends on the supplied factorization, rather than being an invariant of the unitary. When is small, the tracker updates are inexpensive. However, for a dense factorization, can be , so the bound does not give a general synthesis algorithm, nor a general asymptotic improvement over SOTA.
Compared with synthesizing each CSD branch separately, our construction shares the precision-dependent cost across all branches of a factor. This replaces the naive bound with . Even for the worst-case , the precision factor therefore multiplies rather than .
This reduction in -count comes at the cost of ancillas, and the CNOT lookups can still require substantial circuit depth. We therefore consider a variant that uses a smaller reusable unary register and study how its depth changes with the available workspace.
Space-depth volume. In this variant, we transfer the quantum state itself into unary form, rather than keeping a unary tracker alongside the binary data. Operations on disjoint pairs of unary wires can then run in parallel.
Encoding the entire state in unary form still requires wires. To reduce this requirement, we instead decompose the unitary into smaller blocks and use unary encoding only within each block. We use the quantum Shannon decomposition (QSD), which builds on the CSD to express a unitary in terms of smaller uncontrolled unitaries and multiplexed single-qubit rotations [7]. We stop the recursion when the blocks fit within the available workspace.
Each block is encoded, implemented, and decoded back into binary form, leaving the unary register empty for the next block. A smaller register therefore saves ancillas but requires more blocks to be executed sequentially. Counting these steps together with the rotations between blocks gives the following tradeoff.
Theorem 1.2 (Space-depth tradeoff). Let and . Our construction uses at most ancillas to implement any -qubit unitary. With arbitrary single-qubit gates and CNOTs, and assuming unrestricted connectivity, the implementation is exact and has depth and space-depth volume
respectively.
This variant attains the known asymptotically optimal space-depth volume over this ancilla range [8, 11].
The remainder of this manuscript proceeds as follows. In Sec. 2, we introduce the notation and the lookup and synthesis ingredients. These building blocks are combined to prove Theorem 1.1 in Sec. 3. Theorem 1.2 is then proved in Sec. 4. We provide a few open questions in Sec. 5 for future work.
Preliminaries
Throughout, let be classically specified, and write . The data register D contains an arbitrary state
Unary tracking and classical lookup
Definition 2.1 (Unary tracker). For , let be a register of Hamming weight 1, with the excitation in bit position . An -qubit register A coherently tracks the data when their joint state has the form
The motivation for keeping this register is that it makes classical lookup free in the -count model, as will be described in Lemma 2.2.
Lemma 2.2 (Free boolean functions). For any classically specified boolean function , the map
on inputs of Hamming weight 1 can be implemented using only CNOTs. The output can be erased by reversing the same gates if the unary address is unchanged.
Proof. For each output bit, apply a CNOT from unary wire exactly when the corresponding bit of is 1. Only one unary wire is occupied, so the accumulated XOR is precisely . The address is untouched, and the same CNOTs reverse the map.
We use this lemma to load two tables: the gate instructions for a single-qubit rotation, and a binary approximation of a phase. The tables are computed classically from . Their lookups may use many CNOTs, but no gates.
The CSD and its branches
Definition 2.3 (Multiplexed single-qubit unitary). A unitary with target qubit is multiplexed if
where denotes the other data qubits. We call a branch and its control string.
The cosine-sine decomposition (CSD) gives a factorization of any arbitrary unitary as follows:
where each factor is a multiplexed single-qubit unitary [7]. For iteration of the CSD, we write the multiplexor as
The target qubit is the th least significant bit in , the controls of the multiplexor acts on all bits but , namely , and the branches are labeled as . Within an iteration , we rewrite our data register as , with control string and target bit . The corresponding pair of unary wires are and .
Definition 2.4 (Mixing branch count). A branch is mixing if its matrix has both nonzero diagonal and nonzero off-diagonal entries. Let be a binary indicator that equals 1 if is a mixing branch. The total number of mixing branches is therefore
This count refers to the supplied factorization (5).
We label each unitary diagonal, off-diagonal, or mixing. Diagonal branches change phases without changing the target bit. Off-diagonal branches flip the bit and may also change phases. Mixing branches can create a superposition of both target values. The following factorization lets us handle these cases separately.
Lemma 2.5 (Separating target operations from phases). Each branch can be written as a target operation followed by a phase correction:
where is diagonal. For a diagonal, off-diagonal, or mixing branch, we take to be , , or an element of , respectively. In the mixing case, the phase correction is just for some real .
Proof. For a diagonal branch, no target operation is needed: take and . For an off-diagonal branch, multiplying by makes the matrix diagonal. Thus take and . Since , we have .
For a mixing branch, we remove a single phase to make the determinant one. Since is unitary, write and set
Then , and
Hence .
For each factor, write , where
Thus, .
Single-qubit synthesis
We now describe how to implement a multiplexed single-qubit unitary using a Boolean function. For each control string , the function gives a string of and instructions and a binary approximation of the remaining phase. We load this description, apply the instructions and phase correction, and then uncompute the description. Throughout, we assume access to ideal phase-gradient states.
Lemma 2.6 (Programmed single-qubit synthesis). For a classically specified multiplexed single-qubit unitary
and error bound , there is a Boolean function , with , describing the single-qubit operation for each branch. Given a Clifford+ circuit implementing
we can synthesize a -approximation of in operator norm using gates and clean ancillas.
Proof. First, write each branch as , where . By single-qubit synthesis, we can approximate using a string of and gates, up to a known phase [6]:
We correct this extra phase when applying the remaining phase of .
Let be a common bound on the string lengths. By inserting identity instructions, we can write each string as
Each bit of tells us whether to apply its corresponding gate: 1 means apply or , and 0 applies the identity. Thus, a bitstring of length programs the rotation.
We also need to apply the phase , which we approximate with bitstring . Let and choose a -bit integer such that
We define , where is appended to the end of , so its output has length .
The circuit proceeds as follows:
Compute the description. Apply to load and . This costs gates.
Apply the rotation. For , apply controlled on , followed by controlled on . This step costs gates.
Apply the phase. Add into the phase-gradient register
to produce a phase-kickback:
The addition costs gates [1].
Uncompute the description. Apply , costing another gates. Since neither nor the description bits have changed, the description register returns to zero exactly.
On branch , we have implemented . The rotation and phase errors are each at most , so
The error of the multiplexed unitary is the maximum branch error, rather than their sum, since it is block diagonal. Computing and uncomputing the boolean function costs , and applying the rotation and phase costs gates.
The Unary-Tracking Construction
We now prove Theorem 1.1, which we restate below for convenience.
Theorem 1.1. Let and . Given a classically specified with mixing branches in a supplied CSD factorization, there is a measurement-free Clifford+ circuit using clean ancillas and -count
For every normalized input , it satisfies
We assume access to an ideal phase-gradient catalytic state.
Proof. We combine the unary lookup from Lemma 2.2 with the programmed single-qubit synthesis from Lemma 2.6. We keep one -qubit unary register that tracks the data at the start of each CSD iteration. The lookups are free in terms of -cost, and updating throughout the CSD requires two Fredkin gates per mixing branch.
Preparing the tracker
First, compute the unary label of the input data into :
Start with an excitation on unary wire 0 and read the data bits one at a time. At each level, Toffolis and CNOTs move the excitation to the wire for the corresponding binary prefix. There are splits, each costing gates, so initialization costs gates. We reverse this circuit at the end to clear the tracker.
One CSD iteration
Fix an iteration and write for its target qubit. For control string , the unary wires correspond to target values 0 and 1. Using Lemma 2.5, write the branch as . We implement it in the following steps.
Fold the tracker. For each mixing branch, apply a Fredkin gate to , controlled on the data target . If the target is 0, the excitation is already on . If it is 1, the swap moves the excitation from to . Thus,
A Fredkin gate on an unoccupied pair does nothing. Diagonal and off-diagonal branches skip this step.
Load and apply the single-qubit operation. Using Lemma 2.6, choose the gate instructions and phase correction for each branch to accuracy . On diagonal and off-diagonal branches, use exact target operations and , respectively.
The gate instructions depend only on , so we load them using CNOTs from the corresponding unary wire. The phase correction is also loaded from the tracker. For off-diagonal branches, we load the phase corresponding to the new target value. Next, we apply the programmed gates and phase-gradient addition, and then reverse the lookups. Since the tracker is unchanged throughout this step, the register containing the boolean function output gets cleaned up without garbage. The total cost is gates.
Restore the full unary label. We now update to match the new data. On a diagonal branch, no update is needed. On an off-diagonal branch, apply an ordinary SWAP to , since has flipped the target. On a mixing branch, apply a Fredkin gate to the same pair, controlled on the new target value.
Writing and for the amplitudes after the implemented rotation, the mixing-branch update gives
The tracker therefore matches the data exactly for the rotation actually implemented, even when that rotation approximates the desired one.
At the end of the iteration, tracks the updated data, and all intermediate registers are clean. We can therefore repeat the procedure for the next CSD factor.
Completing the construction and counting resources
After all factors, reverse the initial tracker computation to clear . All temporary workspace is cleared exactly, and the supplied phase-gradient state is unchanged.
Each mixing branch uses two Fredkin gates, each with -cost. The lookups and ordinary swaps use only Clifford gates. The programmed rotation and phase addition together cost gates per factor. For some iteration , the -cost is therefore .
Choose . By Lemma 2.6, each factor has error at most , including its phase correction. The errors add across the factors, giving total error at most .
Initializing and uncomputing the unary tracker costs gates. Iterating through the whole CSD gives -count:
The construction uses one -qubit tracker and clean temporary qubits, in addition to the supplied phase-gradient register. This gives clean ancillas and -count.
Space-Depth Volume Construction
We now prove Theorem 1.2. We transfer the quantum state into unary form so that different branches can run in parallel. To use fewer ancillas, we decompose the unitary into smaller blocks and implement each using the same reusable unary register.
Theorem 1.2. Let and . Our construction uses at most ancillas to implement any -qubit unitary exactly, using arbitrary single-qubit gates and CNOTs, and assuming unrestricted connectivity. Its depth and space-depth volume respectively are
Proof. We first describe the unary implementation of a small block, then use the quantum Shannon decomposition to reduce the workspace required. We count the depth of all elementary one- and two-qubit gates, with gates in the same layer acting on disjoint qubits.
Implementing a block in unary form
Consider a -qubit block and let . First, compute the unary label into a -qubit register:
We then clear the binary data using just CNOTs, so the state is now entirely held in the unary register:
Computing the unary label takes depth and clearing the binary data register also takes depth.
We implement each branch directly on its pair of unary wires . In this order, the required operation is
First, apply a CNOT from to . This maps
On both states, is now 1, while holds the target value. We can therefore apply to , controlled on . Reversing the CNOT returns the result to unary form.
For an unoccupied pair, the state is , so the controlled operation does nothing. Similarly, on input , the first CNOT flips the control bit to 0 so no operation is performed. This procedure uses gates and has depth .
Within a CSD factor, the pairs are disjoint and can run in parallel. There are factors, so implementing the block takes depth. Including encoding and decoding, one block therefore has depth . We maintain the unary register throughout so it can be uncomputed back into the data register at the end of the procedure.
Reducing the workspace using QSD
The quantum Shannon decomposition (QSD) writes a -qubit unitary as
where each is an uncontrolled -qubit unitary and and are multiplexors with the same qubits as the control string and the target is the remaining qubit [7]. We recursively decompose each , stopping when the smaller blocks fit within our qubit budget.
Given an ancilla budget , choose
and use a -qubit unary register, which is .
We stop the QSD recursion at -qubit blocks. Each level produces four smaller blocks, so after levels there are
blocks. For each block, we encode its data qubits into a -qubit unary, implement the block following the procedure from the previous subsection, and decode back into binary form. Decoding clears the unary register, allowing us to reuse the same qubits for the next block.
Each block, including encoding and decoding, takes depth. Executing all blocks sequentially therefore contributes
depth. We count the multiplexed rotations between the blocks separately below.
Counting depth and volume
We also include the multiplexed rotations between the blocks. At a -qubit QSD node, the three rotations can be implemented on the binary data using depth and no additional ancillas [7]. There are such nodes, giving total rotation depth
Combining this with the block implementations, including every encoding and decoding, gives
The circuit uses data qubits and at most ancillas. Since , its space-depth volume is
The unary register is cleared after every block, and the intervening rotations require no additional workspace. All ancillas therefore return to zero exactly.
This volume is asymptotically optimal in the worst case. A generic -qubit unitary requires continuous parameters, while each elementary gate supplies only parameters [7]. Since a layer contains at most gates, the worst-case space-depth volume is .
Conclusion
We presented a unitary synthesis construction using a unary register to track the computational-basis label of the data. This makes Boolean lookups free in -count and lets us share the precision-dependent synthesis cost across all branches of a CSD factor. Assuming access to ideal phase-gradient states, the construction uses clean ancillas and gates, where counts the mixing branches in the CSD of the unitary we are synthesizing.
We also described a variant that directly applies the unitary onto a unary register and applies the disjoint branches in parallel. Using QSD to divide the unitary into smaller blocks lets us reuse a smaller unary register. With arbitrary single-qubit gates and CNOTs, this gives depth and space-depth volume for , matching the known asymptotically optimal volume bound.
The usefulness of the mixing-sensitive bound depends on finding factorizations with small . An interesting direction is to identify classes of unitaries that admit such factorizations, or to develop methods for reducing . It would also be useful to characterize this construction in terms of its concrete fault-tolerant resource costs for practical applications.
For the -count construction, the main open question is whether the unary tracker can be updated more cheaply. Our procedure uses gates in factor . Can we reduce this to a cost polynomial in , while preserving the zero- Boolean lookups and exact cleanup? This may require a different encoding or a way to update many unary pairs together. Solving this open question would achieve an -count bound for general unitary synthesis.
A related question is whether there exists a more efficient fault-tolerant implementation of the updating to the unary tracker. In the worst case, each factor of the CSD requires Fredkin gates to update. However, these Fredkins are all controlled on the same qubit, but act on disjoint pairs. An interesting direction to explore is whether this Wide Fredkin admits a more efficient decomposition than directly implementing each gate independently. Exploiting this structure could reduce the -count or the cost of the required magic-state factories, even without changing the tracker.
Acknowledgments
The author thanks Richard Cleve, Gregory Rosenthal, Luke Schaeffer, Kewen Wu, Guillermo Alonso-Linaje, and David Wierichs for the many insightful discussions that helped motivate this project. This work was supported in part by an Undergraduate Research Assistantship (URA) from the University of Waterloo.
Use of Generative AI
The author used OpenAI’s ChatGPT to assist with editing the manuscript and checking mathematical arguments. All ideas and constructions were independently developed by the author. The author takes full responsibility for the final results and conclusions.
References
- [1]Steven A. Cuccaro, Thomas G. Draper, Samuel A. Kutin, and David Petrie Moulton. A new quantum ripple-carry addition circuit, 2004.DOI
- [2]David Gosset, Robin Kothari, and Kewen Wu. Quantum state preparation with optimal T-count. Quantum, 10:2168, 2026.
- [3]Daniel Litinski. A Game of Surface Codes: Large-Scale Quantum Computing with Lattice Surgery. Quantum, 3:128, March 2019.
- [4]Guang Hao Low, Vadym Kliuchnikov, and Luke Schaeffer. Trading T gates for dirty qubits in state preparation and unitary synthesis. Quantum, 8:1375, 2024.DOI
- [5]Diyi Liu, Shuchen Zhu, Wibe Albert de Jong, Di Fang, David Williams-Young, and Chao Yang. T-efficient unitary synthesis via block-sparse Hamiltonian simulation, 2026.arxiv.org/abs/2610.18589
- [6]Neil J. Ross and Peter Selinger. Optimal ancilla-free Clifford+T approximation of Z-rotations, 2016.arxiv.org/abs/1403.2975
- [7]V.V. Shende, S.S. Bullock, and I.L. Markov. Synthesis of quantum-logic circuits. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, 25(6):1000–1010, 2006.
- [8]Xiaoming Sun, Guojing Tian, Shuai Yang, Pei Yuan, and Shengyu Zhang. Asymptotically Optimal Circuit Depth for Quantum State Preparation and General Unitary Synthesis, 2023.arxiv.org/abs/2108.06150
- [9]Xinyu Tan. Unitary synthesis with fewer T gates, 2025.
- [10]Pei Yuan, Shengyu Zhang, and Wei Zi. Quantum Circuit for General Unitary: Improved T-count via Block Flattening and Dilation, 2026.arxiv.org/abs/2608.17846
- [11]Pei Yuan, Wei Zi, and Shengyu Zhang. Exact Unitary Synthesis: Simultaneously Optimal in Size and Depth-Ancilla Tradeoff, 2026.arxiv.org/abs/2610.07010
AI tools statement
This work lists 1 AI tool.
OpenAI’s ChatGPT · AI tool
- Roles
- Formal AnalysisWriting — review & editing
- Verification
- self-declared at submission
Recorded on the work at submission, not per version. Names and roles are shown as submitted; roles use the CRediT taxonomy.