Signal processing techniques for efficient compilation of controlled rotations in trapped ions

Quantum logic gates with many control qubits are essential in many quantum algorithms, but remain challenging to perform in current experiments. Trapped ion quantum computers natively feature the Mølmer–Sørensen (MS) entangling operation, which effectively applies an Ising interaction to all pairs of qubits at the same time. We consider a sequence of equal all-to-all MS operations, interleaved with single-qubit gates that act only on one special qubit. Using a connection with quantum signal processing techniques, we find that it is possible to perform an arbitray SU(2) rotation on the special qubit if and only if all other qubits are in the state 1. Such controlled rotation gates with N − 1 control qubits require 2N applications of the MS gate, and can be mapped to a conventional Toffoli gate by demoting a single qubit to ancilla.


Introduction
Multiple-control gates arise in various quantum information processing tasks, ranging from basic arithmetic [1] to Grover's search method [2], which famously requires a gate that performs an inversion around just a single specific state.The prototypical example is the Toffoli N gate, which performs a bitflip (Pauli-X) on the target qubit if and only if N − 1 control qubits are in the state |1 .
Albeit conceptually simple, gates with many control qubits remain challenging to implement in current experimental quantum computers.Because single-qubit gates are typically more accurate than entangling operations, an important challenge is to decompose multiqubit operations into circuits with as few as possible two-qubit gates.To indicate, the Toffoli 3 requires at least 5 twoqubit gates [3], or when the CNOT gate is the only available entangling gate, then at least 6 CNOTs are needed [4].For a larger number of qubits, the required number of basic operations or ancilla qubits grows steeply.The Toffoli N on N qubits can be constructed through a circuit of depth O(log(N )), requiring O(N ) ancilla bits.With just a single ancilla, the best known circuits require O(N ) two-qubit gates [5][6][7].If no ancillas may be used, then a quadratic number of CNOTs are required [8].The size of these circuits has been prohibitive in scaling up quantum algorithms on current quantum computer prototypes: even though various systems with a few tens of qubits have been reported, the largest multiple-controlled gate ever performed is, to our best knowledge, the Toffoli 4 [9].
A possible workaround is to replace operations by interactions between multiple qubits that natively arise in a quantum comptuter [10][11][12][13][14].Quantum computers based on trapped ions typically deal most naturally with the Mølmer-Sørensen gate (MS) as basic entangling gate, which effectively applies an Ising interaction to all pairs of qubits for a specific amount of time [15][16][17][18].For a small number of qubits, fidelities of over 99% have been reported [19][20][21], and a large body of scientific work focuses on optimizing quantum circuits for this gate [22][23][24][25][26][27].To compare to the numbers of the Toffoli N gate, the best result we are aware of decomposes this operation into 3N − 9 MS operations interleaved with single-qubit rotations [26], requiring N −2 2 ancillary qubits and assuming that each operation may act on a different subset of qubits.

Overview of results
In this work, we consider a gate set consisting of an all-to-all MS gate that always acts on all N qubits, together with arbitrary single-qubit rotations on just a single special qubit.Our main result is that this formalism allows one to perform rotations on the special qubit that depend on the state of the other qubits.We pay particular attention to the controlled rotation gate, which performs a single-qubit rotation on the special qubit if and only if all other qubits are in the state |1 .
More precisely, we define the Mølmer-Sørensen gate acting on all N qubits in the system as where X j , Y j , Z j denote the Pauli matrices acting on qubit j.In our case, τ is fixed for a given number of qubits N .Moreover, we denote the conventional single-qubit rotations as Then, the following circuit implements the operation R z (α) on a target qubit when all other qubits (the controls) are in the state |1 : Here, the top 3 lines represent N −1 control qubits, and a total of L applications of the MS gate occur.
represents the Hadamard gate.The parameters τ, h are always +π/N and −π/N respectively, and the number of MS pulses needed is, in this case, L = 2N .The remaining unknown parameters, φ j , are discussed below.We call the resultant controlled rotation C N −1 R z (α).Note that using a local basis transformation on the target qubit, this can be turned into any controlled-SU(2) operation.More generally, a similar circuit can implement any rotation R z (α q ) on the target, where the rotation angle α q depends on the number of control qubits in the state |1 .Such operations cost L = 4N applications of the MS gate.
There is an important difference between C N −1 R x (±π) (a controlled ∓iX rotation), and the conventional Toffoli N gate, because the factor of i is not a global phase.In Eq. ( 13), we describe how the conventional Toffoli N −1 can be retrieved by demoting one of the qubits to ancilla, following [14].
The main body of this paper is devoted to linking the above circuit to the theory of equiangular composite gates, as introduced by Low, Yoder and Chuang [28].This framework allows the construction of a single-qubit unitary operation U (θ) that depends in a complicated way on some parameter θ, using a sequence of elementary gates consisting of R x (θ) and arbitrary θ-independent gates.The technique to efficiently calculate the appropriate gate sequence is often called signal processing.It proved useful in many recent breakthroughs in the design of quantum algorithms, such as quantum singular value transformations [29,30], linear combinations of unitaries [31], and efficient Hamiltonian simulation [32,33].
In this paper, we use signal processing in a very different context.Our core result is that the action of the MS gate can be interpreted as R x (θ q ) on a special qubit, where θ q depends on the number of ones among the other qubits.With this interpretation we can readily apply a known algorithm to efficiently compute the angles {φ 0 , φ 1 , . . ., φ L } that implement the required gate, depending on N and α.
The theory and implementation of quantum signal processing is rather involved, and to lower the barrier to apply our results in practice, we provide Python code that calculates these parameters in Ref. [34].In particular, the function crot_angles( N , α ) returns precisely the list of angles φ j , which can be readily plugged into the circuit in Eq. (3).Moreover, in Appendix A, we list an explicit circuit for C2 R z (π) and tabulate values of the angles Φ for N = 3, 4, 5, 6.This should allow anyone to use our results without the need to understand all the details of this paper.

Composite gate techniques
This section reviews the theory of quantum signal processing and composite gates.We follow the notation from Low, Yoder and Chuang [28], with some adjustments to make it consistent with the algorithm by Haah [35] and our own notation of the MS gate.
Let Φ = {φ 0 , φ 1 , . . ., φ L } be a list of angles (i.e.real numbers that we interpret to be periodic with period 4π)1 of length L + 1.We can then define a single-qubit rotation of the form In other words, the function F Φ maps an angle θ ∈ [0, 4π) to an element of SU (2), a unitary matrix with determinant 1.Each of the θ-dependent steps R z (−φ j )R x (θ)R z (φ j ) corresponds to a rotation around a vector pointing along the equator of the Bloch sphere, where this vector is given by cos(φ j /2)X − sin(φ j /2)Y .Any such matrix F Φ (θ) can also be decomposed in a basis of Pauli matrices 2 , Here, A, B, C, D are real functions of θ.They have to be 4π periodic in θ, and by unitarity, they satisfy the normalization condition Moreover, it was found that A and D are symmetric functions of θ, whilst B, C are anti-symmetric in θ (i.e.A(θ) = +A(−θ) and C(θ) = −C(−θ)) [35].
With the above properties, it is convenient to express A, B, C, D in their cosine or sine series.As a technical detail, an expansion over 4π periodic function takes the form A = M k=0 ãk cos(kθ/2), but due to the structure of SU(2), only frequencies of k odd (when L is odd) or k even (when L is even) can have nonzero coefficients ãk (and likewise for B, C, D) 3 .We choose to work only with the simpler case of L even, where all functions become 2π periodic in θ: In this notation, the degree of the series L/2 turns out to be half of the number of θ-dependent steps in Eq. ( 4) [28].
The reverse is also true: for any set of series A, B, C, D that is properly normalized and has largest degree L/2, there exists a sequence of angles Φ of length L + 1 such that Eq. ( 4) holds.Retrieving these angles Φ from known series A, B, C, D can be done efficiently on a classical computer using the algorithm by Haah [35], which is implemented in Python in Ref. [36].During the completion of this manuscript, two alternative approaches to retrieve Φ were announced [37,38].
This backwards-engineering step is precisely what we will exploit.In Section 3 we indicate how MS pulses can be interpreted as a single-qubit rotation of the form R x (θ q ) on the target qubit, where θ q depends on the state of the control qubits.Then, in Section 4, we find achievable cosine and sine series A, B, C, D that correspond precisely to the gate we aim to obtain, with degrees as low as possible.In fact, we only have to supply the algorithm with A and B, as it determines a suitable C and D by itself using the normalization and even/oddness.The remainder of this section consists of technical notes that one might want to skip on a first read.Firstly, we note that Haah's algorithm is slightly more general, allowing A to be chosen either even or odd, and similar (independently) for B. The downside is that in such cases, the θ-dependent single-qubit gates R z (−φ j )R x (θ)R z (φ j ) have to be replaced by θ-rotations around an arbitrary vector on the Bloch sphere.Because we did not find more efficient results in this formalism, we choose to stick with the simpler notation introduced above.Still, future work might exploit these extensions to improve on our results.
We will later see that, to obtain the advertised C N −1 R z (α) gate, it is essential that we have control over the function D, which does not directly serve as input.However, we will ensure that D is non-zero only at the special points θ = 0 or θ = π, where the anti-symmetric functions B, C are always 0. Exploiting D 2 = 1 − A 2 at these points, we can produce R z (α) by only pinning A to a specific value.

Mølmer-Sørensen in the context of single-qubit composite gates
In this section, we argue how the rotation R x (θ) (acting on a single qubit, but having θ as free parameter) can be related to the MS operation (acting on N qubits).We will see that a circuit of the form Eq. ( 3) can be broken down into invariant two-dimensional subspaces.The operation on each subspace can be described by F Φ (θ q ), where θ q depends on the state of the control qubits.
Figure 1: The left image sketches the star connectivity for a system of size n = 3.The right-hand side displays the energy spectrum of H Ising of such a system, in units of E/J.
We consider a set of N qubits, which we label by [N ] = {0, 1, . . ., N − 1}.The MS(τ ) operation is interpreted as the evolution of a certain Ising model under Schrödinger's equation for a time τ .For now, let us analyse the Ising model in the Z-basis rather than the X-basis, and allow for arbitrary interaction strength w jk between any pair j, k ∈ [N ] of qubits.The corresponding Hamiltonian reads The variable J sets an energy scale.Interactions of this form have been experimentally observed between N = 53 atoms in a Paul trap [39].In our case, we refer to qubit 0 as our special target qubit, and the other qubits will be called control qubits.We denote our quantum states in the computational basis as |b 0 , b , where b 0 ∈ {0, 1} represents the state of the target, and b ∈ {0, 1} N −1 denotes the states of the control qubits.The states |b 0 , b are the eigenstates of H Ising , whose energies we denote by E b 0 , b .
When we include arbitrary rotations on the target qubit, the Hilbert space decomposes into conserved subspaces, each of which can be labeled by the state b of the control qubits: Within each of these subspaces, the Ising Hamiltonian H Ising acts as where we defined the energy gap . Now, consider the special configuration of couplings This gives rise to a star-shaped connectivity, where all control qubits are coupled to the target, but not among each other.Now, H Ising has a spectrum as indicated in Fig. 1: the ground energy is E = −J(N − 1)/2 when all control qubits are different from the target, and +J energy is added for each control qubit that is the same.The complete eigensystem is where | b| = q ∈ {0, . . ., N −1} denotes the Hamming weight (i.e. the number of ones) of the bitstring b ∈ {0, 1} N −1 .For this configuration, H b takes a particularly simple form, as the gap ∆ b is given by hence is the same for all subspaces corresponding to the same Hamming weight q.Moreover, the mean energy vanishes for all subspaces, i.e.Ē b = 0. Now, let us turn on the couplings w jk between the control qubits, leaving the couplings connected to the target fixed at w 0,k = 1.The energy difference compared to the star coupling case can now only depend on the state b of the controls, not on the state of the target.Hence, the energy gap ∆ b = E 0, b −E 1, b will not change as a response to this.In fact, the only parameter of H b that changes is Ē b , leading to a subspace-dependent overall shift in energy.
The link between H Ising and the MS gate is as follows.Choosing uniform all-to-all couplings (w jk = 1) and unitarily evolving for a time t = τ /J precisely implements the MS(τ ) gate, up to a rotation between the X and Z eigenbases: Here, H denotes the Hadamard gate.Within the conserved subspace H b , up to an overall phase, this operation can be written as For later convenience, after 4 each MS gate we allow a single-qubit rotation R x (h) to be applied on the target qubit.The combined rotation takes the form We collect the rotation angles θ q using the set notation Θ = {θ q } N −1 q=0 , representing all the rotation angles θ q that can occur due to a combination of MS(τ ) and R x (h).The free parameters τ, h allow us to spread and shift these relevant angles over the unit circle.This approach connects the circuit in Eq. ( 3) with the composite gate defined in Eq. ( 4): the function F Φ (θ) can be implemented by a sequence of MS gates (that effectively perform R x (θ)) interleaved with R z (φ j ) rotations.The angles θ that can occur are precisely those in Θ, which depend on the state of the control qubits.Pinning the rotation F Φ (θ q ) that takes place on the target qubit whenever the control qubits have Hamming weight q is equivalent to pinning the values A(θ q ), B(θ q ), C(θ q ), D(θ q ).A last detail is the subspace-dependent phase due to Ē b , which can be straightforwardly tracked in the case of equal all-to-all interaction (w jk = 1 ∀j, k), as is the case in our definition of the MS gate.The permutation symmetry among qubits makes it straightforward to calculate the N unique values of Ē b .However, in the context of the circuit in Eq. ( 3), we follow a more intuitive approach.We observe that all the terms X j X k in the MS gate commute.Moreover, for the control qubits, each subsequent X j X k pulse is not interleaved with single-qubit gates, hence rotation angles are additive.Each of these terms associates a phase to a pair of qubits (j, k).When τ and L are chosen such that τ L = 2π, each of these phases reset regardless of the qubit state.Thus, with τ = π/N , any choice of L that is a multiple of 2N guarantees that subspace-dependent phases Ē b reset in our circuit.
We first choose convenient values values for τ and h.We aim to have all relevant angles θ q spread out in the interval [0, 2π] as much as possible, as in Fig. 2, such as to obtain series with the lowest possible degree and to allow more leeway in experimental control.Moreover, we choose θ q=N −1 = π to be at a symmetric point of the even functions A and D, such that the function value D(θ q=N −1 ) is never repeated within the function's period.Therefore, we choose5 This set of angles is obtained by setting Fitting A and B Our next step is to find low-degree cosine/sine series for A and B that satisfy Eq. (12).We choose to work only with even functions and set B = 0.The coefficients of a k as in Eq. ( 6) can be solved using the N constraints on A given in Eq. ( 12).In fact, due to symmetry we need only enforce these values for6 q = N 2 up to q = N − 1.Unfortunately, such fits would generally not respect the normalization condition A 2 + B 2 + C 2 + D 2 = 1.To enforce |A(θ)| ≤ 1, we restrict the derivatives A (θ q ) = 0.This way, whenever A(θ q ) = 1, this corresponds to a maximum of the function A. An additional advantage is that slight over-or under-rotations of θ due to an inaccurate MS gate do not affect the resulting operation, to first order in θ.Exploiting again the symmetries of A, the only values of q for which these derivatives are With this choice of A(θ), any choice of B, C, D that respects the normalization condition is automatically a valid choice for the C N −1 R z (α) gate.Firstly, at the points θ q for q = N − 1, we have set A = 1 and hence at those points, B = C = D = 0.Moreover, the point θ N −1 = π is a zero for any sine series, so normalization requires |D(θ N −1 )| = sin(α/2). 7The behavior of B, C, D at points other than θ q is irrelevant for our purposes.
From cosine series to composite gate Having found the series representation of A and B, we can input these in the algorithm by Haah [35].It finds the angles Φ that allow us to form the circuit in Eq. ( 3) with L = 2N − 2.

On relative phases due to Ē
b In its current form, the circuit in Eq. ( 3) that uses a sequence of length L = 2N − 2 will also introduce subspace-dependent phases due to Ē b .The simplest solution is to round L up to L = 2N by adding two addition steps with φ 2N −1 = 0 and φ 2N = π.These two extra steps have no net effect on the target qubit, but make sure that the MS gate performs a full 2π rotation on all pairs of control qubits.
Turning the C N −1 R z (α) into a conventional Toffoli The rotation of the form C N −1 R z (π) fundamentally differs from a conventional Toffoli N or controlled-Z operation due to the additional phase i that appears if and only if the target qubit is rotated.To get rid of this extra factor in the subspace where q = N − 1, we propose the following circuit, as inspired by Ref. [14]: The philosophy here is that the C N −1 R z (2π) gate applies the operation −1 if all control qubits are |1 and the operation 1 otherwise.Hence, this is the same as a controlled-Z gate acting only on the control qubits.A conjugation by the Hadamard H on a single qubit maps this into a conventional Toffoli N −1 , with the respective qubit taking the role of target.

Discussion and possible extensions
The number of Ising pulses L = 2N needed to implement the C N −1 R z (α) is very modest and does not depend on α.Still, for small N , there exist highly optimized decompositions that are more optimal than our results.For example, Refs.[24,26] find decompositions of, respectively, the N = 3 and N = 4 Toffoli gates into a mere 3 MS(τ ) pulses (albeit with τ not equal for all pulses).Moreover, the C 2 R x (π) operation can be implemented in just 4 CNOT operations8 .Our results are of main interest thanks to the favourable scaling with increasing N .The best similar result we are aware of is Ref. [26].It describes circuits for the Toffoli N gate that use 3N −9 MS gates and N −2 2 ancillae for even N , and 3N − 6 MS gates and N −1 2 ancillae when N is odd, both of which were major improvements over previously known results.Each of these MS gates has to act on varying subsets of qubits, and the rotation angle τ can differ per step.Using the circuit in Eq. ( 13), our proposal implements the Toffoli N using 2(N + 1) MS gates, significantly improving the scaling with N and requiring a mere 1 ancilla.Moreover, our proposal has the added advantage that all MS gates are equal: they act equally on all pairs of qubits, and require the same rotation angle τ in each gate.This simplicity is an experimental advantage, putting less constraints on control hardware and requiring fewer unique MS pulses to be optimized [41].
Our proposal is particularly suitable for the trapped ion quantum information processor described in Ref. [41].Here, the MS interactions are equal between all ions since they are mediated by longitudinal center-of-mass motion in the linear ion crystal.Furthermore, single ion addressing is possible with a focussed laser beam allowing the implementation of the single-qubit rotations.In this experimental setup, high fidelity MS gates have been implemented with up to 14 ions [42,43].Our scheme remains viable in future array-based trapped ion computers based on ion shuttling and crystal merging [44].In such a system, MS gates can remain confined to small sub-crystals.
Alternatively, much longer crystals containing > 50 ions could be considered such as in Ref. [39].However, in these systems the interactions are mediated by transverse phonons, resulting in couplings of the form w jk ∼ |j − k| −α with 0 ≤ α ≤ 3 in theory, but 0.5 ≤ α ≤ 1.8 in practice.
In general, a non-uniform Ising model would lead to two types of issues.Firstly, we consider non-uniform couplings w jk only between the control qubits.The resultant operation would look like a normal controlled rotation, perturbed by additional XX interactions among the controls.These phases can in principle be undone by a single Ising evolution that affects only the controls and has connection strengths −w jk , i.e. the negative values of the previous operation.However, there is no straightforward method of inverting the sign of the interactions for interactions mediated by transverse phonons [17].Alternatively, one may keep applying non-uniform operations with weights w jk until all the relative phases reset.The problem then reduces to finding multiples of w jk which are all integer multiples of some base strength.It seems likely that newly developed techniques for finding robust gate operations based on multiple laser frequencies could be successfully applied to find such interaction matrices [45,46].
A second type of issue arises when the connection strengths w 0k to the target qubit are no longer equal, which causes a larger set of possible values θ q .This results in series A, B, C, D with a larger degree, and hence sequences of more MS pulses.
We conclude that our proposal should be within experimental reach on devices that rely on longitudinal phonon interactions, whereas for transversal interactions further optimizations are needed.
From a theoretical perspective, many further optimizations and extensions of our protocol should be possible.For example, much can be learned from combining the intuition in Ref. [26] and our results.In particular, making τ, h different per step, and adding single-qubit rotations on the control qubits, might greatly extend the possibilities of our framework.Moreover, in the large-N limit, one might consider functions A, B, C, D that merely approximately implement a required gate, in exchange for a reduction of the number of steps L.
From a computer science perspective, we would be very interested to see lower bounds on the number of MS gates needed for certain operations.Moreover, it seems unclear to us how the gates Toffoli N and C N −1 R z (α) compare when used in algorithms in practice, and we hope that future research will find how many of each are required in realistic cases.Some results in this direction can be found in Ref. [6].
As another possible extension of our protocol, assuming again uniform weights w jk = 1, one can make controlled rotation gates that depend in a more general way on the Hamming weight of the controls.That is, one could try to implement different functions A(θ), B(θ), C(θ), D(θ) that act differently for each θ q ∈ Θ corresponding to a specific Hamming weight.For example, it should be possible to make a gate that performs R x (α 0 ) on the target whenever all controls are 0, and R x (α 1 ) whenever the controls have weight q = 1, etc, by pinning the values A(θ q ) = cos(α q ) and B(θ q ) = sin(α q ).More generally, one could try to solve for any weight-dependent operation mixing X, Y and Z operators, under the constraint that the functions A, B, C, D are properly normalized.This can be a challenging problem and is very similar to filter design problems in discrete time signal processing [47] and as also suggested by [28], one can take advantage of the wealth of existing techniques from this domain to search appropriate solutions.
Lastly, we note that our results may also be of interest for the engineering of related many-body interactions in trapped ion quantum simulators [48,49] and may be a starting point for implementing more general many-body interactions decomposed out of native quantum gates [50,51].

Conclusion
We make a connection between the all-to-all Mølmer-Sørensen gate and signal processing techniques.Our main result is that controlled rotations of the form C N −1 R z (α) can be formed by a circuit consisting of 2N MS gates plus single-qubit gates that act only on the target qubit.This operation is easily mapped to a Toffoli N −1 gate.Each of the required building blocks has been performed at high fidelity in recent experiments, indicating that our formalism can be realistically applied on near-term quantum computers.We also identify various extensions that may lead to further improvements and generalizations of our protocol.
A. An example circuit Fig. 3 shows an explicit circuit for the operation C 2 R z (−π), i.e. the double-controlled iZ gate.Here, we combined consecutive rotations of the form R z (φ j )R z (−φ j−1 ) into a new rotation R z ( φ j ) to shorten the circuit.For other system sizes N = 3, 4, 5, 6, the related angles φ 0 , . . ., φ L for the C N −1 R z (−π) operation can be foud in Table 1, where again the tilde indicates that adjacent rotations with angles φ j , −φ j−1 have been combined.Figure 3: The circuit for the C 2 R z (−π) operation derived using the method presented in this paper.
Note that adjacent R z (φ j ) operations have been merged, leading to a more compact form Eq. ( 3).Generalization to larger a larger number of qubits N is straightforward using the numbers in Table 1 The rotation angles φ j that implement a controlled-iZ operation with N − 1 controls, in the way indicated Fig. 3.Note that we chose the angle numbered 2N to be zero, such that it can be omitted.

Figure 2 :
Figure 2: An indication of the composite gate parameters for the case N = 7 and α = π.Left: Our choice of τ, h spreads the values θ q uniformly over the unit circle, with the special point θ n = −π.Right: The cosine and sine series A, B, C, D which were obtained using our fitting strategy.