Compiling multi-controlled quantum gates

By decomposing multi-controlled quantum gates into relative-phase and controlled-Z gates, the method addresses inefficiencies in existing implementations, resulting in reduced computational costs and errors for quantum computers.

WO2025149236A1PCT designated stage expired Publication Date: 2025-07-17UCL BUSINESS LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/EP2024/084524
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-01-12
Filing Date
2024-12-03
Publication Date
2025-07-17

AI Technical Summary

Technical Problem

Current methods for implementing multi-controlled quantum gates in quantum computers are inefficient, requiring a large number of qubits and sequential operations, leading to increased computational requirements and errors, which are costly and error-prone.

Method used

The method involves decomposing multi-controlled rotation gates into a combination of multi-qubit relative-phase gates and multi-controlled-Z gates, which are then converted into relative-phase Toffoli gates and controlled-Z gates, ultimately forming a quantum circuit using singly-controlled-NOT, Hadamard, and T gates, minimizing the number of CNOT and T gates required.

Benefits of technology

This approach significantly reduces the cost and depth of quantum circuits, making them more efficient and less error-prone, particularly for current noisy intermediate-scale quantum computers and future fault-tolerant systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure EP2024084524_17072025_PF_FP_ABST
    Figure EP2024084524_17072025_PF_FP_ABST
Patent Text Reader

Abstract

A computer-implemented method, system and computer-readable medium for compiling a quantum circuit. A multi-controlled rotation gate is decomposed into multi-qubit relative-phase gates and multi-controlled-Z gates, which are then collectively decomposed into relative-phase Toffoli gates and controlled-Z gates. The into relative-phase Toffoli gates and controlled-Z gates are then converted to base gates. A final quantum circuit comprising the base gates corresponding to the multi-controlled rotation gate is generated.
Need to check novelty before this filing date? Find Prior Art

Description

COMPILING MULTI-CONTROLLED QUANTUM GATES Technical Field

[0001] The present invention relates generally to efficient implementations of large multi- controlled quantum gates, more specifically to computer-implemented methods, systems, computer-readable mediums, quantum circuits, and quantum computers for efficiently implementing a multi-controlled rotation gate of a quantum circuit. Background

[0002] Quantum computers are computing systems which, instead of utilising classical bits having a value of 0 or 1, are based on quantum bits, referred to as ‘qubits’. Qubits may exist in a superposition of quantum states |0ۧ and |1ۧ, such that the state of a qubit |^ۧ can be describedas a linear combination of^|0ۧ and |1ۧ, such thatൌ 1.Thevalues α and β may be varied over time or through the application of operations to the qubit in the form of quantum logic gates. The application of quantum logic gates to qubits allows quantum computers to potentially be used for calculations that either cannot be calculated on classical computers, or would not be practical to calculate on classical computers.

[0003] While operations performed using classical computers are limited to binary operations which can be implemented on any classical computer, the state of a qubit can be modified in any arbitrary way via a unitary operator, which may be represented as a quantum logic gate. However, while such arbitrary modifications to the state of a qubit are mathematically possible, real-world quantum computers are limited to a particular set of quantum logic gates which may be performed on the qubits. Any unitary operator acting on a qubit can, however, be described in terms of a particular set of quantum logic gates, referred to as a universal gate set, which a real-world quantum computer may be able to implement. The efficiency of the implementation of the unitary operator may be measured in terms of the number of universal gates required to implement the unitary operator (the cost) and the number of sequential operations in the quantum circuit corresponding to the unitary operator (the depth). Minimising the cost and depth of an implementation of a unitary operator increases the efficiency of the implementation.

[0004] Present methods for implementing unitary operators in terms of a universal gate set are generally inefficient, meaning quantum computers implementing a unitary operator require comparatively a large numbers of qubits and a comparatively large number of sequential operations, which not only increases computational requirements but also results in a larger number of errors within the quantum computer, which in turn require additional computations to correct. The present invention identifies a new approach for efficiently implementing certain quantum gates in terms of a universal gate set, which results in significant efficiency improvements as compared to existing approaches. Summary of the Invention

[0005] The invention is defined by the appended claims.

[0006] According to a first aspect there is provided a computer-implemented method for compiling a multi-controlled rotation (MCR) gate of a quantum circuit for a quantum computer, the method comprising: identifying one or more parameters for a MCR gate, and a set of qubits, the set of qubits comprising: a target qubit, and a plurality of control qubits; decomposing the MCR gate into a first quantum circuit, the first quantum circuit comprising: a plurality of first rotation gates acting on the target qubit, a plurality of multi-qubit relative-phase gates (Δ) acting on a group of the 1  plurality of control qubits, and a plurality of multi-controlled-Z gates acting on the target qubit and the group of the plurality of control qubits; determining a plurality of quantum sub-circuits based on decomposing a combination of at least the plurality of multi-qubit relative-phase gates (Δ) and the plurality of multi-controlled-Z gates of the first quantum circuit, wherein each quantum sub- circuit comprises: a plurality of relative-phase Toffoli gates, and a controlled-Z gate; converting each of the plurality of relative-phase Toffoli gates and the controlled-Z gates to a plurality of base gates, the base gates being gates acting on up to two qubits, the plurality of base gates comprising: a plurality of singly-controlled-NOT gates, and one or more of: a plurality of Hadamard gates, and a plurality of T gates; identifying a final quantum circuit corresponding to the multi- controlled rotation gate, the final quantum circuit comprising the plurality of base gates and the plurality of first rotation gates acting on the target qubit; and outputting an indication of the final quantum circuit.

[0007] According to a second aspect, there is provided a quantum circuit for implementing a relative-phase Toffoli gate acting on a target qubit according to a first control qubit and a second control qubit, the quantum circuit sequentially comprising: a first H gate acting on the target qubit; a first CNOT gate acting on the first control qubit according to the target qubit; a first T gate acting on the first control qubit, and a first T† gate acting on the target qubit, wherein the first T gate and first T† gate are arranged parallel to one another; a second CNOT gate acting on the first control qubit according to the second control qubit; a third CNOT gate acting on the target qubit according to the second control qubit (the second CNOT gate and the third CNOT gate may be arranged in any order, such that the second CNOT gate may be arranged before the third CNOT gate, and vice versa); a second T† gate acting on the first control qubit, and a second T gate acting on the target qubit, wherein the second T† gate and second T gate are arranged parallel to one another; a fourth CNOT gate acting on the first control qubit according to the target qubit; and a second H gate acting on the target qubit.

[0008] According to a third aspect there is provided a quantum circuit for implementing a multi- controlled iZ gate acting on a target qubit according to a first control qubit and a second control qubit, the quantum circuit sequentially comprising: a first CNOT gate acting on the first control qubit according to the target qubit; a first T gate acting on the first control qubit, and a first T† gate acting on the target qubit, wherein the first T gate and first T† gate are arranged parallel to one another; a second CNOT gate acting on the first control qubit according to the second control qubit; a third CNOT gate acting on the target qubit according to the second control qubit; a second T† gate acting on the first control qubit, and a second T gate acting on the target qubit, wherein the second T† gate and second T gate are arranged parallel to one another; a fourth CNOT gate acting on the first control qubit according to the target qubit; and a fifth CNOT gate acting on the target qubit according to the second control qubit.

[0009] According to a fourth aspect there is provided a quantum circuit for implementing a relative-phase Toffoli gate acting on a target qubit according to a first control qubit and a second control qubit, the quantum circuit sequentially comprising: a first H gate acting on the target qubit; a first CNOT gate acting on the first control qubit according to the target qubit; a first T† gate acting on the target qubit, and a first T gate acting on the first control qubit, wherein the first T† gate and first T gate are arranged parallel to one another; a second CNOT gate acting on the target qubit according to the first control qubit; a third CNOT gate acting on the first control qubit according to the second control qubit; a fourth CNOT gate acting on the target qubit according to the first control qubit; a second T gate acting on the target qubit, and a second T† gate acting on the first control qubit, wherein the second T gate and second T† gate are arranged parallel to one 2  another; a fifth CNOT gate acting on the first control qubit according to the target qubit; and a second H gate acting on the target qubit.

[0010] According to a fifth aspect, there is provided a quantum circuit for implementing a multi- controlled iZ gate within another quantum circuit including two or more multi-controlled iZ gates, each of the multi-controlled iZ gates acting on a target qubit according to a first control qubit and a second control qubit, wherein the quantum circuit for implementing a multi-controlled iZ gate sequentially comprises: a first CNOT gate acting on the second control qubit according to the target qubit; a second CNOT gate acting on the first control qubit according to the second control qubit; a first T gate acting on the second control qubit and a first T† gate acting on the target qubit, wherein the first T gate and first T† gate are arranged parallel to one another; a third CNOT gate acting on the second control qubit according to the target qubit; a fourth CNOT gate acting on the second control qubit according to the first control qubit; a second T† gate acting on the first control qubit, and a second T gate acting on the second control qubit, wherein the second T† gate and a second T gate are arranged parallel to one another; a fifth CNOT gate acting on the first control qubit according to the second control qubit; and a sixth CNOT gate acting on the second control qubit according to the target qubit. Brief Description of the Drawings

[0011] Figure 1 illustrates a Bloch sphere representation of a logical qubit. The state of the logical qubit is on the surface of the Bloch sphere and is denoted by |^ۧ.

[0012] Figure 2 illustrates an example system for converting a quantum circuit into the execution of a quantum algorithm on a quantum computer.

[0013] Figure 3 illustrates a multi-controlled rotation gate and a condensed notation used to identify this type of gate.

[0014] Figure 4A illustrates the conversion of a MCSU2 gate around an arbitrary axis into a MCSU2 gate around the x axis.

[0015] Figure 4B illustrates the conversion of a MCSU2 gate into multi-qubit relative-phase gates and multi-controlled-Z gates.

[0016] Figure 5 illustrates the collective decomposition of a multi-qubit relative-phase gate and multi-controlled-Z gate into a chain structure.

[0017] Figure 6 illustrates the logical structure of a relative-phase Toffoli gate.

[0018] Figure 7 illustrates the collective decomposition of a multi-qubit relative-phase gate and multi-controlled-Z gate into a chain structure.

[0019] Figure 8 illustrates the collective decomposition of a multi-qubit relative-phase gate and multi-controlled-Z gate into a chain structure.

[0020] Figure 9 illustrates decompositions of a relative-phase Toffoli gate and a doubly-controlled iZ gate into Clifford+T gates.

[0021] Figure 10 illustrates decompositions of a relative-phase Toffoli gate and a doubly- controlled iZ gate into Clifford+T gates.

[0022] Figure 11 illustrates the commuting of gates within a quantum circuit to reduce the depth of the quantum circuit. 3

[0023] Figure 12 illustrates the conversion of a MCX gate into multi-qubit relative-phase gates and multi-controlled-Z gates.

[0024] Figure 13 illustrates the collective decomposition of a multi-qubit relative-phase gate and multi-controlled-Z gate into a chain structure.

[0025] Figure 14 illustrates the collective decomposition of a multi-qubit relative-phase gate and multi-controlled-Z gate into a chain structure.

[0026] Figure 15 illustrates the conversion of a MCU2 gate into multi-qubit relative-phase gates and multi-controlled-Z gates.

[0027] Figure 16 illustrates the conversion of a MCSU2 gate for a LNN quantum computer into multi-qubit relative-phase gates and multi-controlled-Z gates

[0028] Figure 17 illustrates the collective decomposition of a multi-qubit relative-phase gate and multi-controlled-Z gate into a chain structure.

[0029] Figure 18 illustrates the collective decomposition of a multi-qubit relative-phase gate and multi-controlled-Z gate into a chain structure.

[0030] Figure 19 illustrates a decomposition of a relative-phase Toffoli gate into Clifford+T gates.

[0031] Figure 20 illustrates a decomposition of a doubly-controlled iZ gate into Clifford+T gates and a SWAP gate.

[0032] Figure 21 illustrates an effective decomposition of a doubly-controlled iZ gate into Clifford+T gates.

[0033] Figure 22 illustrates the conversion of a MCX gate for a LNN quantum computer into multi- qubit relative-phase gates and multi-controlled-Z gates.

[0034] Figure 23 illustrates the conversion of a MCU2 gate for a LNN quantum computer into multi-qubit relative-phase gates and multi-controlled-Z gates.

[0035] Figure 24A illustrates the conversion of a multi-target-multi-controlled rotation gate into multi-qubit relative-phase gates and multi-target multi-controlled-Z gates.

[0036] Figure 24B illustrates the conversion of a multi-qubit relative-phase gate and a multi-target multi-controlled-Z gate into the multi-qubit relative-phase gate, a single-target multi-controlled Z gate, and two CNOT gates between the target qubits.

[0037] Figure 24C illustrates the conversion of a multi-qubit relative-phase gate and a multi-target multi-controlled-Z gate into the multi-qubit relative-phase gate, a single-target multi-controlled Z gate, and a series of CNOT gates between the target qubits.

[0038] Figure 24A illustrates the decomposition of a MCSU2 gate for a LNN quantum computer around an arbitrary axis into a MCSU2 gate around the x axis.

[0039] Figure 24B illustrates the relocation of a target qubit within a set of qubits.

[0040] Figure 24C illustrates a chain of partial swap gates for relocating a qubit within a set of qubits. 4

[0041] Figure 24D illustrates the conversion of a multi-target-multi-controlled rotation gate for an LNN quantum computer into multi-qubit relative-phase gates and multi-target multi-controlled-Z gates.

[0042] Figure 24E illustrates the decomposition of a multi-target multi-controlled-Z gate and a multi-qubit relative-phase gate into a singly-controlled multi-target Z gate, and a chain structure of relative phase Toffoli gates and CNOT gates.

[0043] Figure 24F illustrates the decomposition of a multi-target multi-controlled-Z gate and a multi-qubit relative-phase gate into a singly-controlled multi-target Z gate, and a chain structure of relative phase Toffoli gates and CNOT gates.

[0044] Figure 24G illustrates the conversion of a singly-controlled multi-target Z gate into a cascade of CNOT gates.

[0045] Figure 26 illustrates the relocation of a control qubit within a set of qubits.

[0046] Figure 27 illustrates the relocation of a target qubit within a set of qubits.

[0047] Figure 28 illustrates a computing system for carrying out examples of the present disclosure.

[0048] Figure 29 illustrates a computer-implemented method according to the present disclosure. Detailed Description Qubits and Quantum Gates

[0049] Quantum computing encompasses computing technologies which use quantum bits, referred to as ‘qubits’, to store information and perform calculations. The state of a qubit |^ۧcan exist in a superposition of two states^|0ۧand |1ۧ, and as such may be described as a linear combination of^|0ۧ and |1ۧ, such that |^ۧ = ^|0ۧ + ^|1ۧ, where α and β are complex numbers and|^|ଶ ^ |^|ଶ ൌ 1. Upon measuring the state of a qubit, the qubit takes a value of either^|0ۧ or |1ۧbased on the probability amplitudes|^|ଶand|^|ଶ^for the states^|0ۧand |1ۧrespectively. Qubitstherefore rely on quantum mechanical principles and phenomena in order to operate as intended. Qubits are generally visualised via a Bloch sphere, as shown in Figure 1. The statea qubit 100 may be considered a vector on magnitude 1 on the Bloch sphere, which has three axes: x, y and z. The states^|0ۧand |1ۧexist on opposite points on the Bloch sphere, where the z axis extends between ^|0ۧand |1ۧ, and the x and y axes are orthogonal to the z axis and to each other. The angle θ is defined between the z axis andand the angle φ is defined between the x axis

[0050] The state of a qubit, namely the values of α and β (or θ and φ) may change over time, or may be changed by performing operations on the qubit. Such operations are often referred to as quantum logic gates, or ‘quantum gates’. Quantum gates may modify the state of the qubit to any point on the Bloch sphere, and as such the range of operations that may be performed on a qubit is far greater than a classical bit, which can only be flipped between the two states. For example, quantum gates may rotate the state of qubit on the Bloch sphere. An example of such a quantum gate is the X gate, also referred to as the NOT gate. The X gate rotates the state of the qubit π radians about the x axis. As such, a qubit in state^|0ۧ is flipped to^|1ۧ, and vice versa. Similar rotations may be performed around the Y axis and Z axis, referred to as Y and Z gatesrespectively. A Y gate maps |0ۧ to ^^|0ۧ, and maps^|1ۧ to – ^|0ۧ by rotating the state of the qubit πradians about the y axis, and a Z gate leaves^|0ۧunchanged but maps |1ۧto െ|1ۧby rotating the state of the qubit π radians about the z axis, thereby changing the relative phase ^^ఝof the qubit 5  state. Another common gate is the Hadamard gate, also referred to as the H gate, which convertsa state of^|0ۧ or |1ۧ into an equal superposition of both states. The H gate corresponds to a ^ൗ 2radians rotation about the y axis, followed by a π radians rotation about the x axis. Common gates also include the S gate and T gate. The S gate, commonly referred to as the phase gate, which leaves the probability of each state unchanged, but rotates the state of the qubit around the z axisby ^ൗ 2 radians, such that ^ ൌ √^. The T gate is similar to the S gate and rotates the state of thequbit around the z axis by ^ൗర4radians, such that ^ ൌ √^ ൌ √^.

[0051] Each of the above-described gates operate on single qubits, however some quantum gates may operate on multiple qubits. An example of such a gate is a controlled-NOT gate, also referred to as a controlled-X gate and abbreviated to a CNOT or CX gate. A CNOT gate applies a NOT gate to a target qubit based on whether a control qubit is in the state^|0ۧor |1ۧ. In particular, if the state of the control qubit is^|0ۧthe target qubit is unchanged, and if the state of the control qubit is |1ۧa NOT gate is applied to the target qubit. While CNOT gates are one of the most common multi-qubit gates, other multi-qubit gates exist. For example, substantially any single qubit gate (such as those described above) may be implemented as a controlled gate, where the operation of the gate is only applied if a control qubit is in state |1ۧ. A specific example is a controlled-Z gate, where a Z gate is applied to a target qubit if a control qubit is in state |1ۧ.

[0052] The aforementioned controlled gates are described as operating on a target based on the state of a control qubit, however so-called multi-controlled gates may be implemented, where a gate is performed on a target qubit based on the state of multiple control qubits. That is, the gate is applied to a target qubit if the state of each of the control qubits is |1ۧ. An example of such a gate is the Toffoli gate, also referred to as the CCNOT gate, which is a multi-controlled NOT gate. A NOT gate is applied to a target qubit only if two control qubits are in state |1ۧ. The Toffoli gate is just one example of a multi-controlled gate, however other multi-controlled gates may be implemented where any arbitrary gate may be implemented based on substantially any number of control gates.

[0053] In addition to standard quantum gates, the Hermitian conjugate (also referred to as the Hermitian adjoint, Hermitian or adjoint), denoted by the†symbol, of some gates may be applied to particular qubits. For example, while the T gate rotates the state of the qubit around the z axisby radians, the T† gate rotates the state of the qubit around the z axis by െ^ൗ 4 radians.

[0054] Quantum gates acting on one or more of a set of qubits may be combined with one another to form a quantum circuit. Such quantum circuits allow calculations and processing to be performed using the qubits. While such quantum circuits can be simulated on classical computers, the complexity of such simulations rises exponentially with the number of qubits. Furthermore, implementing said quantum circuits on real-world quantum computers often prove challenging. Physical Quantum Computers

[0055] The aforementioned description has discussed qubits and quantum gates in a mathematical sense, however quantum computers implement qubits and quantum gates using physical systems which use quantum mechanical properties to represent logical (i.e. mathematical) qubits. The precise form of such a real-world quantum computer can vary significantly. For example, quantum computing technologies include superconducting qubit quantum computing, trapped ion quantum computing, and neutral atom quantum computing, however many other forms of quantum computing technology exist.

[0056] Superconducting qubit quantum computers generally include superconducting circuits including Josephson junctions, where the state of a qubit is determined, for example, by the charge in a portion of the superconducting circuit, or the current flux within a portion of the 6  superconducting circuit. In such cases, the state of a single superconducting qubit may be altered using pulses of electromagnetic (EM) radiation (e.g. microwave radiation) of a particular frequency and phase incident on the superconducting circuit, which rotate the state of the qubit about the x or z axes. As such, these pulses may be used to apply quantum gates to the superconducting qubits. Trapped ion quantum computers use ions trapped is a particular location as qubits, where the state of the qubit is determined by the excitation state of the ion and whether the ion has decayed from the excited state to the ground state. In some implementations, the state of qubits may be controlled using lasers incident on the trapped ion, where the properties of the laser, such as the frequency, pulse length, and polarisation, affects the manipulation of the quantum state. As such, these factors are adjusted to create different quantum gates. Neutral atom quantum computing involves trapping individual atoms (often Rydberg atoms), for example using optical tweezers, where the state of a qubit is determined by the excitation state of the atom, and whether the atom has decayed from the excited state to the ground state. In certain examples, the state of the qubit may be altered using pulses of EM radiation (such as light), which alter the state of the neutral atom, thereby altering the qubit state.

[0057] Each of these above-discussed quantum computing technologies are capable of implementing the CNOT, H, S, and T gates discussed above. Moreover, it should be noted that many other types of quantum computing technologies exist, but that in general these quantum computing technologies are capable of implementing the CNOT, H, S, and T gates discussed above, although in some cases particular ones of these gates may be implemented through applying a combination of multiple other gates. In other words, the Clifford+T gates may not necessarily be fundamental gates for a particular type of quantum computer, such that the quantum computer may not necessarily be capable of implementing each of the Clifford+T gates in only a single qubit interaction, however the quantum computers are generally capable of implementing each of the Clifford+T gates using one or more qubit interactions.

[0058] Physical quantum computers present a number of challenges, one of which is that they produce a large number of errors. These errors can be caused by a variety of factors, such as quantum decoherence, where the physical qubit stops behaving in a manner that approximates a logical qubit after a certain period of time. Errors can similarly be introduced by noise (for example from neighbouring qubits), or through the application of gates in a manner which does not closely mimic logical (i.e. mathematical) quantum gates (e.g. due to misconfiguration or miscalibration of physical equipment). These errors generally scale with the size (i.e. number of qubits) of the quantum computer, and the size of the quantum circuit being implemented. A larger number of errors in the physical quantum computer may require additional quantum computing resources to account for these errors, for example by providing redundancy, therefore multiplying the engineering requirements for the quantum computer.

[0059] An additional challenge with such physical quantum computing systems is the inability of such systems to implement generic gates acting on an arbitrary number of qubits. For example, current physical quantum computers may, for example, only be able to implement quantum gates acting on one, two, or three qubits, depending on the quantum computing technology used. As such, large multi-qubit gates (including multi-controlled gates with more than one or two control qubits) may not be directly implementable by physical quantum computers. In other words, a physical quantum computer might not be able to implement such a gate in a single operation.

[0060] Furthermore, some quantum computing technologies are limited in terms of the physical separation of qubits when applying multi-qubit gates to qubits. For example, some quantum computing technologies allow to all-to-all connectivity (ATA), where there is no restriction on the physical locations of qubits for multi-qubit gates. Conversely, some quantum computing technologies may only provide linear-nearest-neighbour connectivity (LNN), where a multi qubit gate can only act on qubits physically adjacent one another. For example, for a CNOT gate the 7  target qubit and control qubit would need to be adjacent one another in LNN quantum computing technologies. These limitations associated with physical quantum computers may therefore need to be considered when designing quantum gates or quantum circuits to ensure that said circuits or gates can be physically implemented. Universal Gate Sets

[0061] All quantum gates are unitary operators, and as such any arbitrary quantum gate can be decomposed into a sequence of gates from a universal set of quantum gates. In other words, a universal set of quantum gates is a set of quantum gates from which any arbitrary quantum gate can be expressed. An example of such a universal set of quantum gates is the set of ‘Clifford+T’ gates. This set of gates is the Clifford gates: the CNOT, H and S gates, with the addition of the T gate, all described above. The Clifford+T gates also include the Hermitian conjugates of the gates therein, namely the S†and T†gates (the CNOT and H gates are their own Hermitian conjugates). However for the purposes of brevity, in the following discussion it should be assumed when referring to a T gate that the gate may be a T gate or a T†gate, and an S gate may be an S gate or a S†gate. In other words, any quantum gate can be expressed using some combination of a finite number of CNOT, H, S (and S†), and / or T (and T†) gates. Other universal sets of quantum gates exist, such as the set of Toffoli and H gates: {Toff, H}, and the rotation operators plus phase shift gates: {Rx(θ), Ry(θ), Rz(θ), P(φ), CNOT (or other controlled rotation gate, or a controlled phase shift gate)}. Therefore, provided a physical quantum computer is able to implement a universal gate set, such as the Clifford+T gates, then such a physical quantum computer is able to implement any arbitrary quantum gate.

[0062] The quantum gates in the Clifford+T gate set {CNOT, H, S, T} act on at most one (the H, S and T gates), or two (the CNOT gate) gates. As such, the Clifford+T gates can be implemented on most physical quantum computers, such that decomposing a quantum gate or circuit into Clifford+T gates allows such a quantum gate or circuit to be implemented on most physical quantum computers, regardless of the exact quantum technology used. Compilers for quantum computers in the current noisy intermediate-scale quantum (NISQ) era often decompose arbitrary gates into Clifford+T gates. Moreover, methods appropriate for future fault-tolerant quantum computers generally also decompose arbitrary gates into Clifford+T gates. The decomposition of an arbitrary quantum gate into Clifford+T gates is not necessarily unique, such that there can potentially be a multitude of different decompositions. However, such decompositions can involve a significant number of Clifford+T gates, the exact number of Clifford+T gates depending on the gate being decomposed, and the decomposition used. As such, decompositions of large quantum gates can come at significant cost (number of gates) and depth (number of sequential operations). In the current NISQ era, physical quantum computers are generally prone to errors, for example due to quantum decoherence, noise, or imprecise gate application. These errors scale with the cost and depth of a quantum circuit, such that the greater the cost and / or depth of the quantum circuit, the greater the likelihood of errors. This in turn may require additional quantum circuitry (i.e. additional qubits and gates) in order to mitigate these errors and provide a functioning quantum computer. Quantum Compilers

[0063] Quantum circuits (also referred to as quantum algorithms) are generally developed at high-levels of abstraction, and are agnostic to any particular type of quantum computing technology and the capabilities of such quantum computing technologies. Compilers for quantum computers (also referred to as quantum compilers) are used in converting a quantum circuit into instructions for the hardware of a quantum computer. Part of this process may include decomposing complex quantum gates, such as quantum gates acting on several qubits, into a larger number of smaller gates, each acting on fewer numbers of qubits, such as up to two qubits. This usually includes decomposing such complex quantum gates into a predefined set of gates 8  (such as a universal gate set) and, if necessary, converting any of the gates of the predefined set of gates which are not implementable using a single qubit interaction with the quantum computing hardware into a combination of multiple predefined gates which are each implementable using a single qubit interaction with the quantum computing hardware. That is, a quantum computer may have a predefined finite set of gates which it is known to be able to implement. In other words, a quantum complier may have a predefined set of gates for a particular quantum computer into which a quantum circuit is decomposed.

[0064] Figure 2 illustrates an example system 200 for converting a logical quantum circuit into qubit interactions. The system 200 includes a quantum circuit 210 which is intended to be executed by a quantum computer 235. The quantum circuit 210 may in principle include any combination of one or more quantum gates, and may be created by a user or determined autonomously. A circuit compiler (i.e. quantum compiler) 220 may receive the quantum circuit 210 and decompose the quantum circuit 210 into base quantum gates which are implementable by the quantum computer 235 which is intended to implement the quantum circuit 210. The circuit compiler 220 may receive an indication of the base quantum gates. The indication of the base quantum gates may be indicated by a user or received from the quantum computer 235 itself, or another external entity. The circuit compiler may be provided with or may access a set (or database) of decompositions, where certain quantum gates or combinations of quantum gates are decomposed into a particular known arrangement of base quantum gates. Furthermore, the circuit compiler 220 may be implemented on the same computing system on which the quantum circuit 210 is determined, or the circuit compiler 220 may be implemented on a different computing system to the computing system on which the quantum circuit 210 is determined.

[0065] In addition to decomposing the quantum circuit 210 into quantum gates which are implementable by the quantum computer 235, the circuit compiler 220 may also modify the decomposed quantum circuit in order to make the decomposed quantum circuit more efficient. In particular, the circuit compiler 220 may reduce the cost and / or depth of the decomposed quantum circuit by reducing the number of base quantum gates (by combining certain quantum gates into an alternative arrangement of base quantum gates) or by commuting certain quantum gates earlier in the quantum circuit, where certain base quantum gates may be executable in parallel with one another (i.e. executed simultaneously or within a threshold time period of one another). The circuit compiler 220 may also be provided with or may access a set (or database) of efficiency modifications which may be made to a decomposed quantum circuit to reduce the cost and / or depth of the quantum circuit.

[0066] The decomposed quantum circuit may then be converted into a set of instructions for the quantum computer 235, for example by an instruction generator 230. The instruction generator 230 receives the decomposed quantum circuit and converts the decomposed quantum circuit into a set of physical operations to be carried out by the qubit interaction hardware 250 of the quantum computer 235, corresponding to the decomposed quantum circuit. The instruction generator 230 may be a separate logical entity to the circuit compiler 220, or the instruction generator 230 and circuit compiler 220 may be part of the same logical entity. Therefore, the instruction generator 230 and circuit compiler may be implemented on the same computing device, or on different computing devices. Furthermore, while the instruction generator 230 is shown as being outside the quantum computer 235, the instruction generator 230 may in some cases be considered to be part of the quantum computer 235.

[0067] The particular hardware instructions output by the instruction generator 230 may depend on the quantum computer itself. For example, the particular hardware instructions may be determined based on type of quantum computing technology used (i.e. the form of the n qubits 261a-n in the qubit assembly 260 of the quantum computer 235 and the qubit interaction hardware 250). The particular hardware instructions output by the instruction generator 230 may also 9  depend not only on the type of quantum computing technology, but also the implementation of that quantum computing technology. That is, different quantum computers of the same type may require different hardware instructions, based on various factors, such as the qubits 261 and qubit assembly 260 (e.g. size, materials used, relative positions) and the qubit interaction hardware 250. These factors may be determined through a calibration process, whereby the manner in which the qubit interaction hardware 250 affects the state of the qubits 261 with various parameter settings (e.g. how the amplitude, pulse length, phase, and / or frequency of an EM pulse affect the state of the qubit).

[0068] Accordingly, the instruction generator 230 can output a set of instructions for the quantum computer 230 which allow the quantum computer 235 to implement the quantum circuit 210 on the qubits 261 of the qubit assembly 260. In the example of an EM pulse, the hardware instructions may include the amplitude, pulse length, phase, and / or frequency of one or more EM pulses by one or more EM pulse emitters towards one or more qubits 261a-n, and an timing and / or order of the one or more EM pulses.

[0069] A hardware controller 240 of the quantum computer 235 may configure the qubit interaction hardware to operate according to the hardware instructions generated by the instruction generator 230. As an example, the hardware controller 240 may configure an EM pulse emitter to emit one or more EM pulses having the properties indicated by the hardware instructions. The qubit interaction hardware 250 then behaves as configured by the hardware controller 240 in order to interact with the qubits 261 in the qubit assembly 260. The hardware controller 240 may receive the hardware instructions generated by the instruction generator 230, or the instruction generator may be considered to be part of the hardware controller 240 for the quantum computer 235. Furthermore, while the hardware controller 240 is shown as being part of the quantum computer 235, the hardware controller 240 may in some cases instead be considered to be a separate entity from the quantum computer 235.

[0070] Figure 2 therefore illustrates an example system for converting a logical quantum algorithm into the execution of said quantum algorithm on a quantum computer. However Figure 2 is just one example implementation, and it should be appreciated that various other arrangements not depicted or discussed herein are contemplated and that the techniques of the present disclosure are compatible with substantially any system for converting a logical quantum algorithm into the execution of said quantum algorithm on a quantum computer. Multi-Controlled Gates

[0071] As discussed above, a quantum computer may have a predefined finite set of gates which it is known to be able to implement. However, when a quantum circuit is designed, the quantum circuit is usually designed using larger gates, which allow the logical operations of the quantum circuit to be more easily appreciated. Examples of such gates include multi-controlled gates (i.e. multi-controlled rotation gates). A multi-controlled rotation gate is a rotation gate that acts on a target qubit according to the state of a plurality of control qubits. Figure 3A shows an example of a multi-controlled rotation gate. The left-hand side of Figure 3A shows that multi controlled rotation gate applies a rotation operator O to target qubit t, based on the state of n control qubits c1-cn. The rotation operator O can be substantially any operation which rotates the state of a qubit around one or more axes, by any angle. The right-hand side of Figure 3A shows a condensed illustration of the gate shown in the left-hand side of Figure 3A, where this condensed form is used throughout the present disclosure.

[0072] Multi-controlled gates, such as those shown in Figure 3A, can often be decomposed into a universal gate set (such as Clifford+T) in a number of different ways. The various decompositions may have different efficiencies, and as such it is desirable to maximise the efficiency of any decomposition of a multi-controlled gate. 10

[0073] The methods according to the present disclosure significantly reduce the CNOT and / or T gate cost and depth of decomposing multi-controlled rotation gates. In other words, the number of CNOT and / or T gates included in decompositions of multi-controlled rotation gates is significantly reduced according to the techniques of the present disclosure, and the depth of CNOT and / or T gates included in decompositions of multi-controlled rotation gates may also be significantly reduced. In particular, according to the present disclosure, multi-controlled rotation gates can be decomposed into Clifford+T gates in a manner where the cost of CNOT and T gates scales linearly with the number of control qubits for the multi-controlled rotation gates, and is significantly reduced as compared to previous approaches. Moreover, in efficiently decomposing multi-controlled rotation gates into Clifford+T gates, the present disclosure provides efficient decompositions for current NISQ era quantum computers, as well as for future fault-tolerant quantum computers.

[0074] There are various types of multi-controlled rotation gates. One type of gate is the multi- controlled SU(2) (MCSU2) gates. These are gates in the special unitary group SU(2) which are multi-controlled. Gates in the special unitary group SU(2) are gates corresponding to a matrix ofsize 2^ ൈ 2, with determinant equal to 1. Such an MCSU2 gate may selectively rotate the state ofa qubit by any angle around any axis according to the state of a plurality of control qubits. Another type of multi-controlled rotation gate is the multi-controlled X (MCX) gate, otherwise referred to as the multi-controlled NOT gate, which is a NOT gate selectively applied to a qubit according to a plurality of target qubits. Another type of multi-controlled rotation gate is the multi-controlledU(2) (MCU2) gates, which are gates corresponding to a matrix of size 2^ ൈ 2, but which do notnecessarily have determinant equal to 1. MCU2 gates also selectively rotate the state of a qubit by any angle around any axis according to the state of a plurality of control qubits.

[0075] The present disclosure provides a computer-implemented method for compiling a multi- controlled rotation gate of a quantum circuit for a quantum computer, the method comprising: identifying one or more parameters for a multi-controlled rotation gate, and a set of qubits, the set of qubits comprising: a target qubit, and a plurality of control qubits; decomposing the multi- controlled rotation gate into a first quantum circuit, the first quantum circuit comprising: a plurality of first rotation gates acting on the target qubit, a plurality of multi-qubit relative-phase gates acting on a group of the plurality of control qubits, and a plurality of multi-controlled-Z gates acting on the target qubit and the group of the plurality of control qubits; determining a plurality of quantum sub-circuits based on decomposing a combination of at least the plurality of multi-qubit relative- phase gates and the plurality of multi-controlled-Z gates of the first quantum circuit, wherein each quantum sub-circuit comprises: a plurality of relative-phase Toffoli gates, and a controlled-Z gate; converting each of the plurality of relative-phase Toffoli gates and the controlled-Z gate to a plurality of base gates, the base gates being gates acting on up to two qubits, the plurality of base gates comprising: a plurality of singly-controlled-NOT gates, and one or more of: a plurality of Hadamard gates, and a plurality of T gates; identifying a final quantum circuit corresponding to the multi-controlled rotation gate, the final quantum circuit comprising the plurality of base gates and the plurality of first rotation gates acting on the target qubit; and outputting an indication of the final quantum circuit. Multi-Controlled SU(2) (MCSU2) gates

[0076] Figure 4A (left-hand side) shows a general MCSU2 gate 400 which operates on a target qubit 430, and applies an arbitrary rotation of angle λ around an arbitrary axis ^^. The MCSU2 gate 400 applies the rotation according to the state of nccontrol qubits 420, where the nccontrol qubits 420 can be logically split into two (or more) subsets C1420(1) and C2420(2) containing nc1andnc2 qubits respectively, where ^^ ൌ ^^^ ^ ^^ଶ.11

[0077] As shown on the right section of Figure 4A, a general MCSU2 gate 400 which rotates the state of a qubit around an arbitrary axis ^^ can be decomposed into a multi-controlled rotation gate 401 applying a rotation angle λ around the x axis (or any other axis) bounded by two single-qubit rotation gates ∏ 402 acting on the target qubit. The multi-controlled rotation gate 401 acts on the target qubit according to the state of the control qubits 420. The single-qubit rotation gates ∏ 402apply a rotation of π radians about a chosen axis ^^ with a phase ^, where the x axis, the ^^ axisand the ^^ axis are on the same plane, and the angle between the x axis and the ^^ axis is equalto the angle between the ^^ axis and the ^^ axis. As such, the ^^ axis bisects the angle betweenthe x axis and the ^^ axis. Analogous techniques may be used if the multi-controlled rotation gate 401 applies a rotation around a different axis other than the x axis, where said different axis replaces the x axis in the above description.

[0078] By changing the axis of rotation of the multi-controlled rotation gate from an arbitrary axis ^^ to the x axis, the multi-controlled rotation gate can be decomposed as shown in Figure 4B. As shown on the right-hand side of Figure 4B, such an arbitrary MCSU2 gate 400 may be decomposed into a combination of single-qubit rotation gates A1-A4460, a plurality of multi-qubit relative-phase gates ^^,^ଶ,^ற^,^றଶ 450 acting on the control qubits 420, and, for each of the ^^,^ଶ,^ற^,^றଶ gates 450, a multi-controlled Z (MCZ) gate 440 acting on the target qubit 430 and a particular subset of the control qubits 420. The A1-A4gates 460 are each rotations by particularangles around the x or z axis (i.e.^ ௫^^^, or^ ௭^^^) or an H gate, depending on the particular multi-controlled gate being decomposed.

[0079] The single-qubit rotation gates A1-A4460 may each correspond one or more single-qubit rotation gates. For example, in the case of an MCSU2 gate 400, A4460(1) corresponds to arotation gate ^௫^^^^about the x axis by an angle θ1 arranged in series with a rotation gate ^௭^^ଶ^about the z axis by an angle θ2 (i.e.^ ௭^^ଶ^ is arranged after^ ௫^^^^). The angles ^^ and ^ଶ dependon the axis ^^, and may be determined based on decomposing the ∏ gates 402 into single-qubit ^௫(rotation about the x axis) gates and single-qubit ^௭(rotation about the z axis) gates, for example using Euler decompositions. In particular, the x-z-x Euler decomposition may be usedto decompose the ∏ gate 402(1) into ^௫^^^^followed by ^௭^^ଶ^followed by ^௫^^ଷ^, and as the ∏gate 402(1) is Hermitian it is equivalent to its inverse, and the ∏ gate 402(2) may be decomposedas ^௫^െ^ଷ^followed by ^௭^െ^ଶ^followed by ^௫^െ^^^. As the multi-controlled rotation gate 401rotates the target qubit 430 about the x axis, two ^௫gates commute and cancel out, resulting in A4460(1) being equivalent to ^௫^^^^ followed by ^௭^^ଶ^.

[0080] A2460(2),(4) corresponds to rotation gate ^௫^െ^ൗ 4 ^ about the x axis by an angle െ^ൗ 4 ,where λ is the angle of rotation of the MCSU2 gate 400 about the arbitrary axis ^^. A3460(3)corresponds to rotation gate ^௫^^ൗ 4 ^ about the x axis by an angle^ൗ 4. A1460(5) corresponds toa rotation gate ^௫^^ൗ 4 ^^rotation gate about the x axis by an angle^ൗ 4 , arranged in series with arotation gate^ ௭^െ^ଶ^ about the x axis by angle –θ2, arranged in series with a rotation gate^ ௫^െ^^^about the z axis by an angle –θ1(i.e. ^௫^െ^^^ is arranged after ^௭^െ^ଶ^).In other words, ^^is equivalent to ^ଷfollowed by ^றସ. It should, however, be appreciated that other single-qubit rotation gates may be used in place of the specific examples provided above. For example, if the MCSU2 gate 400 is transformed into a multi-controlled rotation gate about the y axis (as opposed to the y axis, as shown in Figure 4A), all ^௫(rotation about the x axis) gates in the single-qubit rotation gates A1-A4460 would be replaced by ^௬(rotation about the y axis) gates, and the ^^and ^ଶmay be determined using the y-z-y Euler decomposition of the ∏ gate 402.

[0081] The use of the ^^,^ଶ,^ற^,^றଶ gates 450 in the way shown in Figure 4B has no overall effect on the operator implemented by the circuit, as the phases introduced by these gates cancel out. 12  However, the addition of said ^^,^ଶ,^ற^,^றଶ gates 450 and the MCZ gates 440 allows for a particular gate decomposition. Specifically, the combination of one MCZ gate 440 and one multi- qubit relative-phase gate 450 (MCZ+^) can be decomposed into a chain structure of relative- phase Toffoli gates, and a controlled-iZ gate. This decomposition is illustrated in Figure 5. The left section of Figure 5 shows an example implementation of the ^^gate 450(1) and MCZ gate 440(1) shown in Figure 4B, where there are 9 qubits q0-q8410, where q8is the target qubit 430(i.e. ^^ ൌ 8^, qubits q0-q4 are in the first subset 420(1) of control qubits (i.e. ^^^ ൌ 5^^and qubitsq5-q7 are in the second subset 420(2) of control qubits (i.e. ^^^ ൌ 3^. MCZ gate 440(1) acts on thetarget qubit 430 and the first subset 420(1) of control qubits. The ^^gate 450(1) acts on all control qubits 420.

[0082] The middle section of Figure 5 shows the logical structure of the ^^gate 450(1) next to the MCZ gate 440. The ^^gate 450(1) equates to an ordered series of MCZ gates followed by acontrolled S gate, where the number of MCZ gates in ^^ 450(1) is ^ெ^^_௱^ ൌ ^^^ െ 2, and a jthMCZ gate in the series acts on ^^^ െ ^ control qubits of the first subset 420(1) of control qubits.Each of the series of MCZ gates in ^^450(1) also acts on a different qubit not in the first subset 420(1) of control qubits and other than the target qubit. In the present example, the non-control qubits are in the second subset 420(2) of control qubits, but may also be separate from the second subset 420(2) of control qubits.

[0083] The right-hand section of Figure 5 shows how the combination of the ^^gate 450(1) and the MCZ gate 440(1) (MCZ + ^^) acting on the target qubit 430 and the first subset 420(1) of control qubits and can be decomposed into a chain structure 500(1). The chain structure 500(1)includes a cascade 490 of relative phase Toffoli (i.e. ^ ௱^^^^gates 470, and a controlled Z gate 480located at the centre of the cascade 490 of ^ ௱^^ gates 470. The cascade 490 includes a firstportion 490(1) and a second portion 490(2), where the first portion 490(1) is arranged prior to the controlled Z gate 480, and the second portion 490(2) is arranged after the controlled Z gate 480.The first portion 490(1) includes ^ ௱^^ gates 470(1)-(3), and the second portion 490(2) includes^^ ௱^^gates 470(4)-(6) which are the same set of ^ ௱^^ gates 470(1)-(3) in the first portion 490(1) butarranged in an opposite order to the first portion 490(1). In some cases, such as in the example of Figure 5, the cascade 490 may be symmetrical.

[0084] In this specific example, the controlled Z gate 480 is a multi-controlled iZ gate, however in other examples, the controlled Z gate 480 may be a singly controlled Z gate, or the Hermitianconjugate of either of these gates. The form of a ^ ௱^^ gate is shown in Figure 6. A ^ ௱^^ acts on atarget qubit (q1in Figure 6) shown by a crossed circle, based on a first control qubit (q0in Figure 6) shown by a circled dot, and a second control qubit (q2in Figure 6) shown by a dot. The controlqubits of the ^ ௱^^ gate may sometimes be referred to as influencing qubits in order to avoidconfusion with control qubits of an overall circuit. Likewise, the target qubit of the ^ ௱^^ gate maysometimes be referred to as a focus qubit in order to avoid confusion with a target qubit of an overall circuit.

[0085] Returning to the right-hand section of Figure 5, the symmetrical cascade 490 of ^ ௱^^ gates470 is arranged such that a first ^ ௱^^ gate 470(1) of the symmetrical cascade 490 acts on a non-control qubit based on the target qubit q8430, and a control qubit in the first subset 420(1). Inother words, the target qubit of the first ^ ௱^^ gate 470(1) is qubit q7 (in the second subset 420(2)),the first control qubit is q4in the first subset 420(1) of control qubits, and the second control qubitis qubit q8 (the target qubit 430 of the multi-controlled rotation gate). Subsequent ^ ௱^^ gates470(2)-(3) in the cascade 490 act on a different non-control qubit, based on different control qubitsin the first subset 420(1) and a qubit on which the previous ^ ௱^^ gate acted. In other words, ingeneral ^ ௱^^ gates 470 in the first portion 490(1) of the symmetrical cascade 490 have: a targetqubit which is an non-control qubit that is as-yet unused in the first portion of the 490(1) of the 13  symmetrical cascade 490; a first control qubit which is a control qubit in the first subset 420(1) which is as-yet unused in the first portion of the 490(1) of the symmetrical cascade 490; and asecond control qubit which is a target qubit of an immediately previous ^ ௱^^ gate in the first portion490(1) of the symmetrical cascade 490. However, the first (i.e. initial) ^ ௱^^ gate 470(1) in the firstportion 490(1) has a second control qubit which is the target qubit 430 of the multi-controlled rotation gate.

[0086] The total number of ^ ௱^^ gates in the symmetrical cascade 490 is ^^^೩^ ൌ 2^^^^ െ 2^,where each portion 490(1),(2) of the symmetrical cascade 490 has ^^^೩^ / 2^^ ௱^^ gates 470. Thenumber of non-control qubits in the cascade 490 is also ^^^೩^ / 2. Therefore, the control qubits 420 may be divided into two (or more) subsets 420(1),(2) in order to ensure that for each subset 420(1),(2) at least ^^^೩^ / 2 control qubits are available to be used as non-control qubits. However, in some cases other non-control qubits (i.e. ancilla / dirty ancilla qubits) which are not also control qubits for the multi-controlled rotation gate 400 may be available. In such cases, it may not be necessary to divide the control qubits 420 into subsets, as these ancilla qubits may be used inplace of control qubits in a different subset. Accordingly, if ^^ െ 2 ancilla qubits are available, thedecomposition of the multi-controlled rotation gate may in some cases only include two multi- qubit relative-phase gates (i.e. ^ and ^ற) and a reduced number of single-qubit rotation gates 460. This reduced the overall cost and depth of the final quantum circuits. However, in general the decomposition of the multi-controlled rotation gate includes two or more multi-qubit relative-phase gates, for example if less than ^^ െ 2 ancilla qubits are available, the cost and depth of thefinal quantum circuit may still be reduced. For example, in some cases relative-phase Toffoli gates in a chain structure may be implemented with two second control qubits (i.e. a total of three control qubits), where each additional ancilla qubit that is available doubles the total gate reduction achieved by the techniques according to the present disclosure, as compared to the use of doubly-controlled Toffoli gates. In other words, the use of triple-controlled Toffoli gates may double the total gate reduction possible for each additional ancilla qubit.

[0087] The controlled iZ gate 480 is arranged at the centre of the symmetrical cascade 490 andacts on the qubit (q5) which is the target qubit of the final ^ ௱^^ gate 470(3) of the first portion 490(1)of the symmetrical cascade 490. The controlled iZ gate 480 acts on qubit q5according to the state of the two remaining control qubits (q0and q1) of the first subset 420(1) of control qubits which are as yet unused in the symmetrical cascade 490.

[0088] Figure 7 shows the decomposition of the combination of the MCZ gate 440(2) and the ^ଶgate 450(2) (MCZ + ^ଶ) into a chain structure 500(2). The MCZ gate 440(2) acts on the target qubit 430 and the second subset of control qubits 420(2). This chain structure 500(2) also includesa symmetrical cascade 491 of ^ ௱^^ gates 471 with a controlled Z gate 480 (specifically an iZ gate)located at the centre of the symmetrical cascade 491 of ^ ௱^^ gates 471. In this example, as theMCZ gate 440(2) acts on the target qubit 430 and the second subset of control qubits 420(2), thetotal number of ^ ௱^^ gates in the symmetrical cascade 491 is ^^^೩^ ൌ 2^^^ଶ െ 2^, where eachportion 491(1),(2) of the symmetrical cascade 491 has ^^^೩^ / 2^^ ௱^^ gates 471. The number ofnon-control qubits in the cascade 491 is also^ ^^೩^ / 2. In this example, as^ ^ଶ ൌ 3, the total numberof ^ ௱^^ gates in the symmetrical cascade 491 is ^^^೩^ ൌ 2 and each portion 491(1),(2) has one^ ௱^^ gate 471(1),(2).

[0089] The ^ ௱^^ gate 471(1) acts on a qubit q4 which is not part of the second subset 420(2) ofcontrol qubits with a qubit in the second subset 420(2) of control qubits at the first control qubit ofthe ^ ௱^^ gate 471(1), and the target qubit q8430 of the multi-controlled rotation gate as the secondcontrol qubit of the ^ ௱^^ gate 471(1). ^ ௱^^ gate 471(2) is arranged in the same way as ^ ௱^^ gate471(1) after the controlled Z gate 481, such that the chain structure 500(2) is symmetrical. The controlled Z gate 481 is a controlled iZ gate acting on the qubit (q4) which is the target qubit of the 14  final ^ ௱^^ gate 471(1) of the first portion 491(1) of the symmetrical cascade 491. The controlled iZgate 481 acts on qubit q4according to the state of the two remaining control qubits (q6and q7) of the second subset 420(2) of control qubits which are as yet unused in the symmetrical cascade 491.

[0090] Figure 8 shows the decomposition of the combination of the MCZ gate 440(3) and the ^ற^ gate 450(3) (MCZ+^ற^) into a chain structure 500(3). The chain structure 500(3) is identical to the chain structure 500(1) except that the controlled Z gate 482 in chain structure 500(3) is the Hermitian conjugate of the controlled Z gate 480 of chain structure 500(1). Similarly, the chain structure (not shown) corresponding to MCZ gate 440(4) and the ^ற றଶ gate 450(4) (MCZ+^ଶ) is identical to the chain structure 500(2) except that the controlled Z gate is the Hermitian conjugate of the controlled Z gate 481 of chain structure 500(2).

[0091] While Figures 5, 7 and 8 illustrate and describe a chain structure comprising a symmetriccascade, the symmetrical cascade comprising ^ ௱^^ gates, it should be appreciated that such acascade will necessarily be symmetrical. For example, in certain cases, additional modifications to the chain structure may be made in order to improve the efficiency of the final quantum circuit. Accordingly, throughout the present disclosure, it should be understood that any symmetrical cascade mentioned need not necessarily be symmetrical.

[0092] Using the example techniques above, an MCSU2 gate 400 can be decomposed into a combination of single-qubit rotation gates A1-A4460 and a plurality of chain structures 500 corresponding to the combination of an MCZ gate 440 and a multi-qubit relative-phase gate 450.The chain structures 500 each include ^ ௱^^ gates and multi-controlled iZ gates. The ^ ௱^^ gatesand multi-controlled iZ (CCiZ) gates may themselves be decomposed into a universal gate set, such as Clifford+T gates. However, the particular decomposition of the MCSU2 gate 400 into the single-qubit rotation gates A1-A4460 and the chain structures 500 ultimately results in low-cost and low-depth decompositions into Clifford+T gates, where the number of CNOT gates and T gates scales linearly with the number of control qubits 420 for the MCSU2 gate 400. In particular, the total CNOT cost for an MCSU2400 having ^^control qubits may be approximately 12^^, the T cost may be approximately 16^^, and both the CNOT depth and T depth may be approximately 8^^. In comparison, existing decomposition of MCSU2 gates result in a CNOT cost of approximately 20^^, a T cost of approximately 20^^, a CNOT depth of approximately 20^^, and a T depth of approximately 20^^. Accordingly, the overall reduction in the cost to a quantum computer provided by the present disclosure is significant.

[0093] Figure 9 shows possible decompositions of ^ ௱^^ gates and CCiZ gates into Clifford+Tgates. Here, each ^ ௱^^ gate can be replaced with 3 CNOT gates and 4 T gates, as well as 2 Hgates, and each CCiZ gate can be replaced with 4 CNOT gates and 4 T gates. Using the ^ ௱^^ andCCiZ decompositions shown in Figure 9, the total number of CNOT gates can be minimised.However, other decompositions of the ^ ௱^^ gates and CCiZ gates into Clifford+T gates may beused.

[0094] For example, Figure 10 shows a decomposition of ^ ௱^^ gates and CCiZ gates intoClifford+T gates according to examples of the present disclosure. Specifically, Figure 10illustrates a quantum circuit corresponding to an ^ ௱^^ gate acting on a target qubit t, according toa first control qubit c1and a second control qubit c2. The quantum circuit comprises: a first H gate acting on the target qubit; a first CNOT gate acting on the first control qubit according to the target qubit; a first T gate acting on the first control qubit, and a first T†gate acting on the target qubit, wherein the first T gate and first T†gate are arranged parallel to one another; a second CNOT gate acting on the first control qubit according to the second control qubit; a third CNOT gate acting on the target qubit according to the second control qubit (the second CNOT gate and the third CNOT gate may be arranged in any order, such that the second CNOT gate may be arranged 15  before the third CNOT gate, and vice versa); a second T†gate acting on the first control qubit, and a second T gate acting on the target qubit, wherein the second T†gate and second T gate are arranged parallel to one another; a fourth CNOT gate acting on the first control qubit according to the target qubit; and a second H gate acting on the target qubit.

[0095] While Figures 9 and 10 illustrate decompositions of the ^ ௱^^ gates and CCiZ gates intoClifford+T gates, it should be appreciated that the ^ ௱^^ gates and CCiZ gates may be decomposedinto other universal gate sets, such as {Toffoli, H}. In particular, in such a decomposition each^ ௱^^ gate may be replaced by a Toffoli gate (with corresponding target and control qubits), andthe CCiZ gate may be replaced by a CCZ gate (implemented as an H-Toffoli-H sequence, with the H gates acting on the target qubits of the Toffoli gates).

[0096] A quantum computer, such as quantum computer 235 shown in Figure 2, may be configured to implement either or both of the quantum circuits described above in relation to Figure 10, according to examples of the present disclosure. Furthermore, a controller, such as controller 240 shown in Figure 2, for a quantum computer may be configured to implement either or both of the quantum circuits described above in relation to Figure 10, according to examples of the present disclosure. In addition, instructions for implementing either or both of the quantum circuits described above in relation to Figure 10 may be embodied or encoded in a computer- readable medium, such as a computer-readable storage medium, containing instructions. Instructions embedded or encoded in a computer-readable medium may cause a programmable processor, or other processor, to cause a quantum computer to implement the quantum circuit. Computer-readable media may include non-transitory computer-readable storage media and transient communication media. Computer readable storage media, which is tangible and non- transitory, may include random access memory (RAM), read only memory (ROM), programmable read only memory (PROM), erasable programmable read only memory (EPROM), electronically erasable programmable read only memory (EEPROM), flash memory, a hard disk, a CD-ROM, a floppy disk, a cassette, magnetic media, optical media, or other computer-readable storage media. The term “computer-readable storage media” refers to physical storage media, and not signals, carrier waves, or other transient media. As noted above, computer readable media may include transient communication media. Such communication media may occur within a single computer system or between multiple computer systems, and may take the form of transient signal-conveying media such as carrier waves and transmission signals.

[0097] Figure 10 also illustrates a quantum circuit corresponding to a CCiZ gate acting on a target qubit t, according to the state of a first control qubit c1and a second control qubit c2. The quantum circuit comprises: a first CNOT gate acting on the first control qubit according to the target qubit; a first T gate acting on the first control qubit, and a first T†gate acting on the target qubit, wherein the first T gate and first T†gate are arranged parallel to one another; a second CNOT gate acting on the first control qubit according to the second control qubit; a third CNOT gate acting on the target qubit according to the second control qubit; a second T†gate acting on the first control qubit, and a second T gate acting on the target qubit, wherein the second T†gate and second T gate are arranged parallel to one another; a fourth CNOT gate acting on the first control qubit according to the target qubit; and a fifth CNOT gate acting on the target qubit according to the second control qubit.

[0098] The decompositions shown in Figure 10 minimise the total depth of T gates in the final quantum circuit at the expense of additional CNOT gates, while the decompositions shown in Figure 9 minimise the number of CNOT gates in the final quantum circuit. Accordingly, theparticular decompositions of the ^ ௱^^ gates and CCiZ gates into Clifford+T gates may be chosenbased on a particular optimisation target, such as minimal CNOT cost or minimal T gate depth. 16

[0099] In addition, certain gates may be relocated within the final quantum circuit in order to reduce the depth of particular gates, and the circuit as a whole. Figure 11 shows an example of this process. The top section of Figure 11 shows the A4gate 460(1) as the rotation gate ^௫^^^^ arranged in series with a rotation gate ^௭^^ଶ^, and the decomposed first portion 490(1) of thesymmetrical cascade 490 of ^ ௱^^ gates 470, including ^ ௱^^ gates 470(1)-(3) decomposed usingthe ^ ௱^^ gate decomposition shown in Figure 9. It can be determined that one or more of the gatesin the top section of Figure 11 are commutable. For example, the first H, T†, CNOT, and T gatesin each ^ ௱^^ gate 470 decomposition operate only on qubits which are as-yet unused in the firstportion 490(1) of the symmetrical cascade 490. Accordingly, these gates are commutable earlier in the quantum circuit, such that performing these gates earlier in the quantum circuit does not change the overall outcome of the quantum circuit. Therefore, one or more of these commutable gates can be relocated earlier within the quantum circuit and arranged in parallel with one or more other gates. This is shown in the bottom section of Figure 11, which shows an equivalent quantum circuit to the top section of Figure 11. A similar process may be applied at the end of the second portion 490(2) of the symmetrical cascade 490, where commutable gates which operate only on qubits which are unused for the reminder of the second portion 490(2) of the symmetrical cascade 490 may be relocated later in the quantum circuit and arranged in parallel with one or more other gates. Commutation or relocation of gates in these ways reduces the overall depth of the final quantum circuit.

[0100] Moreover, the commutability of gates within the final quantum circuit and the choice of the size and order of the subsets of the control qubits may allow particular gates to be cancelled out, thereby reducing the overall cost of the final quantum circuit. For example, certain CNOT gates, H gates or T gates may be cancelled out (i.e. removed from the final quantum circuit), depending on the choice of decomposition into Clifford+T gates. Moreover, if additional ancilla qubits are available, as discussed above, the commutability of gates within the final quantum circuit may also allow gates to be cancelled out (i.e. removed from the final quantum circuit).

[0101] Accordingly, the techniques according to the present disclosure allow multi-controlled rotation gates (such as an MCSU2 gate) to be compiled (i.e. decomposed) into a universal gate set, such as Clifford+T, in a manner which minimises the cost and depth of the resulting quantum circuit. In particular, multi-qubit relative-phase gates acting on the control qubits are added to the quantum circuit which are each decomposed in combination with a multi-controlled Z gate to generate a chain structure including a plurality of relative-phase Toffoli gates arranged in a symmetrical cascade, with a multi-controlled iZ gate arranged at the centre of the chain structure. The relative-phase Toffoli gates and multi-controlled iZ gate can then be decomposed into Clifford+T gates. The number of CNOT and T gates in the resulting final quantum circuit corresponding to the multi-controlled rotation gate scales linearly, and thus the cost (and depth) of the final quantum circuit is minimised. In particular, the techniques of the present disclosure may result in a CNOT cost of between 12.5^^and 12^^, a T cost of 16^^, a CNOT depth of between 12^^and 11^^, and a T depth of between 5^^and 4^^. In comparison, existing decomposition of MCSU2 gates result in a CNOT cost of approximately 20^^, a T cost of approximately 20^^,, a CNOT depth of approximately 20^^,, and a T depth of approximately 20^^,. Accordingly, the overall reduction in the cost to a quantum computer provided by the present disclosure is significant. Multi-Controlled X (MCX) gates

[0102] The techniques according to the present disclosure have been discussed in the context of the example of an MCSU2 gate, however these techniques may be equally applied to other multi- controlled rotation gates. One example, is the multi-controlled X (MCX) gate. An MCX gate 1200 is shown on the left section of Figure 12. The MCX gate acts on a target qubit 1230 according to the state of the first and second subsets 1220(1),(2) of control qubits. The middle section of Figure 17  12 shows a decomposition of the MCX gate 1200 into a multi-controlled ^௬^2^^gate 1205 and two H gates. The multi-controlled ^௬^2^^ gate 1205 acts on an ancilla qubit 1210 which is not one of the control qubits 1220, and which performs a rotation of 2π radians about the y axis according to the state of the control qubits 1220 and the target qubit 1230. The two H gates act on the target qubit 1230 and are arranged to bound (i.e. either side of) the multi-controlled ^௬^2^^gate 1205. The multi-controlled ^௬^2^^ gate 1205 has the same control qubits as the MCX gate 1200, with the original target qubit 1230 of the MCX gate 1200 also being a control qubit for the multi-controlled ^௬^2^^gate 1205.

[0103] Using this decomposition of the MCX gate, the MCX gate 1205 can be decomposed as shown in the right-most section of Figure 12. The decomposition includes a plurality of H gates 1260(1), 1260(6) acting on the target qubit 1230, a plurality of H gates 1260(2)-(5) acting on the ancilla qubit 1210, a particular subset 1220(1),(2) of the control qubits 1220, and a plurality of multi-qubit relative-phase gates ^^,^ଶ,^ற^,^றଶ 1250 acting on the control qubits 420, and, for each of the ^^,^ଶ,^ற^,^றଶ gates 1250, a MCZ gate 1240 acting on the ancilla qubit 1210, a particular subset 1220(1),(2) of the control qubits 1220, and in some cases the target qubit 1230. In particular, the MCZ gates 1240(1),(3) act on the first subset of control qubits 1220(1) and the ancilla qubit 1210, and the MCZ gates 1240(2),(4) act on the second subset of control qubits 1220(2), the ancilla qubit 1210, and the target qubit 1230. The ^^,^ற^ gates 1250(1),(3) are identical to the respective ^ற ற^,^^gates 450(1),(3) shown in Figure 4B, except that in the ^^,^^gates 1250(1),(3) the first and last ^ ௱^^ gates of the chain structure use the ancilla qubit 1210 asthe second control qubit.

[0104] Figure 13 shows the decomposition of the combination of the MCZ gate 1240(1) and the ^^gate 1250(1). In Figure 13, there are 10 qubits q0-q9, where q8is the target qubit 1230, qubits q0-q4are in the first subset 1220(1) of control qubits^and qubits q5-q7are in the second subset 1220(2) of control qubits, and qubit q9is the ancilla qubit 1210. The MCZ gate 1240(1) acts on the first subset of control qubits q0-q41220(1), and the ancilla qubit q91210. The combination of the MCZ gate 1240(1) and the ^^gate 1250(1) is decomposed into a chain structure 1300(1), as in the right section of Figure 13. The chain structure 1300(1) includes a symmetrical cascade1290 of ^ ௱^^ gates with a multi-controlled iZ gate 1280 located at the centre of the chain structure1300(1) between a first portion 1290(1) of the symmetrical cascade 1290 and a second portion 1290(2) of the symmetrical cascade 1290. The only difference between the chain structure1300(1) and chain structure 500(1) shown in Figure 5 is that the first ^ ௱^^ gate of the first portion1290(1) of the symmetrical cascade 1290 uses the ancilla qubit 1210 as the second control qubit,and that the last ^ ௱^^ gate of the second portion 1290(2) of the symmetrical cascade 1290 usesthe ancilla qubit 1210 as the second control qubit. The ^ற^ gate 1250(3) has the same layout, except a multi-controlled ^^றgate replaces the multi-controlled iZ gate 1280 located at the centre of the chain structure 1300(1).

[0105] Figure 14 shows the decomposition of the combination of the MCZ gate 1240(2) and the ^ଶgate 1250(2). The ^ଶgate 1250(2) acts on the control qubits 1220, and the target qubit 1230, and the MCZ gate 1240(2) acts on the second subset of control qubits q5-q71220(2), the target qubit 1230, and the ancilla qubit 1240(2). The combination of the MCZ gate 1240(2) and the ^ଶgate 1250(2) is decomposed into a chain structure 1300(2), as in the right section of Figure 14.The chain structure 1300(2) includes a symmetrical cascade 1291 of ^ ௱^^ gates with a multi-controlled iZ gate 1281 located at the centre of the chain structure 1300(2) between a first portion 1291(1) of the symmetrical cascade 1291 and a second portion 1291(2) of the symmetrical cascade 1291. 18

[0106] In this example, as the MCZ gate 1240(2) acts on the target qubit 430 and the secondsubset of control qubits 420(2) (as well as the ancilla qubit 1210), the total number of ^ ௱^^ gatesin the symmetrical cascade 1291 is ^^^೩^ ൌ 2^^^ଶ െ 1^, where each portion 1291(1),(2) of thesymmetrical cascade 1291 has ^^^೩^ / 2^^ ௱^^ gates. The number of non-control qubits (i.e. qubitsoutside of the second subset of control qubits 1220(2), the target qubit 1230, and the ancilla qubit1230) utilised in the cascade 1291 is also ^^^೩^ / 2. In this example, as ^^ଶ ൌ 3, the total numberof ^ ௱^^ gates in the symmetrical cascade 1291 is ^^^೩^ ൌ 4 and each portion 1291(1),(2) has two^ ௱^^ gate. The ^ ௱^^ gate 1271(1) acts on a qubit q4 which is not part of the second subset 1220(2)of control qubits, with the target qubit 1230 of the MCX gate as the first control qubit of the ^ ௱^^gate 1271(1), and the ancilla qubit 1230 of the MCX gate as the second control qubit of the ^ ௱^^gate 1271(1). The ^ ௱^^ gate 1271(2) acts on a qubit q3 which is not part of the second subset1220(2) of control qubits of the MCX gate, with a qubit q7of the second subset of control qubits1220(2) of the MCX gate as the first control qubit of the ^ ௱^^ gate 1271(2), and qubit q4 (the targetqubit of the ^ ௱^^ gate 1271(1)) as the second control qubit of the ^ ௱^^ gate 1271(1).^^ ௱^^ gates1271(3),(4) are arranged in the same way as ^ ௱^^ gates 1271(1),(2) after the controlled Z gate1281, such that the chain structure 1300(2) is symmetrical. The controlled Z gate 1281 is acontrolled iZ gate acting on the qubit (q3) which is the target qubit of the final ^ ௱^^ gate 1271(2) ofthe first portion 1291(1) of the symmetrical cascade 1291. The controlled iZ gate 1281 acts on qubit q3according to the state of the two remaining control qubits (q5and q6) of the second subset 1220(2) of control qubits of the MCX gate, which are as yet unused in the symmetrical cascade 491. The ^றଶ gate 1250(4) has the same layout, except a multi-controlled ^^றgate replaces the multi-controlled iZ gate 1281 located at the centre of the chain structure 1300(2).

[0107] The chain structures 1300(1) and 1300(2) shown in Figures 13 and 14 (and their respective Hermitian conjugates) can then be decomposed into a universal gate set, such asClifford+T gates, using the techniques described above. For example, the ^ ௱^^ gates and multi-controlled iZ gate may be decomposed into Clifford+T gates using the decompositions shown in Figure 9 or Figure 10, or a mix of these decompositions. In addition, certain gates may be relocated within the final quantum circuit in order to reduce the depth of particular gates, and the circuit as a whole, in the same manner as described above in relation to Figure 11.

[0108] Accordingly, the techniques according to the present disclosure allow multi-controlled X gates to be compiled (i.e. decomposed) into a universal gate set, such as Clifford+T, in a manner which minimises the cost and depth of the resulting quantum circuit. In particular, multi-qubit relative-phase gates acting on the control qubits are added to the quantum circuit which are each decomposed in combination with a multi-controlled Z gate to generate a chain structure including a plurality of relative-phase Toffoli gates arranged in a symmetrical cascade, with a multi- controlled iZ gate arranged at the centre of the chain structure. The relative-phase Toffoli gates and multi-controlled iZ gate can then be decomposed into Clifford+T gates. The number of CNOT and T gates in the resulting final quantum circuit corresponding to the multi-controlled X gate scales linearly, and thus the cost (and depth) of the final quantum circuit is minimised. In particular, the techniques of the present disclosure may result in a CNOT cost of between 12.5^^and 12^^, a T cost of 16^^, a CNOT depth of between 12^^and 8^^, and a T depth of between 8^^and 4^^. In comparison, existing decomposition of MCX gates result in a CNOT cost of approximately 16^^, a T cost of approximately 16^^, a CNOT depth of approximately 16^^, and a T depth of approximately 16^^. Accordingly, the overall reduction in the cost to a quantum computer provided by the present disclosure is significant. Multi-Controlled U(2) (MCU2) Gates

[0109] A further type of multi-controlled rotation gate is the multi-controlled U(2) (MCU2) gate. An MCU2 gate 1500 is shown on the left section of Figure 15. The MCU2 gate 1500 acts on a target 19  qubit 1530 according to the state of the first and second subsets 1520(1),(2) of control qubits. The middle section of Figure 15 shows a decomposition of the MCU2 gate 1500 into a multi-controlled ^௩^^^ gate 1501 and a multi-controlled ^௭^െ2ψ^ gate 1502, each having the same control qubits as the MCU2 gate 1500. The multi-controlled ^௩^^^ gate 1501 acts on the target qubit 1530 and applies an arbitrary rotation of angle λ around an arbitrary axis ^^, according to the state of the control qubits 1520, similar to the multi-controlled ^௩^^^ gate 400 shown in Figures 4A and 4B. The multi-controlled ^௭^െ2^^gate 1502 acts on an ancilla qubit 1510 which is not one of the control qubits 1520, and performs a rotation of an angle െ2^^about the z axis according to the state of the control qubits 1220. The ancilla qubit 1510 is a so-called ‘clean’ ancilla qubit, which is initialised to state |0ۧ. The angle ^ represents the phase of the U(2) gate, where the U(2) gatecan be expressed as ^^2^The angle ^^may therefore be provided as an inputparameter when decomposing the MCU2 gate 1500.

[0110] The combination of the multi-controlled ^௩^^^gate 1501 and the multi-controlled ^௭^െ2ψ^gate 1502 can be further decomposed into a quantum circuit 1503 as shown in the right-most portion of Figure 15. The quantum circuit 1503 is similar to the circuit shown on the right-hand side of Figure 4B. That is, like the quantum circuit in the right-hand side of Figure 4B, the quantum circuit 1503 includes ^^,^ଶ,^ற ற^,^ଶgates acting on the control qubits 1520, the MCZ gates acting on the target qubit 1530 and a particular subset 1520(1),(2) of the control qubits 1520, and the A1-A4gates acting on the target qubit 1530. These gates are all identical to the corresponding gates shown in Figure 4B. In addition to these gates, the quantum circuit 1503 comprises a plurality of CNOT gates 1570(1)-(8) acting on the target qubit 1530 according to the ancilla qubit 1510. These additional CNOT gates 1570 are arranged immediately adjacent and both before and after each MCZ gate. For example, CNOT gate 1570(1) is arranged immediately prior to MCZ gate 1540(1), and CNOT gate 1570(2) is arranged immediately after MCZ gate 1540(2). As such, a pair of CNOT gates 1570(1),(2) bounds the MCZ gate 1540(1). The other CNOT gates 1570(3)- (8) have corresponding arrangements relative to MCZ gates 1540(2)-(4).

[0111] The quantum circuit 1503 additionally includes a plurality of H gates 1560 acting on the ancilla qubit 1501 arranged at the beginning and end of the quantum circuit 1503 (i.e. before any other operations have been performed on or based on the ancilla qubit 1510). The quantum circuit further includes a plurality of single-qubit rotation gates B1-B21580 acting on the ancilla qubit 1510. The B1-B2gates 1580 are arrange in parallel with the A1-A4gates. For example, the B1 gate 1580 is arranged in parallel with the first A2gate, the B2gate 1580(2) is arranged in parallel with the A3gate, and the B1gate 1580(3) is arranged in parallel with the second A2gate. The B1gates 1580(1),(3) are ^௫gates, which is a rotation about the x axis by the angle^ൗ 2. The B2 gate1580(2) is a ^ ^െwhich is a rotation about the x axis by the angle െ 2.

[0112] The combination of the ^ற^,^ଶ,^^,^றଶ gates and the MCZ gates 1540 in the quantum circuit 1503 may be decomposed into chain structures, as discussed above in relation to Figures 5, 7, and 8. Furthermore, the chain structures can then be decomposed into a universal gate set, suchas Clifford+T gates, using the techniques described above. For example, the ^ ௱^^ gates and multi-controlled iZ gates in the chain structures may be decomposed into Clifford+T gates using the decompositions shown in Figure 9 or Figure 10, or a mix of these decompositions. In addition, certain gates may be relocated within the final quantum circuit in order to reduce the depth of particular gates, and the circuit as a whole, in the same manner as described above in relation to Figure 11.

[0113] Accordingly, the techniques according to the present disclosure allow multi-controlled U(2) gates to be compiled (i.e. decomposed) into a universal gate set, such as Clifford+T, in a manner which minimises the cost and depth of the resulting quantum circuit. In particular, multi-qubit 20  relative-phase gates acting on the control qubits are added to the quantum circuit which are each decomposed in combination with a multi-controlled Z gate to generate a chain structure including a plurality of relative-phase Toffoli gates arranged in a symmetrical cascade, with a multi- controlled iZ gate arranged at the centre of the chain structure. The relative-phase Toffoli gates and multi-controlled iZ gate can then be decomposed into Clifford+T gates. The number of CNOT and T gates in the resulting final quantum circuit corresponding to the multi-controlled X gate scales linearly, and thus the cost (and depth) of the final quantum circuit is minimised. In particular, the techniques of the present disclosure may result in a CNOT cost of between 12.5^^and 12^^, a T cost of 16^^, a CNOT depth of between 12^^and 8^^, and a T depth of between 8^^and 4^^. In comparison, existing decomposition of MCU2 gates result in a CNOT depth of approximately 32^^, a T cost of approximately 32^^, a CNOT depth of approximately 32^^, and a T depth of approximately 32^^. Accordingly, the overall reduction in the cost to a quantum computer provided by the present disclosure is significant. Multi-Controlled Multi-Target Rotation Gates

[0114] The techniques according to the present disclosure are described above with respect to multi-controlled single-target rotation gates, which act on only one target qubit. However, it should be appreciated that the techniques according to the present disclosure may be utilised in conjunction with multi-controlled multi-target rotation gates, acting on a plurality of target qubits. Figure 24A shows (on the left-hand side) an example of a multi-controlled multi-target rotation gate acting on a set of target qubits t1-tm, according to the state of control qubits C=C1+C2. The right-hand side, shows a decomposition of the multi-controlled multi-target rotation gate into MCZ gates, single-qubit rotation A gates, and ^ gates. The ^ gates each act on the control qubits, each target qubit has its own set of single-qubit rotation A gates which are determined and applied in a similar as described above, and the MCZ gates act on all target qubits t1-tm, according to the state of a particular subset of the control qubits.

[0115] Figure 24B shown an example quantum circuit for adding an additional target to an MCZ gate. That is, the right-hand side decomposition in Figure 24B may be converted into the left-hand side arrangement in Figure 24B, such that the same decompositions of the MCZ and ^ gates into chain structures may be used here. In particular, CNOT gates spanning the target qubits may be used in order to convert the combination of a ^ gate and an MCZ gate acting on the all target qubits (according to a subset of the control qubits), into the ^ gate, an MCZ gate acting only on one target qubit (according to a subset of the control qubits), and the CNOT gates between the target qubits. While Figure 24B shows an example with two target qubits, Figure 24C shows a generalised version of Figure 24B, where a series of CNOT gates acting between particular ones of the target qubits are used to convert the combination of a ^ gate and a multi-target MCZ gate into the ^ gate, an MCZ gate acting only on one target qubit (according to a subset of the control qubits) and the CNOT gates between the target qubits.

[0116] As such, it should be appreciated that the techniques discussed above in relation to single- target multi-controlled rotation gates may be applied to multi-target multi-controlled rotation gates, through the use of a series of CNOT gates acting between the target qubits. Multi-Controlled Gates for LNN Quantum Computers

[0117] The techniques discussed above are generally described as being used in conjunction with all-to-all connectivity (ATA) quantum computers, where multi-qubit gates can operate on multiple qubits regardless of qubit ordering or physical location. However, some quantum computers only support LNN connectivity, where multi-qubit gates can only operate on qubits which immediately neighbour one another (both logically and physically). The techniques described above can be adapted in order to be suitable for LNN quantum computers. 21

[0118] The left portion of Figure 16 shows an example of a multi-controlled SU(2) ^௩^^^^gate acting on a target qubit q18according to a plurality of control qubits {q0, q2, q5, q7-q10, q12-q14, q16, q17}. Ancilla qubits (q1, q3, q4, q6, q11, q15) are located between certain ones of the control qubits, such that not all control qubits are adjacent to one another. The ordering of the qubits in the set of qubits in Figure 16 may reflect (i.e. be based on) the physical ordering of qubits in a quantum computer. The set of control qubits ({q0, q2, q5, q7-q10, q12-q14, q16, q17}) is split into two subsets of control qubits. In general, the set of control qubits are split such that the first subset does not include any neighbouring (i.e. immediately neighbouring) control qubits. Similarly, in general the set of control qubits are split such that the first and second subsets of control qubits does not include any neighbouring (i.e. immediately neighbouring) control qubits. However, in some cases, the first and / or second subsets of control qubits may include two neighbouring control qubits where the two neighbouring control qubits are the first and second qubits in the respective subset. That is, the first and / or second subsets of control qubits may include two neighbouring control qubits where the two neighbouring control qubits are the two qubits in the respective subsets located furthest from the target qubit.

[0119] The right-hand portion of Figure 16 shows a decomposition of the multi-controlled SU(2) ^௩^^^^gate using the techniques discussed above in relation to Figure 4B. In particular, the multi- controlled SU(2) ^௩^^^^gate is decomposed into a combination of single-qubit rotation gates A1- A4(such as single-qubit rotation gates A1-A4460), a plurality of multi-qubit relative-phase gates ^^,^ଶ,^ற^,^றଶ acting on the control qubits and each ancilla qubit between control qubits, and, for each of the ^^,^ଶ,^ற^,^றଶ gates, a multi-controlled Z (MCZ) gate acting on the target qubit and a particular subset of the control qubits. Here, the first subset of control qubits includes qubits {q0, q2, q5, q7, q10, q12, q14, q16}, and the second subset of control qubits includes {q8, q9, q13, q17}. The ^ଶand ^றଶ are shown as acting only on qubits q8-q17, however these gates may equally be considered to act on each of qubits q0-q17, as with the ^^and ^ற^ gates.

[0120] Figure 17 shows the decomposition of the combination of the ^^and its respective MCZ gate into a chain structure. In particular, the chain structure includes a symmetrical cascadecomprising ^ ௱^^^gates, and a controlled Z gate located at the centre of the symmetrical cascade.The symmetrical cascade includes two portions located either side of (i.e. before and after) the controlled Z gate. As the control qubit q0in the first subset furthest from the target qubit q18is not neighboured to a control qubit, the controlled-Z gate at the centre of the symmetrical cascade is a singly controlled Z gate acting on the control qubit q0(in the first subset furthest from the target qubit q18) and its neighbouring qubit q1(which is not in the first subset of control qubits).

[0121] Furthermore, in addition to a plurality of ^ ௱^^^gates, the symmetrical cascade additionallyincludes a plurality of CNOT gates. Each ^ ௱^^^gate acts on a different non-control qubit (i.e. aqubit not in the first subset of control qubits, or the target qubit q18) as a target (i.e. focus) qubit.The first control qubit of the ^ ௱^^^gate is a qubit neighbouring the target qubit of the ^ ௱^^^gate whichis closer to the overall target qubit q18of the multi-controlled SU(2) ^௩^^^^gate. The second controlqubit of the ^ ௱^^^gate is a qubit neighbouring the qubit set as the first control qubit. Each controlqubit in the first subset, except the control qubit furthest from the target qubit q18, has anassociated ^ ௱^^^gate in each portion of the symmetrical cascade, where the control qubit in thefirst subset is set as the first control qubit for the ^ ௱^^^gate. Where there is more than one non-control qubit between control qubits in the first subset, one or more CNOT gates are provided. In particular, a CNOT gate is provided for each extra non-control qubit located between control qubits in the first subset. Each CNOT gate acts on an non-control qubit as a target qubit of the CNOT gate according to the state of a neighbouring non-control qubit which closer to the target qubit q18of the multi-controlled SU(2) ^௩^^^^gate. Furthermore, as the control qubit q16in the first subset which is closest to the target qubit q18is not neighboured to the target qubit q18(i.e. an non-control qubit q17is located between q16and q18), a CNOT gate is provided at the beginning 22  and end of the chain structure acting on non-control qubit q17, based on target qubit q18. In this example, all gates of the chain structure in Figure 17 are Hermitian, and as such the decomposition of MCZ+^ற^^is identical to the decomposition of MCZ + ^^(shown in Figure 17).

[0122] Figure 18 shows the decomposition of the combination of the ^ଶand its respective MCZ gate into a chain structure. The chain structure includes a symmetrical cascade comprising^ ௱^^^gates, and a controlled Z gate located at the centre of the symmetrical cascade. Thesymmetrical cascade includes two portions located either side of (i.e. before and after) the controlled Z gate. As the control qubit q8in the second subset furthest from the target qubit q18is neighboured to a control qubit (i.e. q9is a control qubit), the controlled-Z gate at the centre of the symmetrical cascade is doubly-controlled iZ gate, controlled by the two (neighbouring) control qubits (q8and q9) in the second subset furthest from the target qubit q18. The doubly-controlled iZ gate acts on an non-control qubit q10which neighbours the control qubit q9for the doubly- controlled iZ gate which is closest to the target qubit q18.

[0123] As with the chain structure shown in Figure 17, in addition to a plurality of ^ ௱^^^gates, thesymmetrical cascade in Figure 18 additionally includes a plurality of CNOT gates. In particular,the placement of ^ ௱^^^gates and CNOT gates adheres to the same rules as discussed above withrespect to Figure 17. That is, each ^ ௱^^^gate acts on a different non-control qubit (i.e. a qubit notin the second subset of control qubits, or the target qubit q18) as a target (i.e. focus) qubit. Thefirst control qubit of the ^ ௱^^^gate is a qubit neighbouring the target qubit of the ^ ௱^^^gate which iscloser to the overall target qubit q18of the multi-controlled SU(2) ^௩^^^^gate. The second controlqubit of the ^ ௱^^^gate is a qubit neighbouring the qubit set as the first control qubit. Each controlqubit in the second subset, except the two control qubits furthest from the target qubit q18, has anassociated ^ ௱^^^gate in each portion of the symmetrical cascade, where the control qubit in thesecond subset is set as the first control qubit for the ^ ௱^^^gate. Where there is more than one non-control qubit between control qubits in the second subset, one or more CNOT gates are provided. In particular, a CNOT gate is provided for each extra non-control qubit located between control qubits in the second subset. Each CNOT gate acts on an non-control qubit as a target qubit of the CNOT gate according to the state of a neighbouring non-control qubit which closer to the target qubit q18of the multi-controlled SU(2) ^௩^^^^gate. Furthermore, as the control qubit q17in the second subset which is closest to the target qubit q18is neighboured to the target qubit q18(i.e. no non-control qubits are located between q17 and q18), an ^ ௱^^^gate is located at thebeginning and ends of the chain structure. These ^ ௱^^^gates at the beginning and ends of thechain structure have qubit q17 set as the first control qubit of the ^ ௱^^^gate, qubit q18 set as thesecond control qubit of the ^ ௱^^^gate, and non-control qubit q16 (neighbouring the first control qubitof the ^ ௱^^^gate) set as the target qubit of the ^ ௱^^^gate. In this example, the decomposition ofMCZ+^றଶ^is identical to the decomposition of MCZ + ^ଶ(shown in Figure 18), except that for the decomposition of MCZ+^றଶ^the doubly-controlled iZ gate is replaced with a doubly-controlled ^^றgate.

[0124] The chain structures for the MCZ+Δ gates of Figure 16 (such as those shown in Figures 17 and 18) may then be decomposed into a universal gate set, such as Clifford+T gates. Forexample, the ^ ௱^^ gates and multi-controlled iZ gate may be decomposed into Clifford+T gatesusing the decompositions shown in Figure 9 or Figure 10, or a mix of these decompositions. In addition, certain gates may be relocated within the final quantum circuit in order to reduce the depth of particular gates, and the circuit as a whole, in the same manner as described above in relation to Figure 11.

[0125] Furthermore, in some cases, one or more ^ ௱^^ gates of one or more chain structures maybe decomposed as shown in Figure 19. In particular, according to an example of the presentdisclosure, a ^ ௱^^ gate acting on a target qubit according to a first control qubit and a second23  control qubit may be decomposed into a quantum circuit, the quantum circuit sequentially comprising: a first H gate acting on the target qubit; a first CNOT gate acting on the first control qubit according to the target qubit; a first T†gate acting on the target qubit, and a first T gate acting on the first control qubit, wherein the first T†gate and first T gate are arranged parallel to one another; a second CNOT gate acting on the target qubit according to the first control qubit; a third CNOT gate acting on the first control qubit according to the second control qubit; a fourth CNOT gate acting on the target qubit according to the first control qubit; a second T gate acting on the target qubit, and a second T†gate acting on the first control qubit, wherein the second T gate and second T†gate are arranged parallel to one another; a fifth CNOT gate acting on the first control qubit according to the target qubit; and a second H gate acting on the target qubit.

[0126] A quantum computer, such as quantum computer 235 shown in Figure 2, may be configured to implement the quantum circuit described above in relation to Figure 19, according to examples of the present disclosure. Furthermore, a controller, such as controller 240 shown in Figure 2, for a quantum computer may be configured to implement the quantum circuit described above in relation to Figure 19, according to examples of the present disclosure. In addition, instructions for implementing the quantum circuit described above in relation to Figure 19 may be embodied or encoded in a computer-readable medium, such as a computer-readable storage medium, containing instructions. Instructions embedded or encoded in a computer-readable medium may cause a programmable processor, or other processor, to cause a quantum computer to implement the quantum circuit. Computer-readable media may include non-transitory computer-readable storage media and transient communication media. Computer readable storage media, which is tangible and non-transitory, may include random access memory (RAM), read only memory (ROM), programmable read only memory (PROM), erasable programmable read only memory (EPROM), electronically erasable programmable read only memory (EEPROM), flash memory, a hard disk, a CD-ROM, a floppy disk, a cassette, magnetic media, optical media, or other computer-readable storage media. The term “computer-readable storage media” refers to physical storage media, and not signals, carrier waves, or other transient media. As noted above, computer readable media may include transient communication media. Such communication media may occur within a single computer system or between multiple computer systems, and may take the form of transient signal-conveying media such as carrier waves and transmission signals.

[0127] Additionally, in some cases, doubly-controlled iZ (CCiZ) gates of chain structures may be decomposed as shown in Figure 20. In particular, according to an example of the present disclosure, a CCiZ gate may be decomposed into a plurality of Clifford+T gates followed by a SWAP gate between the control qubits of the CCiZ gate. However, across the full quantum circuit corresponding to the multi-controlled rotation gate, the SWAP gates from different CCiZ decompositions cancel each other out. Accordingly, CCiZ gates of chain structures may be replaced by the combination of both a CCiZ and a SWAP gate between the control qubits of the CCiZ gate, as shown in the left-most and middle sections of Figure 21. These combinations may be decomposed into Clifford+T gates as shown in the right-most section of Figure 21. In other words, where a CCiZ gate is present within a chain structure the CCiZ gate may be effectively decomposed into the quantum circuit shown in the right-most section of Figure 21.

[0128] Therefore, according to an example of the present disclosure, there is provided a quantum circuit for implementing a multi-controlled iZ gate within another quantum circuit including two or more multi-controlled iZ gates, each of the multi-controlled iZ gates acting on a target qubit according to a first control qubit and a second control qubit, wherein the quantum circuit for implementing a multi-controlled iZ gate sequentially comprises: a first CNOT gate acting on the second control qubit according to the target qubit; a second CNOT gate acting on the first control qubit according to the second control qubit; a first T gate acting on the second control qubit and a first T†gate acting on the target qubit, wherein the first T gate and first T†gate are arranged 24  parallel to one another; a third CNOT gate acting on the second control qubit according to the target qubit; a fourth CNOT gate acting on the second control qubit according to the first control qubit; a second T†gate acting on the first control qubit, and a second T gate acting on the second control qubit, wherein the second T†gate and a second T gate are arranged parallel to one another; a fifth CNOT gate acting on the first control qubit according to the second control qubit; and a sixth CNOT gate acting on the second control qubit according to the target qubit.

[0129] A quantum computer, such as quantum computer 235 shown in Figure 2, may be configured to implement the quantum circuit described above in relation to Figure 21, according to examples of the present disclosure. Furthermore, a controller, such as controller 240 shown in Figure 2, for a quantum computer may be configured to implement the quantum circuit described above in relation to Figure 21, according to examples of the present disclosure. In addition, instructions for implementing the quantum circuit described above in relation to Figure 21 may be embodied or encoded in a computer-readable medium, such as a computer-readable storage medium, containing instructions. Instructions embedded or encoded in a computer-readable medium may cause a programmable processor, or other processor, to cause a quantum computer to implement the quantum circuit. Computer-readable media may include non-transitory computer-readable storage media and transient communication media. Computer readable storage media, which is tangible and non-transitory, may include random access memory (RAM), read only memory (ROM), programmable read only memory (PROM), erasable programmable read only memory (EPROM), electronically erasable programmable read only memory (EEPROM), flash memory, a hard disk, a CD-ROM, a floppy disk, a cassette, magnetic media, optical media, or other computer-readable storage media. The term “computer-readable storage media” refers to physical storage media, and not signals, carrier waves, or other transient media. As noted above, computer readable media may include transient communication media. Such communication media may occur within a single computer system or between multiple computer systems, and may take the form of transient signal-conveying media such as carrier waves and transmission signals.

[0130] Accordingly, the techniques according to the present disclosure allow multi-controlled rotation gates (such as an MCSU2 gate) to be compiled (i.e. decomposed) into a universal gate set for a LNN quantum computer, such as Clifford+T, in a manner which minimises the cost and depth of the resulting quantum circuit. In particular, multi-qubit relative-phase gates acting on the control qubits are added to the quantum circuit which are each decomposed in combination with a multi-controlled Z gate to generate a chain structure including a plurality of relative-phase Toffoli gates arranged in a symmetrical cascade, with a multi-controlled iZ gate arranged at the centre of the chain structure. The relative-phase Toffoli gates and multi-controlled iZ gate can then be decomposed into Clifford+T gates. The number of CNOT and T gates in the resulting final quantum circuit corresponding to the multi-controlled rotation gate scales linearly, and thus the cost (and depth) of the final quantum circuit is minimised. In contrast, for existing method for decomposing multi-controlled rotation gates into Clifford+T gates, the number of CNOT gates scales quadratically with the number of control qubits. Accordingly, the overall reduction in the cost to a quantum computer provided by the present disclosure is significant.

[0131] Figures 16-18 describe examples of the present disclosure as applied to LNN MCSU2 gates, however the techniques described herein may also be applied to other LNN multi-controlled rotation gates. For example, Figure 22 shows the decomposition of an LNN MCX gate. The LNN MCX gate acts on a target qubit q10, according to a set of control qubits {q0, q2, q5, q7, q8, q9, q12, q13, q14,q16, q17}. Ancilla qubits {q1, q3, q4, q6, q11, q15} are located between particular control qubits, and a further ancilla qubit q18is located at an edge of the set of qubits q0-q18. The ancilla qubit q18may be a so-called ‘dirty’ ancilla, which may take any state. The same decomposition of the LNN MCX gate is used as that shown in Figure 12, where the MCX gate is equated to a multi-controlled ^௬^2^^gate acting on the edge ancilla qubit q18bounded by two H gates acting on the target qubit 25  q10. The multi-controlled ^௬^2^^gate has the same control qubits as the MCX gate, with the original target qubit q10of the MCX gate also being a control qubit for the multi-controlled ^௬^2^^ gate.

[0132] The multi-controlled ^௬^2^^ gate may then be decomposed in the same manner as the multi-controlled ^௬^2^^ gate shown in Figure 12. In particular, the multi-controlled ^௬^2^^ gate is decomposed into a plurality of H gates. ^^,^ଶ,^ற ற^,^ଶgates and the MCZ gates, as shown in Figure 12, and discussed in relation to Figure 12. The ^^,^ଶgates and the MCZ gates in the right- most section of Figure 22 may then be decomposed into chain structures the same manner as the ^ற ற^,^ଶ,^^,^ଶgates and the MCZ gates discussed in relation to Figures 12-14 above. The resulting chain structures may then be further decomposed into a universal gate set, such as Clifford+T gates. Accordingly, the LNN MCX gate may be compiled into a universal gate set which can be efficiently executed on substantially any quantum computer.

[0133] Furthermore, in addition to LNN MCSU2 and LNN MCX gates, the techniques described herein may also be applied to other LNN multi-controlled rotation gates, such as MCU2 gates. For example, Figure 23 shows the decomposition of an LNN MCU2 gate. The LNN MCU2 gate acts on a target qubit t, according to a set of control qubits {q0, q2, q5, q7, q8, q9, q10, q12, q13, q14,q16, q17}. Ancilla qubits {q1, q3, q4, q6, q11, q15} are located between particular control qubits, and a further ancilla qubit a0is located at an edge of the set of qubits {q0-q17, t, a0}. The further ancilla qubit a0is a clean ancilla, which is initialised to the |0ۧ state. The target qubit t neighbours the edge ancilla qubit a0. The same decomposition of the LNN MCU2 gate is used as that shown inFigure 15, where the MCU2 gate is equated to a multi-controlled^ ௩^^^ gate and a multi-controlled^௭^െ2ψ^gate, each having the same control qubits as the MCU2 gate. The multi-controlled ^௩^^^gate acts on the target qubit t and applies an arbitrary rotation of angle λ around an arbitrary axis ^^, according to the state of the control qubits {q0, q2, q5, q7, q8, q9, q10, q12, q13, q14,q16, q17}, similar to the multi-controlled ^௩^^^ gate 400 shown in Figures 4A and 4B. The multi-controlled ^௭^െ2^^ gate acts on the edge ancilla qubit a0, and performs a rotation of an angle െ2^^about the z axis according to the state of the control qubits.

[0134] The combination of the multi-controlled ^௩^^^gate and the multi-controlled ^௭^െ2ψ^gatecan be further decomposed in the same manner as discussed above in relation to Figure 15. In particular, the combination of the multi-controlled ^௩^^^ gate and the multi-controlled ^௭^െ2ψ^ gate can be further decomposed into the quantum circuit shown in the right-most portion of Figure 23, comprising a plurality of single qubit rotation gates acting on the target qubit and the edge ancilla qubit a0, ^^,^ଶ,^ற^,^றଶ gates and an MCZ gate for each of the ^ற ற^,^ଶ,^^,^ଶgates acting on the target qubit t and a respective subset of the control qubits, and a plurality of CNOT gates acting on the target qubit according to the edge ancilla qubit a0, where the CNOT gates bound each MCZ+Δ combination. Thegates and the MCZ gates in the right-most of Figure 23 may then be decomposed into chain structures the same manner as the ^ற ற^,^ଶ,^^,^ଶgates and the MCZ gates discussed in relation to Figure 15 above. The resulting chain structures may then be further decomposed into a universal gate set, such as Clifford+T gates. Accordingly, the LNN MCU2 gate may be compiled into a universal gate set which can be efficiently executed on substantially any quantum computer.

[0135] It should also be appreciated that the above techniques for multi-controlled rotation gates for LNN quantum computers may be applied analogously to multi-target multi-controlled rotation gates for LNN quantum computers in a similar manner to the multi-target gates discussed above in relation to ATA connectivity. In particular, the above-described techniques for multi-controlled rotation gates for LNN quantum computers may be adapted such that the multi-target multi- controlled rotation gate is decomposed into ^ gates acting on the control qubits (and the qubits 26  which are neither control qubits of the multi-controlled rotation gates or target qubits of the multi- controlled rotation gates), sets of single-qubit rotation gates acting on each of the target qubits, and MCZ gates for each ^ gate, where each MCZ gate acts on all target qubits according to the state of a particular subset of the control qubits of the multi-target multi-controlled rotation gate (i.e. multi-target MCZ gates).

[0136] The left-hand side of Figure 24D shows an example of a multi-target multi-controlled rotation gate for LNN quantum computers. The right-hand side of Figure 24D shows the decomposition of the a multi-target multi-controlled rotation gate into ^ gates acting on the control qubits (and the qubits which are neither control qubits of the multi-controlled rotation gates or target qubits of the multi-controlled rotation gates), sets of single-qubit rotation gates acting on each of the target qubits, and multi-target MCZ gates. The ^ gates are not applied to any of the target qubits and thus cancel out (i.e. do not collectively have any overall effect on the qubits), as in all other methods described herein, and as such the combination of the MCZ gates and the ^ gates may be decomposed into a chain structure comprising relative-phase Toffoli gates and CNOT gates, as described above in relation to single-target multi-controlled rotation gates for LNN quantum computers. Figure 24E shows a decomposition of the combination of the ^^gate and its respective multi-target MCZ gate shown in Figure 24D. As shown in Figure 24E, a single- controlled multi-target Z gate (along with H gates either side of the control qubit) is applied on either side of the decomposition. Furthermore, CNOT gates are utilised in order to remove particular target gates (e.g. qubits q3and q9) of the multi-target MCZ gate from the ^^gate. A similar process is applied for the ^ଶgate and its respective multi-target MCZ gate, as shown in Figure 24F. Furthermore, the single-controlled multi-target Z gate (along with H gates either side of the control qubit) is converted to a cascade (i.e. chain structure) of CNOT gates, as shown in Figure 24G. Accordingly, multi-target multi-controlled rotation gates for LNN quantum computers may also be decomposed into a universal gate set according to the techniques of the present disclosure. Pre-Processing for LNN Quantum Computers

[0137] The LNN multi-controlled rotation gate in Figure 16 includes the target qubit located below all of the control qubits. In other words, for the set of qubits q0-q18within which the target qubit for the LNN multi-controlled rotation gate and all control qubits for the multi-controlled rotation gate are located, the target qubit is located at an extremal edge of the set of qubits q0-q18. In other words, the target qubit q18for the multi-controlled rotation gate has only one neighbour qubit in the set of qubits q0-q18. However, in general the target qubit for a LNN multi-controlled rotation gate may not be located below all of the control qubits (i.e. at the edge of the set of qubits such that the target qubit has only one neighbour in the set of qubits). In other words, the target qubit may have two neighbouring qubits in the set of qubits.

[0138] The left-most section of Figure 25A shows a LNN multi-controlled rotation gate (specifically a LNN MCSU2 gate), where the target qubit t of the set of qubits is not located at an edge of the set of qubits. The LNN MCSU2 gate is a multi-controlled ^௩^^^^ gate, which rotates the state of the qubit by angle λ around an arbitrary axis ^^.shown in the right-most section of Figure 25A, this multi-controlled ^௩^^^^ gate can be converted to a multi-controlled ^௫^^^ gate preceded by an ^ gate and fறସ ollowed by an ^ସgate applied to the target qubit (in a similar manner to that shown in Figure 4B). The ^ସgate is the same as ^ସgate 460(1) shown in Figure 4B, such that the ^ସshown in Figure 24A corresponds to a rotation gate ^௫^^^^about the x axis by anangle θ1 arranged in series with a rotation gate ^௭^^ଶ^about the z axis by an angle θ2 (i.e. ^௭^^ଶ^is arranged after ^௫^^^^). The angles ^^and ^ଶdepend on the axis ^^ of the ^௫^^^ rotation. The ^றସ gate corresponds to a rotation gate ^௭^െ^ଶ^ about the x axis by angle –θ2,arranged in series 27  with a rotation gate ^௫^െ^^^ about the z axis by an angle –θ1(i.e. ^௫^െ^^^ is arranged after^௭^െ^ଶ^).

[0139] Figure 25B shows how the target qubit t of a multi-controlled ^௫^^^ gate can be relocatedwithin a set of qubits comprising control qubits c1-cn (which control the multi-controlled^ ௫^^^ gate),the target qubit t, and one or more ancilla qubits a. In particular, a symmetrical cascade of SWAP gates includes a chain of SWAP gates (including two portions arranged either side of the relocated multi-controlled ^௫^^^ gate) acting on each pair neighbouring qubits in the set of qubits, starting with the original target qubit t towards and including an edge qubit. Relocating the target qubit in this way does not physically relocate any qubits, but changes the state of each of the qubits t to cn, such that the qubits t-cn-1take on the previous state of qubits t+1 (the gate immediately neighbouring t in the direction of cn) to cnrespectively, and qubit cntakes on the previous state of qubit t. In the example of Figure 25B, the edge qubit is the cnqubit, but the edge qubit could instead be the c1qubit. The choice to relocate the target qubit to cnor c1may be based, for example, on the number of qubits between cnand c1. In particular, If qubit t is closer to c1, then the target qubit may be relocated to c1, however if the target qubit is closer to cn, then the target qubit may be relocated to cn. This minimises the number of SWAP gates required, and therefore optimises the efficiency of the quantum circuit.

[0140] Figure 25C shows that partial SWAP gates, corresponding to two oppositely oriented CNOT gates, may be used in place of SWAP gates in order to relocate the target qubit. In other words, a cascading series of partial SWAP gates may be used to relocate the target qubit within the set of qubits. Accordingly, particular ones of the CNOT gates corresponding to the partial SWAP gates in the cascading series of partial SWAP gates may be commuted earlier or later in the final circuit corresponding to the multi-controlled ^௫^^^ gate, such that two or more of the CNOT gates corresponding to the partial SWAP gates may be applied in parallel with one another.

[0141] In cases where the target qubit of an LNN multi-controlled rotation gate is not located at an edge qubit of a defined set of qubits (i.e. the target qubit has two neighbours), a final quantum circuit corresponding to the multi-controlled rotation gate may include a plurality of gates which relocate the target qubit of the LNN multi-controlled rotation gate to be an edge qubit. Example implementations include the use of a symmetrical cascading series of SWAP gates or a symmetrical cascading series of partial SWAP gates (which may be implemented using CNOT gates), however these are just two examples and other implementations are possible. In the case of a symmetrical cascading series of partial SWAP gates, the two portions symmetrical cascading series of partial SWAP gates may be located at the start and end of the final quantum circuit respectively in order relocate to target qubit to be an edge qubit. The above-described techniques for decomposing a LNN multi-controlled rotation gate into a universal gate set (such as Clifford+T gates) may then be used.

[0142] As discussed above, in some cases the target qubit for a LNN multi-controlled rotation gate may not need to be located at an edge qubit of a defined set of qubits, for example for an LNN MCX gate, as shown in Figure 22. However, one or more of the qubits may be reordered such that an ancilla qubit (e.g. qubit q18in Figure 22) is located at the edge of the set of qubits. In other words, for the range of qubits q0-q17containing the target qubit and all control qubits, there is an ancilla qubit q18neighbouring an edge qubit q17of that range of qubits q0-q17. The qubits may be reordered using substantially any techniques, such as those described above in order to place an ancilla qubit at the edge of the set of qubits q0-q18, where the gates required to relocate the ancilla qubit may be located at the start and end of the final quantum circuit corresponding to the LNN MCX gate (or other LNN multi-controlled rotation gate).

[0143] Furthermore, in some cases, one or more qubits may be reordered such that an ancilla qubit is an edge qubit of the set of qubits, and the target qubit neighbours the edge ancilla qubit. 28  Figure 23 shows an example of this arrangement in the context of an LNN MCU2 gate, where an ancilla qubit a0is an edge qubit for the set of qubits {q0-q17, t, a0}, and the target qubit t neighbours the ancilla qubit a0. The qubits may be reordered using substantially any techniques, such as those described above in order to place an ancilla qubit at the edge of the set of qubits {q0-q17, t, a0} and the target qubit neighbouring the edge ancilla qubit, where the gates required to relocate the ancilla qubit may be located at the start and end of the final quantum circuit corresponding to the LNN MCU2 gate (or other LNN multi-controlled rotation gate).

[0144] It should be appreciated that other forms of reordering qubits within the set of qubits may be implemented in order to increase the efficiency of the quantum circuit. In particular, one or more re-orderings or relocations of particular qubits in the set of qubits may be identified which reduce the number of gates in the final quantum circuit (or the number of a particular gate such as CNOT gates) or reduce the depth of the final quantum circuit (or the depth of a particular gate such as CNOT gates). Accordingly, these relocations may be applied by including an appropriate series of gates (such as SWAP or partial SWAP gates, as described above), and the relevant gates used for the relocation included within the final quantum circuit.

[0145] Examples of such reordering which reduces the cots or depth of the final quantum circuit include moving a first control qubit (i.e. an edge control qubit) downwards (i.e. towards the centre of the set of qubits) if there are one or more ancilla qubits immediately below it (i.e. if first control qubit neighbours a first ancilla qubit), and in particular when there are two or more ancilla qubits immediately below the first control qubit (i.e. the first ancilla qubit neighbouring the first control qubit also neighbours a second ancilla qubit, and so on for each additional ancilla qubit). This process is illustrated in Figure 26. When there are two or more ancilla qubits directly below the first control qubit, relocating the first control qubit downwards by two qubits reduces the overall number of CNOT gates in the final quantum circuit by at least 4, and additional CNOT cost reduction are made for each additional relocation downwards. Where there is only one ancilla qubit immediately below the first control qubit, this may reduce the cost or depth of the final quantum circuit, depending on the layout of the remainder of the final quantum circuit.

[0146] Furthermore, if no control qubits are located below the target qubit (i.e. between the target qubit and an edge qubit of the set of qubits) and two or more ancilla qubits are located between the target qubit and the nearest control qubit, the target qubit may be relocated to be adjacent the nearest control qubit. This example is shown in Figure 27. Relocating the target qubit in this way reduces the CNOT count for the final circuit by 4 for each qubit the target qubit is moved closer to the nearest control qubit.

[0147] In addition, qubits may be reordered in order to reduce the number of qubits affected by a particular ^ gate for a LNN quantum computer. An example is illustrated in Figure 16, where the ^ଶgate does not act on qubits q0-q7. Reducing the number of qubits affected by a particular ^ଶgate allows for a greater number of cancellations in the chain structures between a ^^gate and its Hermitian conjugate, and provides for a reduction in the number of CNOT gates in the chain structure for the ^ଶgate, thereby reducing the overall cost of the quantum circuit. Moreover, in some cases, the qubits may be reordered such that the ^ଶgate (and its Hermitian conjugate) are not included in the decomposition (as discussed previously). Example Implementations

[0148] Figure 28 shows an illustrative computing system 2700 for carrying out examples of the present disclosure. The computing system 2700 includes a computing device 2710 comprising one or more processors 2740 and one or more memories 2750. The computing device 2710 receives an indication of parameters 2760 for a multi-controlled rotation gate. The parameters 2760 may include a rotation axis of the gate, and an angle of rotation (and in some cases, such as for MCU2 gates, a phase). The parameters 2760 may also or alternatively include a type of 29  the gate. For example, the parameters 2760 may include whether the gate is an SU(2) gate, or a U(2) gate, or whether the gate is a controlled X gate. In some cases, an indication of the type of gate may implicitly indicate one or more other parameters (such as rotation axis and angle) such that an explicit indication of the axis and angle is not required, and vice versa.

[0149] The computing device 2710 also receives an indication of a set of qubits 2770. In particular, the computing device 2710 receives an indication of a target qubit of the gate, and a list of control qubits for the gate. The indication may in some cases identify two subsets of the control qubits. In some cases, the indication of the set of qubits 2770 may also include a set of available qubits which may be used in implementing the gate. This set of available qubits may indicate ancilla qubits which are available for use in implementing the gate. The indication of the set of qubits 2770 may be received as part of the indication of the gate parameters 2760, or as a separate indication. The computing device 2710 may also receive an indication of a connectivity type of the quantum computer 2790 to execute the multi-controlled rotation gate (e.g. ATA or LNN). This indication of the connectivity type of the quantum computer 2790 may be received as part of the indication of the parameters 2760 for the multi-controlled rotation gate, the set of qubits 2770, or as a separate indication. The computing device 2710 may receive the indications for example via one or more Input and / or Output (I / O) devices, or a network interface.

[0150] An identifier module 2720 of the computing device 2710 may utilise the indication(s) in order to identify parameters for the multi-controlled rotation gate and a set of qubits, the set of qubits comprising at least: a target qubit, and a plurality of control qubits for the multi-controlled rotation gate. The identifier module 2720 may identify two subsets of the control qubits, for example based on the relative locations of the control qubits to one another. In particular, the identifier module 2720 may identify two subsets by assigning each of the plurality of control qubits to a particular one of a first subset or a second subset according to whether a particular control qubit of the plurality of qubits is neighboured to another control qubit of the plurality of qubits. Additionally or alternatively, the identifier module 2720 may identify the two subsets of control qubits based on a number of required ancilla qubits, or based on receiving an indication of the subsets of the control qubits.

[0151] A compiler 2730 of the computing device 2710 compiles the multi-controlled rotation gate into a universal gate set, for example Clifford+T gates. In particular, a multi-controlled rotation gate (MCR) decomposer 2731 of the compiler 2730 decomposes the multi-controlled rotation gate into a first quantum circuit, circuit, the first quantum circuit comprising: a plurality of first rotation gates acting on the target qubit, a plurality of multi-qubit relative-phase gates acting on a group of the plurality of control qubits, and a plurality of multi-controlled-Z gates acting on the target qubit and the group of the plurality of control qubits. Examples of this decomposition of the multi- controlled rotation gate are discussed in relation to Figures 4B, 12, 15, 16, 22, and 23. The exact form of the decomposition may depend on the multi-controlled rotation gate, in particular the type of the multi-controlled rotation gate (e.g. MCSU2, MCX, or MCU2). The plurality of first rotation gates may, for example, include rotations about the x or z axes, or H gates. The plurality of first rotation gates include at least a first rotation gate arranged prior to the first MCZ gate of the first quantum circuit, and at least another first rotation gate arranged after the final MCZ gate of the first quantum circuit. In addition, in some cases further first rotation gates may be included and arranged in parallel with the multi-qubit relative-phase gates. Each of the first rotation gates may comprise one or more separate single–qubit rotation gates.

[0152] The plurality of multi-qubit relative-phase gates may comprise a first multi-qubit relative- phase gate and a second multi-qubit relative-phase gate, wherein the second multi-qubit relative- phase gate is a Hermitian conjugate of the first multi-qubit relative-phase gate. Furthermore, in some cases, the plurality of multi-qubit relative-phase gates further comprises a third multi-qubit relative-phase gate and a fourth multi-qubit relative-phase gate, wherein the fourth multi-qubit 30  relative-phase gate is a Hermitian conjugate of the third multi-qubit relative-phase gate. Pairs of multi-qubit relative-phase gates and their Hermitian conjugates do not affect the operator implemented by the circuit. Particular ones of multi-qubit relative-phase gates may act on all of the control qubits, or in some cases only on a particular subset of the control qubits. Moreover, in some cases the multi-qubit relative-phase gates may additionally act on ancilla qubits located between control qubits. The multi-qubit relative-phase gates may in some cases additionally act on the target qubit. For each multi-qubit relative-phase gate, the first quantum circuit includes a multi-controlled-Z gate acting on the target qubit and particular subset of the control qubits (or all control qubits if the multi-qubit relative-phase gates act on all of the control qubits). In certain examples, the multi-controlled-Z gates also act on an ancilla qubit.

[0153] In certain examples, the first quantum circuit may comprise a plurality of second rotation gates acting on one or more ancilla qubits. The second rotation gates may, for example, include rotations about the x or z axes, or H gates. Each of the second rotation gates may comprise one or more separate single–qubit rotation gates. In some cases, the number of second rotation gates may correspond to the number of first rotation gates, and the second rotation gates may be arranged in parallel with the first rotation gates. Furthermore in some cases the first quantum circuit additionally comprises a plurality of CNOT gates acting on the target qubit according to an ancilla qubit. The first quantum circuit may include two CNOT gates for every MCZ gate, where pairs of CNOT gates may bound the MCZ gate.

[0154] A combination decomposer 2732 of the compiler 2730 decomposes each combination of a multi-qubit relative-phase gate and its respective MCZ gate in the first quantum circuit. In particular, the combination decomposer 2732 determines a plurality of quantum sub-circuits based on decomposing a combination of at least the plurality of multi-qubit relative-phase gates and the plurality of multi-controlled-Z gates of the first quantum circuit. Each quantum sub-circuit comprises a plurality of relative-phase Toffoli gates, and a controlled-Z gate. In other words, the combination decomposer 2732 modifies the first quantum circuit by decomposing each combination of a multi-qubit relative-phase gate and its respective MCZ gate into a plurality of relative-phase Toffoli gates, and a controlled-Z gate. Each of the plurality of sub-circuits may be a chain structure comprising the plurality of relative-phase Toffoli gates arranged in a symmetrical cascade across the set of qubits; and the controlled Z gate, wherein the controlled Z gate is located at the centre of the symmetrical cascade of the plurality of relative-phase Toffoli gates. The controlled Z gate may be a doubly-controlled iZ gate (or its Hermitian conjugate), or a single- controlled Z gate. Furthermore, in some cases the symmetrical cascade may include CNOT gates between ancilla qubits.

[0155] A universal gate converter 2733 then converts each of the plurality of relative-phase Toffoli gates and the controlled-Z gates to a plurality of base gates. In other words, the universal gate converter 2733 may modify the quantum circuit corresponding to the multi-controlled rotation gate by converting the relative-phase Toffoli gates and the controlled-Z gates to base gates. For example, the universal gate converter 2733 may convert the relative-phase Toffoli gates and the controlled-Z gates to gates included in a universal gate set, such as Clifford+T. In some cases, the base gates are gates acting on up to two qubits. In certain examples, the plurality of base gates comprises: a plurality of singly-controlled-NOT gates, and one or more of: a plurality of Hadamard gates, and a plurality of T gates. The universal gate converter 2733 may use any suitable conversion when converting the relative-phase Toffoli gates and the controlled-Z gates to base gates. For example, the universal gate converter 2733 may use the same conversion for each relative-phase Toffoli gates, and may use the same conversion for each (identical) controlled-Z gate, however in other examples, a different conversion may be used for different relative-phase Toffoli gates, and / or a different conversion may be used for different controlled-Z gates. Furthermore, in some cases a particular conversion (or conversion scheme) for the relative-phase Toffoli gates and / or controlled-Z gates may be used according to a desired 31  optimisation. For example, a different conversion scheme may be used based on whether optimised CNOT cost, CNOT depth, T cost, or T depth is desired. The desired optimisation may be indicated to the computing device 2710, for example by a user or received from an external entity, or may be predefined.

[0156] In some cases, an optimiser 2734 of the compiler 2730 may modify the circuit formed of base gates (e.g. gates in a universal gate set) in order to improve the cost or depth of the final quantum circuit corresponding to the multi-controlled rotation gate. In particular, the optimiser may determine that one or more particular gates of the plurality of base gates and the plurality of first rotation gates are commutable within the final quantum circuit, and relocate the one or more particular gates within the final quantum circuit to be parallel to one or more earlier gates of the final quantum circuit or one or more later gates of the final quantum circuit.

[0157] In addition or alternatively, the optimiser 2734 may also identify modifications to the state of one or more qubits in order to reorder qubits in the final quantum circuit. In particular, for gates for a LNN quantum computer, before the MCR gate decomposer 2731 decomposes the MCR gate into the first quantum circuit, the optimiser 2734 may, based on an ordering of the set of qubits, determine that one or more qubits in the set of qubits should be reordered. For example, for certain multi-controlled rotation gates, the optimiser 2734 may determine that a target qubit or an ancilla qubit should be relocated to be an edge qubit of the set of qubits (i.e. such that the target or ancilla qubit only has one neighbour qubit in the set of qubits). Accordingly, the optimiser 2734 may generate an initial circuit corresponding to the multi-controlled rotation gate which includes a plurality of gates (e.g. SWAP gates or partial SWAP gates) which swap the states of a plurality of qubits. This initial circuit may then be modified by the MCR gate decomposer 2731 by decomposing the multi-controlled rotation gate to form a first quantum circuit, which includes the one or more gates which swap the states of a plurality of qubits, in addition to the first rotation gates, multi-qubit relative-phase gates, and multi-controlled-Z gates.

[0158] Furthermore, in some cases the optimiser 2734 may identify one or more re-orderings of particular qubits of the set of qubits to reduce a number of a particular base gate or a depth for a particular base gate in the final quantum circuit; and applying the identified one or more re- orderings to the set of qubits. In particular, the optimiser 2734 may generate an initial circuit corresponding to the multi-controlled rotation gate which includes a plurality of gates (e.g. SWAP gates or partial SWAP gates) which swap the states of a plurality of qubits. This initial circuit may then be modified by the MCR gate decomposer 2731 by decomposing the multi-controlled rotation gate to form a first quantum circuit, which includes the one or more gates which swap the states of a plurality of qubits, in addition to the first rotation gates, multi-qubit relative-phase gates, and multi-controlled-Z gates.

[0159] The compiler 2730 may identify a final quantum circuit corresponding to the multi- controlled rotation gate, the final quantum circuit comprising the plurality of base gates and the plurality of first rotation gates acting on the target qubit. In some cases, the plurality of first rotation gates may also be converted into base gates. Furthermore, any additional gates within the final quantum circuit, such as SWAP or partial SWAP gates, or second rotation gates may additionally be converted to base gates (e.g. Clifford+T gates). The compiler 2730 may therefore output an indication of the final quantum circuit. For example, the indication of the final quantum circuit may be output to a hardware instruction generator 1280. The hardware instruction generator 2780 may convert the final quantum circuit into hardware instructions associated with a quantum computer 2790 (such as quantum computer 235 shown in Figure 2) and qubit interaction hardware (such as qubit interaction hardware 250 shown in Figure 2) of the quantum computer 2790. In other words, the hardware instruction generator 2780 may use the final quantum circuit to determine a set of physical operations to be carried out by qubit interaction hardware of the quantum computer 2790 in order to execute the multi-controlled rotation gate. Alternatively, in some cases the 32  computing device 2710 may convert the final quantum circuit into hardware instructions for the quantum computer 2790.

[0160] The hardware instruction generator 2780 (or computing device 2710) may then output the set of physical operations to the quantum computer 2790 to cause the quantum computer 2790 to execute the multi-controlled rotation gate. Furthermore, while Figure 27 shows the hardware instruction generator 2780 as being external to the computing device 2710, in some cases the hardware instruction generator 2780 may be included in the computing device 2710 such that the computing device 2710 may output the set of physical operations to the quantum computer 2790.

[0161] The computing device 2710 may operate as, or form part of, a quantum compiler (such as circuit compiler 220) and a hardware instruction generator (such as instruction generator 230). Accordingly, the computing device 2710 can be used in combination with or as an alternative to existing quantum compilers, and may be used in a number of different circumstances. For example, the techniques disclosed herein may be used to compile a multi-controlled rotation gate which may be received as part of a quantum circuit to be compiled.

[0162] Figure 29 illustrates an example computer-implemented method for compiling a multi- controlled rotation gate for a quantum circuit. The method according to Figure 28 may be performed on a suitable computing apparatus. For example, a computing apparatus may include one or more processors coupled to one or more memories, and may also include a network interface, and one or more input / output (I / O) devices. Step S2810 includes identifying one or more parameters for a multi-controlled rotation (MCR) gate, and a set of qubits, the set of qubits comprising: a target qubit, and a plurality of control qubits. Step S2820 includes decomposing the MCR gate into a first quantum circuit, the first quantum circuit comprising: a plurality of first rotation gates acting on the target qubit, a plurality of multi-qubit relative-phase gates acting on a group of the plurality of control qubits, and a plurality of multi-controlled-Z gates acting on the target qubit and the group of the plurality of control qubits.

[0163] Step S2830 of the method includes determining a plurality of quantum sub-circuits based on decomposing a combination of least the plurality of multi-qubit relative-phase gates and the plurality of multi-controlled-Z gates of the first quantum circuit, wherein each quantum sub-circuit comprises: a plurality of relative-phase Toffoli gates, and a controlled-Z gate. Step S2840 comprises converting each of the plurality of relative-phase Toffoli gates and the controlled-Z gates to a plurality of base gates, the base gates being gates acting on up to two qubits, the plurality of base gates comprising: a plurality of singly-controlled-NOT gates, and one or more of: a plurality of Hadamard gates, and a plurality of T gates.

[0164] The method proceeds to step S2850 of identifying a final quantum circuit corresponding to the multi-controlled rotation gate, the final quantum circuit comprising the plurality of base gates and the plurality of first rotation gates acting on the target qubit. The method concludes with step S2860 of outputting an indication of the final quantum circuit.

[0165] The method described in relation to Figure 29 may also be embodied or encoded in a computer-readable medium, such as a computer-readable storage medium, containing instructions. Instructions embedded or encoded in a computer-readable medium may cause a programmable processor, or other processor, to perform the method, e.g., when the instructions are executed. Computer-readable media may include non-transitory computer-readable storage media and transient communication media. Computer readable storage media, which is tangible and non-transitory, may include random access memory (RAM), read only memory (ROM), programmable read only memory (PROM), erasable programmable read only memory (EPROM), electronically erasable programmable read only memory (EEPROM), flash memory, a hard disk, a CD-ROM, a floppy disk, a cassette, magnetic media, optical media, or other computer-readable storage media. The term “computer-readable storage media” refers to physical storage media, 33  and not signals, carrier waves, or other transient media. As noted above, computer readable media may include transient communication media. Such communication media may occur within a single computer system or between multiple computer systems, and may take the form of transient signal-conveying media such as carrier waves and transmission signals.

[0166] Accordingly, from one perspective there has been described a computer-implemented method, system and computer-readable medium for compiling a quantum circuit. A multi- controlled rotation gate is decomposed into multi-qubit relative-phase gates and multi-controlled- Z gates, which are then collectively decomposed into relative-phase Toffoli gates and controlled- Z gates. The into relative-phase Toffoli gates and controlled-Z gates are then converted to base gates. A final quantum circuit comprising the base gates corresponding to the multi-controlled rotation gate is generated. 34

Claims

CLAIMS 1. A computer-implemented method for compiling a multi-controlled rotation (MCR) gate of a quantum circuit for a quantum computer, the method comprising: identifying one or more parameters for a MCR gate, and a set of qubits, the set of qubits comprising: a target qubit, and a plurality of control qubits; decomposing the MCR gate into a first quantum circuit, the first quantum circuit comprising: a plurality of first rotation gates acting on the target qubit, a plurality of multi-qubit relative-phase gates (Δ) acting on a group of the plurality of control qubits, and a plurality of multi-controlled-Z gates acting on the target qubit and the group of the plurality of control qubits; determining a plurality of quantum sub-circuits based on decomposing a combination of at least the plurality of multi-qubit relative-phase gates (Δ) and the plurality of multi-controlled-Z gates of the first quantum circuit, wherein each quantum sub-circuit comprises: a plurality of relative-phase Toffoli gates, and a controlled-Z gate; converting each of the plurality of relative-phase Toffoli gates and the controlled-Z gates to a plurality of base gates, the base gates being gates acting on up to two qubits, the plurality of base gates comprising: a plurality of singly-controlled-NOT gates, and one or more of: a plurality of Hadamard gates, and a plurality of T gates; identifying a final quantum circuit corresponding to the multi-controlled rotation gate, the final quantum circuit comprising the plurality of base gates and the plurality of first rotation gates acting on the target qubit; and outputting an indication of the final quantum circuit.

2. The method according to claim 1, wherein each of the plurality of sub-circuits is a chain structure comprising: the plurality of relative-phase Toffoli gates arranged in a cascade across the set of qubits; and the controlled Z gate, wherein the controlled Z gate is located at the centre of the symmetrical cascade of the plurality of relative-phase Toffoli gates. 35  3. The method according to claim 2, wherein the relative phase toffoli gate is a quantum gate acting on a focus qubit according to a first influencing qubit and a second influencing qubit, and wherein the quantum sub-circuit comprises: a first relative-phase toffoli gate acting on a first control qubit of the MCR gate as the focus qubit of the first relative-phase toffoli gate, according to the target qubit of the MCR gate as the first influencing qubit of the first relative-phase toffoli gate, and a second control qubit of the MCR gate as the second influencing qubit of the first relative-phase toffoli gate; a controlled iZ gate acting on a third control qubit of the MCR gate according to a fourth control qubit of the MCR gate and a fifth control qubit of the MCR gate; and a second relative-phase toffoli gate acting on the first control qubit of the MCR gate as the focus qubit of the second relative-phase toffoli gate, according to the target qubit of the MCR gate as the first influencing qubit of the second relative-phase toffoli gate, and the second control qubit of the MCR gate as the second influencing qubit of the second relative-phase toffoli gate, wherein the controlled iZ gate is arranged sequentially between the first and second relative-phase toffoli gates.

4. The method according to claim 3, wherein the third control qubit of the MCR gate and the first control qubit of the MCR gate are the same qubit.

5. The method according to claim 3, wherein the quantum sub-circuit further comprises: a third relative-phase toffoli gate acting on a sixth control qubit of the MCR gate as the focus qubit of the third relative-phase toffoli gate, according to the first control qubit of the MCR gate as the first influencing qubit of the third relative-phase toffoli gate, and a seventh control qubit of the MCR gate as the second influencing qubit of the third relative-phase toffoli gate, wherein the third relative-phase toffoli gate is arranged between the first relative-phase toffoli gate and the controlled iZ gate, and a fourth relative-phase toffoli gate acting on the sixth control qubit of the MCR gate as the focus qubit of the fourth relative-phase toffoli gate, according to the first control qubit of the MCR gate as the first influencing qubit of the fourth relative-phase toffoli gate, and the seventh control qubit of the MCR gate as the second influencing qubit of the fourth relative-phase toffoli gate, wherein the fourth relative-phase toffoli gate is arranged between the controlled iZ gate and the second relative-phase toffoli gate.

6. The method according to claim 5, wherein the third control qubit of the MCR gate and the sixth control qubit of the MCR gate are the same qubit.

7. The method according to any preceding claim, wherein the plurality of first rotation gates acting on the target qubit comprise one or more of: a plurality of x-axis rotation gates, a plurality of z-axis rotation gates, and / or a plurality of Hadamard gates. 36  8. The method according to any preceding claim, further comprising: determining that one or more particular gates of the plurality of base gates and the plurality of first rotation gates are commutable within the final quantum circuit; and relocating the one or more particular gates within the final quantum circuit to be parallel to one or more earlier gates of the final quantum circuit or one or more later gates of the final quantum circuit.

9. The method according to any preceding claim, wherein the one or more parameters for the multi-controlled rotation gate comprise an axis of rotation and a rotation amount.

10. The method according to any preceding claim, wherein the quantum circuit is for an all-to- all (ATA) connectivity quantum computer.

11. The method according to any preceding claim, wherein the quantum circuit is for a linear- nearest-neighbour (LNN) connectivity quantum computer.

12. The method according to claim 11, further comprising: determining that the target qubit has more than one neighbour qubit in the set of qubits; and based on determining that the target qubit has more than one neighbour, using a cascading series of partial swap gates acting on neighbouring qubits in the set of qubits to re- order the target qubit and one or more other qubits of the set of qubits, such that a particular qubit of the set of qubits having only one neighbour becomes the target qubit.

13. The method according to claim 11 or claim 12, further comprising: based on an ordering of the set of qubits, identifying one or more re-orderings of particular qubits of the set of qubits to reduce a number of a particular base gate or a depth for a particular base gate in the final quantum circuit; and applying the identified one or more re-orderings to the set of qubits.

14. The method according to any preceding claim, wherein the plurality of multi-qubit relative- phase gates comprises a first multi-qubit relative-phase gate (Δ1) and a second multi-qubit relative-phase gate (Δ1†), wherein the second multi-qubit relative-phase gate is a Hermitian conjugate of the first multi-qubit relative-phase gate.

15. The method according to claim 14, wherein the plurality of multi-qubit relative-phase gates further comprises a third multi-qubit relative-phase gate (Δ2) and a fourth multi-qubit relative- phase gate (Δ2†), wherein the fourth multi-qubit relative-phase gate is a Hermitian conjugate of the third multi-qubit relative-phase gate. 37  16. The method according to any preceding claim, further comprising: identifying a first subset of the plurality of control qubits, and a second subset of the plurality of control qubits.

17. The method according to claim 16, wherein identifying the first and second subsets of the plurality of control qubits comprises assigning each of the plurality of control qubits to a particular one of the first subset or the second subset according to whether a particular control qubit of the plurality of qubits is neighboured to another control qubit of the plurality of qubits.

18. The method according to any preceding claim, wherein the multi-controlled rotation gate is a multi-controlled special unitary rotation gate.

19. The method according to any preceding claim, wherein the set of qubits comprises one or more ancilla qubits, wherein the first quantum circuit further comprises a plurality of second rotation gates acting on the one or more the ancilla qubits.

20. The method according to claim 19, wherein the multi-controlled rotation gate is a multi- controlled NOT gate, and the plurality of first rotation gates and the plurality of second rotation gates are Hadamard gates.

21. The method according to claim 19, wherein the multi-controlled rotation gate is a multi- controlled unitary rotation gate, and the plurality of second rotation gates includes two Hadamard gates and a plurality of other second rotation gates.

22. The method according to any of claims 19-21, wherein the first quantum circuit further comprises a plurality of singly-controlled-NOT gates acting on the target qubit and the one or more ancilla qubits, and wherein the method further comprises: determining the plurality of quantum sub-circuits based on decomposing the combination of the plurality of multi-qubit relative-phase gates, the plurality of multi-controlled-Z gates, and the plurality of singly-controlled-NOT gates acting on the target qubit and the one or more ancilla qubits.

23. The method according to any preceding claim, wherein the a controlled-Z gate included in each quantum sub-circuit is one of: a multi-controlled iZ gate; or a singly-controlled Z gate.

24. The method according to any preceding claim, wherein the indication of the final quantum circuit is output to a controller for an apparatus configured to execute the first quantum circuit. 38  25. The method according to any preceding claim, wherein converting the plurality of relative- phase Toffoli gates to a plurality of base gates utilises a particular conversion scheme according to a desired optimisation.

26. The method according to claim 25, wherein a first conversion scheme converts the relative-phase Toffoli gates for optimisation of a number of controlled-NOT gates or a controlled- NOT gate depth, and wherein a second conversion scheme converts the relative-phase Toffoli gates for optimisation of T gate depth.

27. The method according to claim 26, wherein a first subset of the plurality of relative-phase Toffoli gates are converted using the first conversion scheme, and wherein a second subset of the plurality of relative-phase Toffoli gates are converted using the second conversion scheme.

28. The method according to any preceding claim, wherein the multi-controlled rotation gate is a multi-controlled multi-target rotation gate, wherein the identified parameters for the multi- controlled multi-target rotation gate comprise a plurality of target qubits, and wherein the plurality of multi-controlled-Z gates in the first quantum circuit are multi-controlled multi-target Z gates acting on the plurality of target qubits according to the plurality of control qubits.

29. A system comprising: a memory; and one or more processors configured to carry out the method according to any preceding claim.

30. A computer-readable medium comprising instructions which, when executed on a computer, cause the computer to carry out the method according to any of claims 1-28.

31. A quantum circuit for implementing a relative-phase Toffoli gate acting on a target qubit according to a first control qubit and a second control qubit, the quantum circuit sequentially comprising: a first H gate acting on the target qubit; a first CNOT gate acting on the first control qubit according to the target qubit; a first T gate acting on the first control qubit, and a first T†gate acting on the target qubit, wherein the first T gate and first T†gate are arranged parallel to one another; a second CNOT gate acting on the first control qubit according to the second control qubit, a third CNOT gate acting on the target qubit according to the second control qubit; a second T†gate acting on the first control qubit, and a second T gate acting on the target qubit, wherein the second T†gate and second T gate are arranged parallel to one another; 39  a fourth CNOT gate acting on the first control qubit according to the target qubit; and a second H gate acting on the target qubit.

32. A quantum circuit for implementing a multi-controlled iZ gate acting on a target qubit according to a first control qubit and a second control qubit, the quantum circuit sequentially comprising: a first CNOT gate acting on the first control qubit according to the target qubit; a first T gate acting on the first control qubit, and a first T†gate acting on the target qubit, wherein the first T gate and first T†gate are arranged parallel to one another; a second CNOT gate acting on the first control qubit according to the second control qubit and a third CNOT gate acting on the target qubit according to the second control qubit; a second T†gate acting on the first control qubit, and a second T gate acting on the target qubit, wherein the second T†gate and second T gate are arranged parallel to one another; a fourth CNOT gate acting on the first control qubit according to the target qubit; and a fifth CNOT gate acting on the target qubit according to the second control qubit.

33. The quantum circuit according to claim 31 or 32, wherein the quantum circuit is for an all- to-all connectivity (ATA) quantum computer.

34. A quantum circuit for implementing a relative-phase Toffoli gate acting on a target qubit according to a first control qubit and a second control qubit, the quantum circuit sequentially comprising: a first H gate acting on the target qubit; a first CNOT gate acting on the first control qubit according to the target qubit; a first T†gate acting on the target qubit, and a first T gate acting on the first control qubit, wherein the first T†gate and first T gate are arranged parallel to one another; a second CNOT gate acting on the target qubit according to the first control qubit; a third CNOT gate acting on the first control qubit according to the second control qubit; a fourth CNOT gate acting on the target qubit according to the first control qubit; a second T gate acting on the target qubit, and a second T†gate acting on the first control qubit, wherein the second T gate and second T†gate are arranged parallel to one another; a fifth CNOT gate acting on the first control qubit according to the target qubit; and a second H gate acting on the target qubit.

35. The quantum circuit according to claim 34, wherein the first control qubit is neighboured to the target qubit and the second control qubit. 40  36. A quantum circuit for implementing a multi-controlled iZ gate within another quantum circuit including two or more multi-controlled iZ gates, each of the multi-controlled iZ gates acting on a target qubit according to a first control qubit and a second control qubit, wherein the quantum circuit for implementing a multi-controlled iZ gate sequentially comprises: a first CNOT gate acting on the second control qubit according to the target qubit; a second CNOT gate acting on the first control qubit according to the second control qubit; a first T gate acting on the second control qubit and a first T†gate acting on the target qubit, wherein the first T gate and first T†gate are arranged parallel to one another; a third CNOT gate acting on the second control qubit according to the target qubit; a fourth CNOT gate acting on the second control qubit according to the first control qubit; a second T†gate acting on the first control qubit, and a second T gate acting on the second control qubit, wherein the second T†gate and a second T gate are arranged parallel to one another; a fifth CNOT gate acting on the first control qubit according to the second control qubit; and a sixth CNOT gate acting on the second control qubit according to the target qubit.

37. The quantum circuit according to any of claims 34-36, wherein the second control qubit is neighboured to the first control qubit and the target qubit.

38. The quantum circuit according to any of claims 34-37, wherein the quantum circuit is for a linear-nearest-neighbour connectivity (LNN) quantum computer.

39. A quantum computer configured to implement the quantum circuit according to any of claims 31-39.

40. A controller for a quantum computer, wherein the controller is configured to cause a quantum computer to implement the quantum circuit according to any of claims 31-38.

41. A computer-readable medium comprising instructions which, when implemented by a controller for a quantum computer, causes the quantum computer to implement the quantum circuit according to any of claims 31-38. 41