Compiling multi-controlled quantum gates

By compiling multi-controlled rotation gates using symmetrical chain structures and native gates, the inefficiencies and errors in existing quantum computer implementations are addressed, resulting in a more efficient and accurate quantum computation process.

WO2026234363A1PCT designated stage Publication Date: 2026-11-12UCL BUSINESS LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
PCT/GB2026/050752
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2025-05-09
Filing Date
2026-05-06
Publication Date
2026-11-12

AI Technical Summary

Technical Problem

Existing methods for implementing unitary operators 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

A method for compiling multi-controlled rotation gates by identifying quantum sub-circuits with symmetrical chain structures and native gates, reducing the number of gates and qubit constraints, and optimizing the quantum circuit's cost and depth.

Benefits of technology

The method enables more efficient implementation of multi-controlled rotation gates with reduced computational resources and errors, leading to faster and more accurate quantum computations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure GB2026050752_12112026_PF_FP_ABST
    Figure GB2026050752_12112026_PF_FP_ABST
Patent Text Reader

Abstract

A computer-implemented method, system and computer-readable medium for compiling a quantum circuit is provided. A first quantum circuit is identified corresponding to the multi-controlled rotation gate, the first quantum circuit including a plurality of multi-qubit relative phase gates and a plurality of multi-controlled Z gates. Quantum sub-circuits are identified corresponding to combinations of the multi-qubit relative phase gates multi-controlled Z gates, where the quantum sub-circuits comprise a symmetrical chain structure. The symmetrical chain structures comprise controlled-NOT gates spanning a range of qubits on which the particular multi-controlled-Z gate acts, wherein consecutive controlled-NOT gates of the symmetrical chain structure act on consecutive focus qubits according to a first adjacent qubit of the respective focus qubit, wherein the first adjacent qubit of the respective focus qubit is located closer to the respective edge qubit of the range of qubits than a second adjacent qubit of the respective focus qubit, wherein the controlled-NOT gates of the symmetrical chain structure are either singly-controlled-CNOT gates or relative-phase Toffoli gates, based on whether the second adjacent qubit of the focus qubit of the respective controlled-NOT gate is a control qubit of the MCR gate. Native gates corresponding the quantum sub-circuits are identified, and a final quantum circuit corresponding to the multi-controlled rotation gate is identified and output.
Need to check novelty before this filing date? Find Prior Art

Description

COMPILING MULTI-CONTROLLED QUANTUM GATESTechnical Field

[0001] The present invention relates generally to efficient implementations of large multicontrolled 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 \ (J) can be described as a linear combination of |0> and |1>, such that= a|0) + j5|l>, where |a|2+ | ?|2= l.The values a and p 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 computing device, 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 (qt), and a plurality of control qubits; identifying a first quantum circuit corresponding to the MCR gate, the first quantum circuit comprising: a one or more first rotation gates acting on the target qubit (qt), a plurality of multi-qubit relative-phasegates (A) each acting on particular groups of the plurality of control qubits, and plurality of multi-controlled-Z gates acting on respective groups of the plurality of control qubits, wherein the plurality of multi-controlled-Z gates span a respective range of qubits, and wherein each multi-controlled-Z gate additionally acts on a respective edge qubit defining an edge of the respective range of qubits; identifying a plurality of quantum sub-circuits corresponding to a combination of the plurality of multi-qubit relative-phase gates (A) and the plurality of multi-controlled-Z gates of the first quantum circuit, wherein each quantum sub-circuit comprises: a symmetrical chain structure of controlled-NOT gates spanning the respective range of qubits on which the particular multi-controlled-Z gate acts, wherein consecutive controlled-NOT gates of the symmetrical chain structure act on consecutive focus qubits according to a first adjacent qubit of the respective focus qubit, wherein the first adjacent qubit of the respective focus qubit is located closer to the respective edge qubit of the range of qubits than a second adjacent qubit of the respective focus qubit, wherein the controlled-NOT gates of the symmetrical chain structure are either singly-controlled-CNOT gates or relative-phase Toffoli gates, based on whether the second adjacent qubit of the focus qubit of the respective controlled-NOT gate is a control qubit of the MOR gate; and one or more additional rotation gates located at the centre of the symmetrical chain structure; identifying a plurality of native gates corresponding to each of the quantum sub-circuits, the native gates being gates acting on up to two adjacent qubits, the plurality of native gates comprising: singly-controlled-NOT gates, and one or more of: Hadamard gates, T gates, and S gates; identifying a final quantum circuit corresponding to the multi-controlled rotation gate, the final quantum circuit comprising the plurality of native gates and the one or more first rotation gates acting on the target qubit (qt); and outputting an indication of the final quantum circuit.

[0007] Therefore, a multi-controlled rotation gate may be compiled into native gates of a quantum computer (e.g. Clifford+T gates) in a manner which reduces constraints on the location and order of qubits, and reduces the overall number of gates in the final quantum circuit. As such, the multicontrolled rotation gate may be compiled more efficiently (i.e. faster and consuming fewer computational resources). Furthermore, the final quantum circuit may have a reduced cost and / or depth, leading to more efficient implementation of that multi-controlled rotation gate by the quantum computer, which additionally reduces errors in the quantum computer (as fewer gates are being executed).

[0008] In some examples, the respective edge qubit of the range of qubits on which the multi-controlled-Z gates act is the target qubit (qt). This may be the case, for example, for multicontrolled SU(2) (MCSLI2) gates and some multi-controlled U(2) (MCLI2) gates. It should be appreciated that different multi-controlled-Z gates may cover different ranges of qubits and thus that different multi-controlled-Z gates may have different respective edge qubits.

[0009] In some cases, wherein the target qubit has two neighbouring qubits (qt+i , qt-i) included within the set of qubits, wherein the plurality of multi-qubit relative-phase gates (A) included in the first quantum circuit comprise: two first multi-qubit relative-phase gates (Ai, A^) each acting on a first group (Ci) of the control qubits and a first neighbouring qubit (qt-i) of the target qubit, and two second multi-qubit relative-phase gates (A2, A2f) each acting on a second group of the control qubits (C2) and a second neighbouring qubit (qt+1 ) of the target qubit, wherein the plurality of multi-controlled-Z gates included in the first quantum circuit include: two first multi-controlled-Z gates each acting on the first group (Ci) of the control qubits and the target qubit (qt), and two second multi-controlled-Z gates each acting on the second group (C2) of the control qubits and the target qubit (qt). Accordingly, multi-controlled rotation gates may be compiled when the target qubit has multiple neighbours in a set of qubits. The “set of qubits” in which the target qubit is included maybe the smallest set of qubits including the target qubit and all control qubits of the MCR gate, as well as any ancilla qubits therebetween.

[0010] According to some examples, wherein based on whether the first neighbouring qubit (qt-i) is a control qubit of the MCR gate: the respective edge qubit of the two first multi-controlled-Z gates is either the target qubit (qt) or the second neighbouring qubit (qt+i ) , and the two first multi-controlled-Z gates each selectively additionally act on the first neighbouring qubit (qt-i) , the first multi-qubit relative-phase gates (Ai, A^) selectively additionally act on the target qubit (qt), and pairs of first multi-controlled-Z gates and first multi-qubit relative-phase gates (Ai, A^) are selectively bounded by two swap gates acting on the target qubit (qt) and the second neighbouring qubit (qt+i); and wherein based on whether the second neighbouring qubit (qt+i) is a control qubit of the MCR gate: the respective edge qubit of the two second multi-controlled-Z gates is either the target qubit (qt) or the first neighbouring qubit (qt-i), and the two second multi-controlled-Z gates each selectively additionally act on the second neighbouring qubit (qt+i), the second multiqubit relative-phase gates (A2, A2f) selectively additionally act on the target qubit (qt), and pairs of first multi-controlled-Z gates and first multi-qubit relative-phase gates (A2, A2f) are selectively bounded by two swap gates acting on the target qubit (qt) and the first neighbouring qubit (qt-1). Accordingly, multi-controlled rotation gates may be compiled when either or both neighbouring qubits of the target qubit are control qubits.

[0011] In some examples, the target qubit (qt) has one neighbouring qubit (qt-1) included within the set of qubits, wherein the plurality of multi-qubit relative-phase gates (A) included in the first quantum circuit comprise two multi-qubit relative-phase gates (Ai , A^) each acting on a first group the control qubits and the neighbouring qubit (qt-1) , wherein the plurality of multi-controlled-Z gates included in the first quantum circuit include two multi-controlled-Z gates each acting on the first group of control qubits and additionally acting on the target qubit (qt), and wherein based on whether the neighbouring qubit (qt.i) is a control qubit: the first quantum circuit selectively additionally includes two singly-controlled Z gates acting on the target qubit (qt) and the neighbouring qubit (qt-1 ) . As such, multi-controlled rotation gates may be compiled when the target qubit has only one neighbour in the set of qubits, and regardless of whether that neighbouring qubit is a control qubit or not.

[0012] According to certain examples, the MCR gate is in a unitary group of gates of degree two (U(2)), wherein the target qubit has two neighbouring qubits in the set of qubits, wherein a first neighbouring qubit of the target qubit (qt) is a first ancilla qubit (qa) having a predetermined state; wherein the plurality of multi-controlled-Z gates of the first quantum circuit comprise: a first plurality of multi-controlled-Z gates acting on a first group (Ci) of the control qubits, and a second plurality of multi-controlled-Z gates acting on a second group (C2) of the control qubits, wherein the first plurality of multi-controlled-Z gates selectively additionally act on either the target qubit (qt) or the first ancilla qubit (qa) based on whether a second neighbouring qubit (qt-1) of the target qubit (qt) is a control qubit of the MCR gate, and wherein the second plurality of multi-controlled-Z gates selectively additionally act on either the first ancilla qubit (qa) or the target qubit (qt) based on whether another neighbouring qubit (qa+i) of the first ancilla qubit (qa) other than the target qubit (qt) is a control qubit of the MCR gate; wherein the plurality of multi-qubit relative-phase gates (A) comprise: a first plurality of multi-qubit relative-phase gates (Ai, A^) acting on the first group (Ci) of the control qubits and the second neighbouring qubit (qt-1), and a second plurality of multi-qubit relative-phase gates (A2, A2f) acting on the second group (C2) of the control qubits and the other neighbouring qubit (qa+i) of the first ancilla qubit (qa), wherein the first plurality of multiqubit relative-phase gates (Ai, A^) selectively additionally act on the target qubit (qt) based on whether the second neighbouring qubit (qt-1) of the target qubit (qt) is a control qubit of the MCRgate, and wherein the second plurality of multi-qubit relative-phase gates (A2, A2f) selectively additionally act on the first ancilla qubit (qa) based on whether the other neighbouring qubit (qa+i) of the first ancilla qubit (qa) is a control qubit of the MCR gate; wherein the first quantum circuit additionally comprises a plurality of second rotation gates acting on the first ancilla qubit (qa); wherein the first quantum circuit additionally comprises a plurality of CNOT gates, wherein the plurality of CNOT gates comprise a first plurality of CNOT gates and a second plurality of CNOT gates, wherein the first plurality of CNOT gates bound the first plurality of multi-controlled-Z gates and first plurality of multi-qubit relative-phase gates (A1, Ai1), and wherein the second plurality of CNOT gates bound the second plurality of multi-controlled-Z gates and second plurality of multiqubit relative-phase gates (A2, A2f); wherein based on whether the second neighbouring qubit (qt.1) of the target qubit (qt) is a control qubit of the MCR gate: the first plurality of CNOT gates either act on the target qubit (qt) according to the state of the first ancilla qubit (qa) or act on the first ancilla qubit (qa) according to the state of the other neighbouring qubit (qa+i) of the first ancilla qubit (qa); wherein based on whether the other neighbouring qubit (qa+i) of the first ancilla qubit (qa) is a control qubit of the MCR gate: the second plurality of CNOT gates either act on the first ancilla qubit (qa) according to the state of the target qubit (qt) or act on the target qubit (qt) according to the state of the second neighbouring qubit (qt-1); wherein the first quantum circuit selectively additionally comprises a plurality of SWAP gates bounding the plurality of multi-controlled-Z gates and multi-qubit relative-phase gates based on whether the second neighbouring qubit (qt-1) and / or other neighbouring qubit (qa+i) of the first ancilla qubit (qa) are control qubits of the MCR gate. As such, MCLI2 gates may be compiled into native gates when the target qubit of the MCLI2 gate has multiple neighbours in the set of qubits.

[0013] According to some examples, the MCR gate is in a unitary group of gates of degree 2 (U(2)), and wherein the target qubit (qt) has only one neighbouring qubit in the set of qubits, and wherein the neighbouring qubit is a first ancilla qubit (qa) having a predetermined state; wherein the one or more first rotation gates of the first quantum circuit comprise a singly-controlled rotation gate acting on the target qubit (qt) according to the state of the first ancilla qubit (qa), wherein a rotation amount and rotation axis of the singly-controlled rotation gate correspond to the rotation amount and rotation axis of the MCR gate; wherein the plurality of multi-controlled-Z gates of the first quantum circuit act on the first ancilla qubit (qa) and the plurality of control qubits and wherein the respective edge qubit for each of the multi-controlled-Z gates is the first ancilla qubit (qa); wherein the plurality of multi-qubit relative-phase gates (A) each act on the plurality of control qubits and another neighbouring qubit of the first ancilla qubit (qa) other than the target qubit (qt); and wherein the first quantum circuit additionally comprises a plurality of second rotation gates acting on the first ancilla qubit (qa) according to the state of a neighbouring qubit of the first ancilla qubit (qa) other than the target qubit (qt). As such, MCLI2 gates may be compiled into native gates when the target qubit of the MCLI2 gate has only one neighbour in the set of qubits.

[0014] In some cases, the plurality of second rotation gates comprise, based on whether of a first neighbouring qubit of the first ancilla qubit (qa) other than the target qubit (qt) is a control qubit of the MCR gate, either Hadamard gates acting on the first ancilla qubit (qa) or singly-controlled rotation gates d“|v) acting on the first ancilla qubit (qa) according to the state of the first neighbouring qubit. As such, MCLI2 gates may be compiled into native gates when the target qubit of the MCLI2 gate has only one neighbour in the set of qubits regardless of whether a neighbouring qubit of the first ancilla qubit is a control qubit of the MCR gate or not.

[0015] In certain examples, the method further comprises: identifying one or more re-orderings to the set of qubits to cause the target qubit (qt) to have the first ancilla qubit (qa) as an only neighbouring qubit, and wherein the final quantum circuit includes a plurality of CNOT gatesimplementing the one or more identified re-orderings. As such, the compilation scheme for MCLI2 gates where the target qubit has only one neighbour may be used in cases where the ordering of qubits as included in the identification of the set of qubits is not compatible with this compilation scheme, as qubits may be reordered. This is particularly useful in cases where the number of required reordering is small, as the cost of performing said reorderings is likely to be less than the cost of using the compilation scheme for MCLI2 gates where the target qubit has multiple neighbours.

[0016] According to some examples, the MCR gate is a multi-controlled NOT (MCX) gate; wherein the set of qubits includes one or more ancilla qubits; wherein the one or more first rotation gates of the first quantum circuit comprise a plurality of Hadamard gates; wherein the plurality of multi-controlled-Z gates of the first quantum circuit each additionally act on a first ancilla qubit (qa) of the one or more ancilla qubits, wherein the target qubit (qt) of the MCX gate is set as a control qubit for one or more of the multi-controlled Z gates; wherein the plurality of multi-qubit relativephase gates (A) of the first quantum circuit each act on a particular neighbouring qubit (qa+1 , qa-1) of the first ancilla qubit (qa); wherein the first quantum circuit additionally comprises a plurality of second rotation gates d“|v) acting on the first ancilla qubit (qa); wherein the respective edge qubit of the range of qubits on which the multi-controlled-Z gates act is the first ancilla qubit (qa); and wherein the method further comprises identifying native gates corresponding to the plurality of second rotation gates (r|v). As such, MCX gates may be compiled into native gates in a manner which reduces overall depth and cost in the final quantum circuit.

[0017] In some cases, the first ancilla qubit (qa) has two neighbouring qubits (qa+i , qa-i) included within the set of qubits, and wherein both of the neighbouring qubits (qa+i , qa-i) are either the target qubit (qt) of the MCX gate or a control qubit of the plurality of control qubits of the MCX gate; wherein the plurality of multi-controlled Z gates of the first quantum circuit comprise: a plurality of first multi-controlled Z gates acting on a first group (Ci) of the plurality of control qubits and the first ancilla qubit (qa), and a plurality of second multi-controlled Z gates acting on a second group (C2) of the plurality of control qubits and the first ancilla qubit (qa); wherein the plurality of multi-qubit relative-phase gates (A) comprise: a first plurality of multi-qubit relative-phase gates (A1, Ai1) acting on the first group (Ci) of the plurality of control qubits, and a first neighbouring qubits (qa.i) of the first ancilla qubit, wherein the first neighbouring qubit (qa.i) is located between the first ancilla qubit (qa) and a first group (Ci) of the plurality of control qubits, and a second plurality of multi-qubit relative-phase gates (A2, A2t) acting on the second group (C2) of the plurality of control qubits, and the second neighbouring qubit (qa+i) of the first ancilla qubit (qa), wherein the second neighbouring qubit (qa+i) is located between the first ancilla qubit (qa) and the second group (C2) of the plurality of control qubits; and wherein the plurality of second rotation gates d“|v) acting on the first ancilla qubit (qa) comprise: doubly-controlled rotation gates acting on the first ancilla qubit (qa) according to both neighbouring qubits (qa+i , qa.i); and wherein the method further comprises identifying native gates corresponding to the plurality of second rotation gates (Hv). Therefore, MCX gates may be compiled when both neighbouring qubits of a chosen ancilla qubit of the MCX gate are control qubits (or the target qubit) of the MCX gate.

[0018] In some cases, the first ancilla qubit (qa) has two neighbouring qubits (qa+i , qa-i) included within the set of qubits, and wherein of the two neighbouring qubits (qa+i, qa-i) only a first neighbouring qubit (qa.i) is either the target qubit (qt) of the MCX gate or a control qubit of the plurality of control qubits of the MCX gate, wherein the first neighbouring qubit (qa.i) is located between the first ancilla qubit (qa) and a first group (Ci) of the plurality of control qubits; wherein the plurality of multi-controlled Z gates of the first quantum circuit comprise: a plurality of first multi-controlled Z gates acting on a first group (Ci) of the plurality of control qubits and the firstancilla qubit (qa), and a plurality of second multi-controlled Z gates acting on a second group (C2) of the plurality of control qubits and the first ancilla qubit (qa); wherein the plurality of multi-qubit relative-phase gates (A) comprise: a first plurality of multi-qubit relative-phase gates (A1, Ai1) acting on the first group (Ci) of the plurality of control qubits, and the first neighbouring qubit (qa.1), and a second plurality of multi-qubit relative-phase gates (A2, A2f) acting on the second group (C2) of the plurality of control qubits, and a second neighbouring qubit (qa+i) of the first ancilla qubit (qa); and wherein the plurality of second rotation gates d“|v) acting on the first ancilla qubit (qa) comprise: singly-controlled rotation gates acting on the first ancilla qubit (qa) according to the first neighbouring qubit (qa.i); and wherein the method further comprises identifying native gates corresponding to the plurality of second rotation gates (Hv). Therefore, MCX gates may be compiled when only one of the neighbouring qubits of a chosen ancilla qubit of the MCX gate is a control qubit (or the target qubit) of the MCX gate.

[0019] In some cases, the first ancilla qubit (qa) has two neighbouring qubits (qa+i , qa-i) included within the set of qubits, and wherein neither of the two neighbouring qubits (qa+i , qa-i) are the target qubit (qt) of the MCX gate or a control qubit of the plurality of control qubits of the MCX gate; wherein the plurality of multi-controlled Z gates of the first quantum circuit comprise: a plurality of first multi-controlled Z gates acting on a first group (Ci) of the plurality of control qubits and the first ancilla qubit (qa), and a plurality of second multi-controlled Z gates acting on a second group (C2) of the plurality of control qubits and the first ancilla qubit (qa); wherein the plurality of multi-qubit relative-phase gates (A) comprise: a first plurality of multi-qubit relative-phase gates (A1, Ai1) acting on the first group (Ci) of the plurality of control qubits, and a first neighbouring qubit (qa.i) of the first ancilla qubit, wherein the first neighbouring qubit (qa.i) is located between the first group (Ci) of the plurality of control qubits and the first ancilla qubit (qa), and a second plurality of multi-qubit relative-phase gates (A2, A2f) acting on the second group (C2) of the plurality of control qubits, and a second neighbouring qubit (qa+i) of the first ancilla qubit (qa); and wherein the plurality of second rotation gates d“|v) acting on the first ancilla qubit (qa) are Hadamard gates. Therefore, MCX gates may be compiled when none of the neighbouring qubits of a chosen ancilla qubit of the MCX gate are control qubits (or the target qubit) of the MCX gate.

[0020] According to some examples, one or more of the groups of the plurality of control qubits include control qubits which are adjacent to one or more other control qubits. As such, the present compilation techniques do not require that control qubits of the MCZ gates must have an ancilla qubit therebetween, allowing for fewer multi-qubit relative-phase gates and MCZ gates in the first quantum circuit. Therefore, the efficiency of the compilation process is improved, and the cost and depth of the final quantum circuit is reduced.

[0021] In some cases, determining the plurality of quantum sub-circuits comprises determining an orientation of relative-phase Toffoli gates of the symmetrical chain structure based on predetermined depth-reduction rules. As such, the overall depth of the final quantum circuit can be reduced.

[0022] According to certain examples, identifying the final quantum circuit comprises identifying two or more gates to be executed in parallel to reduce the depth of the final quantum circuit, and wherein in the final quantum circuit the two or more gates are to be executed in parallel. As such, the overall depth of the quantum circuit can be reduced.

[0023] In some cases, the method further comprises: 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 native gate or a depth for a particular native gate in the final quantum circuit; and wherein the final quantum circuit includes a plurality of CNOT gates implementing the one or moreidentified re-orderings. As such, cost and / or depth reductions can be implemented in a manner which targets particular quantum gates, such as CNOT or T gates.

[0024] According to some examples, the one or more additional rotation gates located at the centre of the symmetrical chain structure comprise a multi-controlled iZ gate. In some cases, these multi-controlled iZ gates may be implemented as a multi-controlled iZ gate plus a SWAP gate, as the SWAP gates may cancel out for pairs of MCZ and multi-qubit relative-phase gates. As such, the multi-controlled iZ gates may be implemented as native gates in an efficient manner.

[0025] According to a second aspect of the invention, there is provided a system comprising: a memory; and one or more processors configured to carry out any of the methods as described above.

[0026] According to a third aspect of the invention, there is provided a computer-readable medium comprising instructions which, when executed on a computer, cause the computer to carry out any of the methods as described above.

[0027] According to a fourth aspect of the invention, there is provided: a quantum circuit for implementing multi-controlled iZ gate using a quantum computer, the 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 Hadamard gate acting on the second control qubit; a first CNOT gate acting on the first control qubit according to the second control qubit; a second CNOT gate acting on the second control qubit according to the target qubit; an S gate acting on the first control qubit, and an Sfgate acting on the second control qubit; a third CNOT gate acting on the second control qubit according to the first control qubit; a second Hadamard gate acting on the first control qubit, a first T gate acting on the second control qubit, and a third T gate acting on the target qubit; a fourth CNOT gate acting on the second control qubit according to the first control qubit; a fifth CNOT gate acting on the second control qubit according to the target qubit; a third T gate acting on the first control qubit, and a gate acting on the second control qubit; a sixth CNOT gate acting on the first control qubit according to the second control qubit; and a seventh CNOT gate acting on the second control qubit according to the target qubit. Accordingly, multicontrolled iZ gate may be implemented using native gates in a manner which reduces the cost and depth.Brief Description of the Drawings

[0028] 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 \x ).

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

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

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

[0032] Figure 4 illustrates the conversion of a MCSLI2 gate around an arbitrary axis into a MCSLI2 gate around the x axis.

[0033] Figure 5 illustrates the conversion of a MCSLI2 gate into multi-qubit relative-phase gates and multi-controlled-Z gates.

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

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

[0036] Figure 8 illustrates decompositions of a rel ative- phase Toffoli gate and a doubly-controlled iZ gate into Clifford+T gates.

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

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

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

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

[0041] Figure 13 illustrates a decomposition of a multi-qubit relative phase gate into a symmetrical chain structure according to an example of the present disclosure.

[0042] Figure 14A illustrates two equivalent circuits for the first group of gates included in the centre of the middle portion of Figure 13.

[0043] Figure 14B illustrates two equivalent circuits for the second group of gates included in the centre of the right-hand portion of Figure 13.

[0044] Figure 15 illustrates an equivalent quantum circuit for an MCSLI2 gate according to an example of the present disclosure.

[0045] Figure 16 illustrates an equivalent quantum circuit for an MCSLI2 gate according to an example of the present disclosure.

[0046] Figure 17 illustrates an equivalent quantum circuit for an MCSLI2 gate according to an example of the present disclosure.

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

[0048] Figure 19 illustrates an equivalence between an MCX gate and a multi-controlled Z gate with two Hadamard gates, and a shorthand notation thereof.

[0049] Figure 20 illustrates an equivalent quantum circuit for an MCX gate according to an example of the present disclosure.

[0050] Figure 21 illustrates an equivalent quantum circuit for an MCX gate according to an example of the present disclosure.

[0051] Figure 22A illustrates an equivalent quantum circuit for the flvgates included in the quantum circuit shown in Figure 21.

[0052] Figure 22B illustrates an equivalent quantum circuit for the flvgates included in the quantum circuit shown in Figures 23 and 27.

[0053] Figure 23 illustrates an equivalent quantum circuit for an MCX gate according to an example of the present disclosure.

[0054] Figure 24 illustrates an equivalent quantum circuit for an MCX gate according to an example of the present disclosure.

[0055] Figure 25 illustrates the conversion of a MCLI2 gate into multi-qubit relative-phase gates and multi-controlled-Z gates.

[0056] Figure 26 illustrates an equivalent quantum circuit for an MCLI2 gate according to an example of the present disclosure.

[0057] Figure 27 illustrates an equivalent quantum circuit for an MCU2 gate according to an example of the present disclosure.

[0058] Figure 28 illustrates an equivalent quantum circuit for an MCU2 gate according to an example of the present disclosure.

[0059] Figure 29 illustrates an equivalent quantum circuit for an MCU2 gate according to an example of the present disclosure.

[0060] Figure 30A illustrates a decomposition of a doubly-controlled iZ gate into Clifford+T gates.

[0061] Figure 30B illustrates a decomposition of a doubly-controlled iZ gate plus a SWAP gate into Clifford+T gates.

[0062] Figure 31 A illustrates a decomposition of a relative-phase Toffoli gate using short-hand notation.

[0063] Figure 31 B illustrates a portion of a symmetrical chain structure having orientations of relative phase Toffoli gates which permit depth reductions in the final quantum circuit.

[0064] Figure 31 C illustrates equivalent native gate circuits corresponding to sub-circuits shown in Figure 31 C in order to reduce the depth of the final quantum circuit.

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

[0066] Figure 33 illustrates a computer-implemented method according to the present disclosure.Detailed DescriptionQubits and Quantum Gates

[0067] Quantum computing encompasses computing technologies which use quantum bits, referred to as ‘qubits’, to store information and perform calculations. The state of a qubit \ (J) can exist in a superposition of two states |0) and |1>, and as such may be described as a linear combination of |0) and 11>, such that \ (J) = a|0) + 11>, where a and are complex numbers and l«l2+ l / ?l2= 1- Upon measuring the state of a qubit, the qubit takes a value of either |0) or |1) based on the probability amplitudes \a |2and | ?|2for the states |0) and |1) respectively. Qubits therefore 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 stateof a qubit 100 may be considered a vector of 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 11>, and the x and y axes are orthogonal to the z axis and to each other. The angle 0 is defined between the z axis and and the angle (p is defined between the x axisand the projection of |t ) on the x-y plane (as in conventional spherical co-ordinates), such that a = cos Q) and ft = ei9,sin (^).

[0068] The state of a qubit, namely the values of a and p (or 0 and <p) 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 TT 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 gates respectively. A Y gate maps |0) to i 10), and maps |1) to - i 10) by rotating the state of the qubit TT radians about the y axis, and a Z gate leaves |0) unchanged but maps |1) to -|1) by rotating the state of the qubit TT radians about the z axis, thereby changing the relative phase el<f>of the qubit state. Another common gate is the Hadamard gate, also referred to as the H gate, which converts a state of |0) or |1) into an equal superposition of both states. The H gate corresponds to a radians rotation about the y axis, followed by a TT 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 axis byn / 2 radians, such that S = Vz. The T gate is similar to the S gate and rotates the state of the qubit around the z axis byn / ^ radians, such that T = Vs = Vz.

[0069] 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).

[0070] 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.

[0071] In addition to standard quantum gates, the Hermitian conjugate (also referred to as the Hermitian adjoint, Hermitian or adjoint), denoted by the t 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 axis by radians, the gate rotates the state of the qubit around the z axis by ~n / radians.

[0072] 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

[0073] 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.

[0074] 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 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.

[0075] 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.

[0076] 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.

[0077] 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, 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.

[0078] 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 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

[0079] 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 Sfand 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 gate, and an S gate may be an S gate or a 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 P) 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(0), Ry(0), Rz(0), P(cp), 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.

[0080] 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 thecost 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

[0081] 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 (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.

[0082] 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 circuit210 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.

[0083] 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.

[0084] 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 intoa 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.

[0085] 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 261 a-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 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).

[0086] 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 261 a-n, and an timing and / or order of the one or more EM pulses.

[0087] 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.

[0088] 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

[0089] 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 quantumcircuit 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 ci-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. Figure 3B shows an alternative condensed illustration used throughout the present disclosure. In particular, the left-hand side of Figure 3B denotes a rotation operator O applied to a target qubit t, with control qubits C, where C e Q', with Q being a larger set of qubits, of which the control qubits C are a subset. The right-hand side of Figure 3B shows a longer form of the left-hand side of Figure 3B using similar notation to that used in Figure 3A. In particular, the set of qubits Q' includes k' qubits, of which n qubits are control qubits (i.e. in the subset C), and k'-n are non-control qubits (i.e. in the other subset Q'\C). The control qubits for the rotation operator O applied to a target qubit t are the n qubits in subset C. It should be appreciated that qubits within the set Q' may be arranged in any order such that control qubits may be interspersed with non-control qubits.

[0090] Multi-controlled gates, such as those shown in Figure 3, 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.

[0091] 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.

[0092] There are various types of multi-controlled rotation gates. One type of gate is the multicontrolled SU(2) (MCSLI2) 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 of size 2 x 2, with determinant equal to 1. Such an MCSLI2 gate may selectively rotate the state of a 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-controlled U(2) (MCU2) gates, which are gates corresponding to a matrix of size 2 x 2, but which do not necessarily have determinant equal to 1. MCLI2 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.

[0093] Various approaches for compiling multi-controlled gates are described in United Kingdom Patent Application GB2400342.8, the contents of which are hereby incorporated by reference in their entirety. The approaches therein utilise a plurality of multi-controlled-Z gates and a plurality of multi-qubit relative-phase gates acting on a group of the plurality of control qubits asintermediary gates which are then collectively decomposed (i.e. converted) into a series of relative-phase Toffoli gates and a controlled-Z gate, which are then converted to a plurality of base cases comprising: CNOT and H and / or T gates. According to the techniques of GB2400342.8, for quantum computers not having ATA connectivity, each of the multi-controlled-Z gates (and corresponding multi-qubit relative-phase gates) is in general not permitted to have neighbouring control qubits (except for the end two qubits). As such, in general, at least four multiqubit relative-phase gates (and multi-controlled-Z gates) are required to compile a multi-controlled gate in order to implement the neighbouring control qubit constraint. Furthermore, for quantum computers not having ATA connectivity, the techniques of GB2400342.8 also require the target qubit of the multi-controlled gate to have only one logical neighbour in the set of qubits including the target qubit and the control qubits (and any qubits between control qubits). In other words, the target qubit must be located at the top or bottom of the set of qubits for the multi-controlled gates.

[0094] The techniques of the present disclosure provide approaches for compiling multicontrolled rotation gates which allow the target qubit to be located at any location in the set of qubits spanned by the multi-controlled rotation gate for the compiling process without using SWAP gates. Moreover, in cases where the target qubit is located at the top or bottom of the set of qubits (i.e. the target qubit has only one neighbour in the set of qubits), the number of a plurality of multi-controlled-Z gates and multi-qubit relative-phase gates required is two, as the combination of the a plurality of multi-controlled-Z gates and multi-qubit relative-phase gates are decomposed in a manner which permits the a plurality of multi-controlled-Z gates and multi-qubit relative-phase gates to have neighbouring control qubits. As such, the total number CNOT and H and / or T gates in the final quantum circuit can be reduced.

[0095] In particular, the present disclosure provides a computer-implemented method for compiling a multi-controlled rotation (MCR) gate of a quantum circuit quantum computing device, 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 (qt) , and a plurality of control qubits; decomposing the MCR gate into a first quantum circuit, the first quantum circuit comprising: a one or more first rotation gates acting on the target qubit (qt), a plurality of multi-qubit relative-phase gates (A) each acting on particular groups of the plurality of control qubits, and a plurality of multi-controlled-Z gates acting on respective groups of the plurality of control qubits, wherein the plurality of multi-controlled-Z gates span a respective range of qubits, and wherein each multi-controlled-Z gate additionally acts on a respective edge qubit defining an edge of the respective range of qubits; determining a plurality of quantum sub-circuits based on decomposing a combination of at least the plurality of multi-qubit relative-phase gates (A) and the plurality of multi-controlled-Z gates of the first quantum circuit, wherein each quantum sub-circuit comprises: a symmetrical chain structure of controlled-NOT gates spanning the respective range of qubits on which the particular multi-controlled-Z gate acts, wherein consecutive controlled-NOT gates of the symmetrical chain structure act on consecutive focus qubits according to a first adjacent qubit of the respective focus qubit, wherein the first adjacent qubit of the respective focus qubit is located closer to the respective edge qubit of the range of qubits than a second adjacent qubit of the respective focus qubit, wherein the controlled-NOT gates of the symmetrical chain structure are either singly-controlled-CNOT gates or relative-phase Toffoli gates, based on whether the second adjacent qubit of the focus qubit of the respective controlled-NOT gate is a control qubit of the MCR gate; and one or more additional rotation gates located at the centre of the symmetrical chain structure; converting each of the quantum sub-circuits to a plurality of native gates, the native gates being gates acting on up to two adjacent qubits, the plurality of native gates comprising: singly-controlled-NOT gates, and one or more of: Hadamard gates, T gates, and S gates; identifying afinal quantum circuit corresponding to the multi-controlled rotation gate, the final quantum circuit comprising the plurality of native gates and the one or more first rotation gates acting on the target qubit (qt); and outputting an indication of the final quantum circuit.Multi-Controlled SU(2) (MCSU2) gates

[0096] Figure 4A illustrates a general decomposition according to GB2400342.8 of a multicontrolled SU(2) (MCSLI2) RV( ) gate 400 which operates on a target qubit 430, and applies an arbitrary rotation of angle A around an arbitrary axis v. The MCSLI2 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 Ci 420(1) and C2420(2) containing nciand nC2 qubits respectively, where nc= ncl+ nc2.

[0097] As shown on the right section of Figure 4, a general MCSLI2 gate 400 which rotates the state of a qubit around an arbitrary axis v can be decomposed into a multi-controlled rotation gate 401 applying a rotation angle A around the x axis (or any other axis) bounded by two single-qubit rotation gates |“| 402 acting on the target qubit 430. The multi-controlled rotation gate 401 acts on the target qubit 430 according to the state of the control qubits 420. The single-qubit rotation gates □ 402 apply a rotation of TT radians about a chosen axis w with a phase i, where the x axis, the v axis and the w axis are on the same plane, and the angle between the x axis and the w axis is equal to the angle between the w axis and the v axis. As such, the w axis bisects the angle between the x axis and the v 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.

[0098] By changing the axis of rotation of the multi-controlled rotation gate from an arbitrary axis v to the x axis, the multi-controlled rotation gate 400 can be decomposed as shown in Figure 5. As shown on the right-hand side of Figure 5, such an arbitrary MCSLI2 RV( ) gate 400 may be decomposed into a combination of single-qubit rotation gates A1-A4460, a plurality of multi-qubit relative-phase gates AX,A2,A^,A^ 450 acting on the control qubits 420, and, for each of the 2l2, 21^,212 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-A4 gates 460 are each rotations by particular angles around the x or z axis (i.e. Rx(0), or Rz(<p))or anH gate, depending on the particular multicontrolled gate being decomposed.

[0099] The single-qubit rotation gates A1-A4460 may each correspond one or more single-qubit rotation gates. For example, in the case of an MCSLI2 gate 400, A4 460(1) corresponds to a rotation gate Rx(6i) about the x axis by an angle 0i arranged in series with a rotation gate Rz(02) about the z axis by an angle 02 (i.e. Rz(02) is arranged after Rx(9i))- The angles and 02depend on the axis v, and may be determined based on decomposing the |“| gates 402 into single-qubit Rx(rotation about the x axis) gates and single-qubit Rz(rotation about the z axis) gates, for example using Euler decompositions. In particular, the x-z-x Euler decomposition may be used to decompose the |“| gate 402(1) into Rx(6i) followed by Rz(02) followed by Rx(03), and as the |“| gate 402(1) is Hermitian it is equivalent to its inverse, and the |“| gate 402(2) may be decomposed as Rx(-03) followed by Rz(-02) followed by As the multi-controlled rotation gate 401 rotates the target qubit 430 about the x axis, two Rxgates commute and cancel out, resulting in A4460(1) being equivalent to RX^T ) followed by Rz(02).

[0100] A2460(2), (4) corresponds to rotation gate Rx- 4) about the x axis by an angle - 4, where A is the angle of rotation of the MCSLI2 gate 400 about the arbitrary axis v. A3460(3) corresponds to rotation gate about the x axis by an angle ^ / 4. A1 460(5) corresponds toa rotation gate rotation gate about the x axis by an angle ^ / 4, arranged in series with a rotation gate Rz(-02) about the x axis by angle -02, arranged in series with a rotation gate Rx-91') about the z axis by an angle -0i (i.e. is arranged after Rz(-02)). In other words, A is equivalent to A3followed by A . 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 MCSLI2 gate 400 is transformed into a multi-controlled rotation gate about the y axis (as opposed to the y axis, as shown in Figure 4), all Rx(rotation about the x axis) gates in the single-qubit rotation gates A1-A4460 would be replaced by Ry(rotation about the y axis) gates, and theand 02may be determined using the y-z-y Euler decomposition of the |“| gate 402.

[0101] As shown in Figure 5, the MCSLI2 gate 400 acts on target qubit qis 430 according to a plurality of control qubits {q0, q2, qs, q?-qio, qi2-qi4, q , qn} 420. Ancilla qubits (qi, q3, q4, qe, qn, qi5) 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 5 may reflect (i.e. be based on) the physical ordering of qubits in a quantum computer. In this case, as the set of control qubits include adjacent qubits, The set of control qubits ({qo, q2, qs, q?-qio, qi2-qi4, q , qn}) is split into two subsets of control qubits, as per Figure 4. 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. In the example of Figure 5, the first set of control qubits 420(1) includes qubits: {q0, q2, qs, q?, q , qi2, qu, q }, and the second set of control qubits 420(2) includes qubits: {q8, qg, q^, q 17}.

[0102] The use of the A , 2l2, 21^212 gates 450 in the way shown in Figure 5 has no overall effect on the operator implemented by the circuit, as the phases introduced by these gates cancel out. However, the addition of said A-^A^- A^A^ gates 450 and the MCZ gates 440 allows for a particular gate decomposition. Specifically, each of the multi-qubit relative-phase gates A , A3, A^ A 450 and their respective MCZ gates 440 are collectively decomposed (i.e. converted) into a chain structure. Figure 6 shows the decomposition of the combination of the A 450(1) gate and its respective MCZ gate 440(1) into a chain structure comprising a plurality of relative-phase Toffoli gates. The left section of Figure 6 shows an example implementation of the A gate 450(1) and MCZ gate 440(1) shown in Figure 5, where the MCZ 440(1) gate acts on the first set of control qubits 420(1) and the A gate 450(1) acts on the plurality of control qubits 420 and the ancilla qubits therebetween. The middle section of Figure 6 shows the logical structure of the A gate 450(1) next to the MCZ gate 440. The A gate 450(1) equates to an ordered series of MCZ gates.

[0103] The right-hand section of Figure 6 shows how the combination of the A gate 450(1) and the MCZ gate 440(1) (MCZ + A- 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 symmetrical cascade 490 of relative phase Toffoli (i.e. [X ) gates 470, CNOT gates 475 and a controlled Z gate 480 located at the centre of the cascade 490 of [X gates 470 and CNOT gates 475. The cascade 490 includes a first portion 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 [X gates 470 included in the secondportion 490(2) are the same set of [X gates 470 included in the first portion 490(1) but arranged in an opposite order to the first portion 490(1).

[0104] A [X gates acts on a target qubit shown by a crossed circle, based on a first control qubit shown by a circled dot, and a second control qubit shown by a dot. The control qubits of the [X gates 470 may sometimes be referred to as influencing qubits in order to avoid confusion with control qubits of an overall circuit. Likewise, the target qubit of the [X gate may sometimes be referred to as a focus qubit in order to avoid confusion with a target qubit of an overall circuit. In the symmetrical cascade of Figure 6, the [X gates 470 are arranged such that the focus qubit is adjacent to the first influencing circuit, which is adjacent to the second control qubit. Furthermore, all [X gates 470 have the same orientation where the focus qubit is located further from the target qubit 430 of the MCSLI2 gate. The [X gates 470 are also arranged such that a focus qubit of a particular [X gate is a second influencing qubit of a neighbouring [X gate, when two [X gates neighbour one another. Two [X gates neighbour one another when the control qubits for the MCZ 440(1) gate are separated by one ancilla qubit. In cases where the control qubits of the MCZ gate 440(1) are separated by more than one ancilla qubit, CNOT gates between the neighbouring ancilla qubits are utilised as shown in Figure 6.

[0105] That is, each [X gate acts on a different non-control qubit (i.e. a qubit not in the first subset of control qubits, or the target qubit qis) as a target (i.e. focus) qubit. The first control qubit of the [X gate is a qubit neighbouring the target qubit of the [X gate which is closer to the overall target qubit 430 of the MCSU(2) gate 400. The second control qubit of the [X gate is a qubit neighbouring the qubit set as the first control qubit. Each control qubit in the first subset, except the control qubit furthest from the target qubit 430, has an associated [X gate in each portion of the symmetrical cascade, where the control qubit in the first subset is set as the first control qubit for the [X gate. Where there is more than one non-control qubit between control qubits in the first subset, one or more CNOT gates 475 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 430 of the MCSLI2 gate 400. Furthermore, as the control qubit qie in the first subset which is closest to the target qubit q^ 430 is not neighboured to the target qubit q^ 430 (i.e. an non-control qubit qi? is located between q^ and qis) , a CNOT gate is provided at the beginning and end of the chain structure acting on non-control qubit qi7, based on target qubit qi8. In this example, all gates of the chain structure in Figure 6 are Hermitian, and as such the decomposition of MCZ+ 1^ is identical to the decomposition of MCZ +(shown in Figure 6).

[0106] Figure 7 shows the decomposition of the combination of the 2l2450(2) and its respective MCZ 440(2) gate into a chain structure. The chain structure includes a symmetrical cascade comprising [X gates 470, and a controlled Z gate 480 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 480. As the control qubit q8in the second subset furthest from the target qubit qis430 is neighboured to a control qubit (i.e. qg is a control qubit), the controlled-Z gate 480 at the centre of the symmetrical cascade is doubly-controlled iZ gate, controlled by the two (neighbouring) control qubits (qs and qg) in the second subset furthest from the target qubit qis 430. The doubly-controlled iZ gate acts on an non-control qubit q which neighbours the control qubit q9for the doubly-controlled iZ gate which is closest to the target qubit qi8430.

[0107] As with the chain structure shown in Figure 6, in addition to a plurality of [X gates, the symmetrical cascade in Figure 7 additionally includes a plurality of CNOT gates 475. In particular, the placement of [X gates and CNOT gates adheres to the same rules as discussed above with respect to Figure 6. That is, each [X gate acts on a different non-control qubit (i.e. a qubit not in the second subset of control qubits, or the target qubit qis) as a target (i.e. focus) qubit. The firstcontrol qubit of the [X gate is a qubit neighbouring the target qubit of the [X gate which is closer to the overall target qubit qisof the multi-controlled SU(2) RV( ) gate. The second control qubit of the [X gate is a qubit neighbouring the qubit set as the first control qubit. Each control qubit in the second subset, except the two control qubits furthest from the target qubit qis, has an associated [X gate in each portion of the symmetrical cascade, where the control qubit in the second subset is set as the first control qubit for the ] gate. Where there is more than one noncontrol 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 q^ of the multi-controlled SU(2) Rr(A) gate. Furthermore, as the control qubit qi? in the second subset which is closest to the target qubit q^ is neighboured to the target qubit q^ (i.e. no non-control qubits are located between q^ and qis), an [X gate is located at the beginning and ends of the chain structure. These [X gates at the beginning and ends of the chain structure have qubit q^ set as the first control qubit of the [X gate, qubit q^ set as the second control qubit of the [X gate, and non-control qubit qie (neighbouring the first control qubit of the [X gate) set as the target qubit of the [X gate. In this example, the decomposition of MCZ+ I2 is identical to the decomposition of MCZ + A2(shown in Figure 7), except that for the decomposition of MCZ+ I2 the doubly-controlled iZ gate is replaced with a doubly-controlled iZ^ gate.

[0108] The chain structures for the MCZ+A gates of Figure 5 (such as those shown in Figures 6 and 7) may then be decomposed into a universal gate set, such as Clifford+T gates. For example, the [X gates and multi-controlled iZ gate may be decomposed into Clifford+T gates using the decompositions shown in Figures 8-12, 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, as described in GB2400342.8.

[0109] According to the present disclosure, the multi-qubit relative-phase gates may be defined and decomposed in a new way which allows the target qubit to be located at any location in the set of qubits spanned by the multi-controlled rotation gate for the compiling process without using SWAP gates. Decomposing a particular gate or set of gates should be understood to mean identifying a quantum circuit comprising a plurality of gates which is equivalent to the particular gate or set of gates. Moreover, in cases where the target qubit is located at the top or bottom of the set of qubits (i.e. the target qubit has only one neighbour in the set of qubits), the number of a plurality of multi-controlled-Z gates and multi-qubit relative-phase gates required is two, as the combination of the a plurality of multi-controlled-Z gates and multi-qubit relative-phase gates are decomposed in a manner which permits the a plurality of multi-controlled-Z gates and multi-qubit relative-phase gates to have neighbouring control qubits. As such, the total number CNOT and H and / or T gates in the final quantum circuit can be reduced.

[0110] In particular, according to the present disclosure the combination of an MCZ gate and multi-qubit relative phase gate may be decomposed as shown in Figure 13. Figure 13 shows an MCZ gate 610 acting on a target qubit qo 630 for an MCSLI2 gate and control qubits {q2, qs, qs, qs, qg, q } for the MCSLI2 gate within a set of qubits 620. The left-hand portion of Figure 13 also shows multi-qubit relative phase A gate 640 acting on the set of qubits 620 except the target qubit qo 630, including the control / target qubits for the MCZ gate 610 and any ancilla qubits between the control qubits in the set (i.e. all qubits in the set of qubits 620 other than the target qubit qo 630). As shown in the middle and right-hand portions of Figure 13, the combination of the MCZ gate 610 and the multi-qubit relative phase A gate 640 is decomposed into a symmetrical chain structure 600 of CNOT gates spanning the range of qubits qo-q on which the MCZ 610 acts (i.e.the control qubits and the ancilla qubits therebetween). Consecutive CNOT gates of the symmetrical chain structure act on consecutive focus qubits according to a first adjacent qubit of the respective focus qubit, wherein the first adjacent qubit of the respective focus qubit is located closer to a respective edge qubit (i.e. the target qubit qo 630 of the MCSLI2 gate) of the range of qubits than a second adjacent qubit of the respective focus qubit. The CNOT gates of the symmetrical chain structure are either singly-controlled-CNOT gates 655 or relative-phase Toffoli gates 650, based on whether the second adjacent qubit of the focus qubit of the respective CNOT gate is a control qubit of the MCR (i.e. MCSLI2) gate.

[0111] The relative-phase Toffoli gates 650 are oriented with the focus qubit of each relativephase Toffoli gate 650 neighbouring both the first and second influencing qubits of the relativephase Toffoli gate 650, with each pair of relative-phase Toffoli gates 650 (a pair of relative-phase Toffoli gates have the same influencing and focus qubits) having the same orientation. The relative-phase Toffoli gates 650 may be oriented with the first control qubit closer to the target qubit qo 630 than the second control qubit, or the relative-phase Toffoli gates 650 may be oriented with the second control qubit closer to the target qubit qo 630 than the first control qubit. As such, in Figure 13, the relative-phase Toffoli gates 650 are illustrated as standard Toffoli gates, as the first and second control qubits may be considered equivalent, provided all pairs of relative-phase Toffoli gates 650 in the symmetrical chain structure 600 have the same orientation, as the relativephases cancel out.

[0112] As mentioned above, the CNOT gates of the symmetrical chain structure are either singly-controlled-CNOT gates 655 or relative-phase Toffoli gates 650, based on whether the second adjacent qubit (an adjacent qubit of the focus qubit of the CNOT gate furthest from the edge (target) qubit qo 430) of the focus qubit of the respective CNOT gate is a control qubit of the MCR (i.e. MCSLI2) gate. This is explained in more detail with reference to the first (i.e. left-most) gate in the symmetrical chain structure 600(1). The MCZ gate 610 always acts on the edge (e.g. target) qubit qo 430, and the first CNOT gate will always have a focus qubit qi in the set of qubits 620 which neighbours the edge (i.e. target) qubit qo. In Figure 13, as the neighbouring qubit q2 of the influencing qubit qi of the first CNOT gate which is furthest from the edge qubit q0is a control qubit (or target) of the MCSLI2 gate (and therefore the MCZ gate 610 also acts on this qubit), the first CNOT gate is a doubly-controlled CNOT gate (i.e. a relative-phase Toffoli gate), with influencing qubits qo and q2. In other words, as the first CNOT gate acts on qi and qubit q2 is a control qubit of the MCSLI2 gate (i.e. the MCZ gate 610 acts on qubit q2), the first CNOT gate is a doubly-controlled CNOT gate with q2 as an influencing qubit.

[0113] Looking as another example at the second gate in the symmetrical chain structure 600(1), the focus qubit of this gate is qubit q2, as qubit q2 is adjacent the influencing qubit qi of the immediately preceding CNOT gate and is further from the edge qubit q0than the other adjacent qubit of qubit qi . As the MCZ gate 610 acts on q3(which neighbours q2and is further from q0than qi), the second CNOT gate is a doubly-controlled CNOT gate with q3as an influencing qubit. Looking at the third gate in the symmetrical chain structure 600(1), the focus qubit of this gate is qubit q3, as qubit q3is adjacent the influencing qubit q2 of the immediately preceding CNOT gate and is further from the edge qubit qo than the other adjacent qubit of qubit q2. As the MCZ gate 610 does not acts on q4 (which neighbours q3and is further from qo than q2), the third CNOT gate is a singly-controlled CNOT gate with q2 as the only influencing qubit. This logic is applied symmetrically to all gates in the symmetrical chain structures 600, such that the focus qubits of each of the gates neighbour one another.

[0114] As shown in Figure 13, one or more additional rotation gates are located at the centre of the symmetrical chain structure 600, which are collectively illustrated in Figure 13 by a group of gates 660 including a controlled-Z gate and a multi-qubit relative-phase gate (denoted as a 6 gate). The centre of the symmetrical chain structure 600 is illustrated in this way as the centreportion of the symmetrical chain structure 600 may take a number of different forms. In particular, Figure 13 shows two decompositions of the MCZ 610 and A gate 640. The decomposition shown in the middle portion of Figure 13 includes a first symmetrical chain structure 600(1) with first group of gates 660(1) located at the centre of the first symmetrical chain structure 600(1). The first group of gates 660(1) includes a controlled-Z gate acting on qubit qw, which is the qubit of the set of qubits 620 furthest from the target qubit qo 630 in the set of qubits 620. The controlled-Z gate additionally acts on qubit q8, which is a next-but-one qubit to qubit q in the set of qubits 620. The neighbouring relative-phase Toffoli gates 650 of the first group of gates 660(1) have qubit qg (i.e. the qubit neighbouring qw in the set of qubits 620) as an influencing qubit. In addition the first group of gates 660(1) additionally includes a 5 gate acting on qubits qwand q9.

[0115] The right-hand portion of Figure 13 illustrates a different decomposition of the MCZ 610 and A gate 640, where the symmetrical chain structure 600(2) includes two fewer relative-phase Toffoli gates 650 (one fewer per side of the symmetrical chain structure 600(2)), and a second group of gates 660(2) located at the centre of the symmetrical chain structure 600(2). The second group of gates 660(2) includes a controlled-Z gate, acting on qubit qw, qg, and q7. The neighbouring relative-phase Toffoli gates 650 of the second group of gates 660(2) have qubit qs as an influencing qubit. In addition the second group of gates 660(2) additionally includes a 5 gate acting on qubits qw-qs.

[0116] Figure 14A show two different decompositions of the first group of gates 660(1) in Figure 13, while Figure 14B shows various possible decompositions of the second group of gates 660(2) in Figure 13. As shown in Figure 14A, the first group of gates 660(1) is equivalent to a first CNOT gate acting on qubit q9according to qubit qs, a second CNOT gate (after the first CNOT gate) acting on qubit qw according to qubit q9, a third CNOT gate (after the second CNOT gate) acting on qubit q9according to qubit qs, as well as two Hadamard gates acting on qubit qw, where the Hadamard gates are located either side of the second CNOT gate. Alternatively, the first and third CNOT gates may be replaced by SWAP gates. As shown in Figure 14B, the second group of gates 660(2) is equivalent to first and second CNOT gates acting on qubit qs according to qubit q7, and a multi-controlled iZ gate acting on qubit q8according to qubits q9and qw. Furthermore, the first and second CNOT gates may be replaced by SWAP gates. Therefore, as can be seen from Figures 14A and 14B, the first and second group of gates 660 at the centre of the symmetrical chain structures 600 are equivalent to various different gates. Moreover, as demonstrated in Figure 13, the combination of the MCZ gate 610 and the A gate 640 can be considered equivalent to both the first and second symmetrical chain structures 660(1), (2) (when the quantum circuit additionally includes a MCZ gate and A+ gate acting on the same qubits, as illustrated and discussed throughout the present disclosure), having the first or second group of gates 660(1), (2) respectively at the centre thereof. As such, the combination of the MCZ gate 610 and the A gate 640 may more generally be decomposed to a symmetrical chain structure of CNOT gates spanning the respective range of qubits on which the MCZ gate 610 acts and one or more additional rotation gates located at the centre of the symmetrical chain structure. The one or more relative-phase gates may comprise a plurality of (singly-controlled) CNOT gates and / or SWAP gates, and one or more of: a plurality of Hadamard gates, and a multi-controlled iZ gate.

[0117] This decomposition (i.e. equivalence) of the MCZ gate 610 and A gate 640 combination to the symmetrical chain structure discussed above in relation to Figure 13 allows the target qubit to be located at any location in the set of qubits spanned by the multi-controlled rotation gate for the compiling process without using SWAP gates. Moreover, in cases where the target qubit is located at the top or bottom of the set of qubits (i.e. the target qubit has only one neighbour in the set of qubits), the number of a plurality of multi-controlled-Z gates and multi-qubit relative-phase gates required is two, as the combination of the a plurality of multi-controlled-Z gates and multiqubit relative-phase gates are decomposed in a manner which permits the a plurality of multicontrolled-Z gates and multi-qubit relative-phase gates to have neighbouring control qubits. As such, the total number CNOT and H and / or T gates in the final quantum circuit can be reduced.

[0118] For example, Figure 15 shows an example decomposition of a MCSLI2 gate 710, applying a rotation W, where W = RV( ), to a target qubit qtbased on a group of control qubits, where the group of control qubits includes a neighbouring qubit qt-i , and one or more other control qubits Ci within a set of qubits Qi. In this example, the target qthas only one neighbour. In other words, the neighbouring qubit qt-i may (or may not be) a control qubit for the MCSLI2 gate 710, and the neighbouring qubit qt-i is located between all additional control qubits for the MCSLI2 gate 710. As such, the MCSLI2 gate 710 may be decomposed as shown in Figure 15. In particular, the MCSLI2 gate may be decomposed into a first quantum circuit 700 shown in Figure 15. The first quantum circuit 700 includes a plurality of first rotation gates A1-A4760 acting on the target qubit qt, two multi-qubit relative phase gates A1, Ai1750(1), (3) acting on the control qubits (and qt-i, even though qt-1 is not required to be a control qubit) rand multi-controlled Z gates 740(1), 740(3) acting on each of the control qubits Ci except qt-1 and the target qubit qt. The plurality of first rotation gates A1-A4760 take the form of the as discussed above in relation to Figure 5.

[0119] In addition, as qubit qt-1 is a control qubit for the MCSLI2 gate 710, the first quantum circuit 700 includes additional multi-controlled Z gates 745(1), 745(2) acting only on qt-1 and qt. This is, if qt-i were not a control qubit for the MCSLI2 gate 710, then the additional multi-controlled Z gates 745(1), 745(2) would be replaced by Z gates acting on the target qubit qt, in which case the A2gates 760(2), Z gates and A3 gate 760(3) (as well as separately the A2gates 760(4), Z gates and A1 gates 760(5)) may be implemented as a single rotation gate. The combination of the multiqubit relative phase gates A1, Ai1750(1), (3) and multi-controlled Z gates 740(1), 740(3) (which are adjacent the multi-qubit relative phase gates A1, Ai1750(1), (3) in the first quantum circuit 700) can then be decomposed (i.e. converted) as discussed above in relation to Figures 13 and 14A / 14B.

[0120] It should be noted that the Ai1gate 750(3) is the Hermitian conjugate of the A1 gate 750(1). An equivalent quantum circuit corresponding to the A^ gate 750(3) therefore includes its gates applied in reverse order to the A1 gate 750(1), with each constituent gate being the Hermitian conjugate of the same constituent gate of the equivalent quantum circuit for the A1 gate 750(1). However, as the chain structure shown in Figure 13 and discussed throughout the present disclosure is symmetrical, the orders of the gates in the symmetrical chain structures corresponding to the A1 gate 750(1) and Ai1gate 750(3) are the same. Furthermore, as both CNOT and (relative-phase) Toffoli gates are Hermitian (i.e. they are their own Hermitian conjugates) the left and right-hand sides of the symmetrical chain structure are identical for both the A1 gate 750(1) and the Ai+ gate 750(3). As such, the only possible difference between the quantum circuits corresponding to the A1 gate 750(1) and Ai+ gate 750(3) is the one or more additional rotation gates 660(1), 660(2) located at the centre of the symmetrical chain structure. However, in some cases, these additional rotation gates 660(1), 660(2) may themselves also be Hermitian. For example, the 5 gate shown in the middle section of Figure 13 and in Figure 14A is Hermitian, such that 5 = 6t It should also be noted that controlled Z gates are also Hermitian and commute with the 5 gates, such that, in the case of the middle section of Figure 13, MCZ+b = b+MCZ = (MCZ+bjt = b^+MCZ Therefore, if the middle quantum circuit is identified as the equivalent quantum circuit for the MCZ+A combination of Figure 13, then A=At However, conversely, the 5 gate shown in the right-hand side of Figure 13 and in Figure 14B is not Hermitian, such that 5 6t In particular, the difference between the 5 and b1gates of the righthand section of Figure 13 and Figure 14B is that the rotation applied by the CCiZ gate shown in Figure 14B is an iZ+ rotation. In this example, therefore, (MCZ+b)t = bt+MCZ = MCZ+ 6t As such, as in this example 5 0+, A At Accordingly, as generally A is not always equivalent to At the A and A+ gates are labelled differently, however it should be appreciated that in some cases thesegates will be identical and therefore that the A and A1gates could both be labelled in the same way.

[0121] As can be seen from Figure 15, by using the decomposition of the MCZ and A gates shown in Figure 13 (and Figures 14A or 14B), the number of A gates can be reduced to two in cases where the target qubit is located at an edge of a set of qubits including all control qubits and the target qubit (and any ancilla qubits therebetween). Accordingly, the number of symmetrical chain structures of CNOT gates is reduced (compared e.g. to the example shown in Figure 5), thereby reducing the total cost (i.e. number) of CNOT gates (and other gates, such as T gates) in the compiled MCSLI2 gates.

[0122] As mentioned above, the decomposition of the MCZ and A gates shown in Figure 13 (and Figures 14A or 14B) additionally allows the target qubit to be at any location in the set of qubits (i.e. the target qubit may have multiple neighbours in a set of qubits including all the control qubits for the MCSLI2 gate, the target qubit, and any ancilla qubits therebetween). Figure 16 shows an example decomposition of an MCSLI2 gate 711 applying a rotation W, where W = Rr(A), to a target qubit qtbased on two groups of control qubits, where a first group of control qubits includes one or more control qubits Ci within a first set of qubits Qi, and a second group of control qubits includes one or more control qubits C2 within a second set of qubits Q2. Here, the target qubit qt is located between the two groups of control qubits Ci, C2. It should also be noted that in this example, neither of the neighbouring qubits qt-1 or qt+i of the target qubit qt are control qubits of the MCSLI2 gate 711.

[0123] The right-hand side of Figure 16 illustrates a quantum circuit 701 equivalent to the MCSLI2 gate 711. The quantum circuit 701 includes the plurality of first rotation gates A1-A4760 acting on the target qubit qt, the A1, A^ gates 750(1), (3) acting on the first group of control qubits Ci and qubit qt.i , and multi-controlled Z gates 740(1), 740(3) acting on each of the first group of control qubits Ci and the target qubit qt. The plurality of first rotation gates A1-A4760 take the form of the as discussed above in relation to Figure 5. As such, the quantum circuit 701 include the same gates as the quantum circuit 700 shown in Figure 15, except the controlled-Z gates 745(1), 745(2). In addition, the quantum circuit 701 includes two further multi-qubit relative phase gates A2, A2f750(2), (4) acting on the second group of control qubits C2 and qubit qt+1 , and multi-controlled Z gates 740(2), 740(4) acting on each of the second group of control qubits C2 and the target qubit qt. The combination of each of thegates 750 and their adjacent MCZ gates 740 can then be decomposed in the same manner as shown in Figure 13 (in combination with Figures 14A or 14B) and as discussed in relation to Figure 15. As such, an MCSLI2 gate 711 can be decomposed into native gates (e.g. Clifford+T gates) without requiring rearrangement of the qubits to locate the target qubit of the MCSLI2 711 at the bottom of the set of qubits.

[0124] As mentioned above, the example of Figure 16 illustrates an approach for compiling an MCSLI2 gate 711 in which the target qubit qt has two neighbouring qubits qt-i,qt+i, but where neither of these neighbouring qubits qt-1 ,qt+i are control qubits of the MCSLI2 gate. However, it should be appreciated that one or both of the neighbouring qubits qt-1 ,qt+i may be control qubits of the MCSLI2 gate to be compiled. In such situations, the quantum circuit 701 shown in Figure 16 may be modified. Figure 17 shows an example where one of the neighbouring qubits qt+i of the target qubit qt is a control qubit for an MCSLI2 gate 712, but the other neighbouring qubit qt-1 of the target qubit qtis not a control qubit for the MCSLI2 gate 712. In this example, the MCSLI2 gate 712 is decomposed into a quantum circuit 702. The quantum circuit 702 includes (as with the examples of Figures 15 and 16) the plurality of first rotation gates A1-A4 760 acting on the target qubit qt, the A1, Ai1gates 750(1), (3) acting on the first group of control qubits Ci and qubit qt-1, and multi-controlled Z gates 740(1), 740(3) acting on each of the first group of control qubits Ci and the target qubit qt.

[0125] In addition, the quantum circuit 701 includes A2, A2fgates 850(2), (4) acting on the control qubits C2 and qt+i, as well as target qubit qt. The quantum circuit 702 further includes MCZ gates 840(2), (4) adjacent the A2, A2fgates 850(2), (4), where the MCZ gates 840(2), (4) acton the control qubits C2, qubit qt+i , and qubit qt-i , but not the target qubit qt. It should be noted that the A2t gate 850(4) is the Hermitian conjugate of the A2gate 850(2), however the A2gate 850(2) may be identical to the A2fgate 850(4), as discussed above in relation to Figure 15. The combination of the MCZ gates 840(2), (4) and the A2, A2fgates 850(2), (4) can be decomposed using the same technique as discussed in relation to Figure 13 (in combination with Figure 14A or Figure 14B). However, as the A2, A2fgates 850(2), (4) act on the target qubit qt, and the MCZ gates 840(2), (4) do not act on the target qubit qtand instead act on qubit qt-i , the manner in which the technique of Figure 13 is applied is different. In particular, returning to Figure 13, when utilising the technique discussed in relation to Figure 13 in the context of the examples of Figures 15 and 16, the edge qubit qo of the symmetrical chain structure 600 was set as the target qubit qt of the respective MCSLI2 gate 700, 701. However, in the context of Figure 17, the edge qubit qo of the symmetrical chain structure 600 is set as qubit qt-i , with qubit qi set as the target qubit qt, qubit q2 set as qubit qt+i, and so forth for the remaining qubits in the second set of qubits Q2. In addition to the A2, A2t gates 850(2), (4) and the MCZ gates 840(2), (4), the quantum circuit 702 additionally includes four SWAP gates, where two SWAP gates bound each of the A2, A2t gats 850(2), (4) and MCZ gate 840(2), (4) pairs, with the SWAP gates acting on qubits qt and qt-i. In some cases, the particular quantum computer for which the MCSLI2 gate 712 is being compiled may be able to implement SWAP gates directly, in which case the final quantum circuit may include the SWAP gates. Alternatively, in cases where the particular quantum computer for which the MCSLI2 gate 712 is being compiled is not able to implement SWAP gates directly, the SWAP gates may be implemented as three CNOT gates of alternating orientations between qubits qt and qt-i, which may be included in the final quantum circuit.

[0126] Figure 17 illustrates the example where only one of the neighbouring qubits qt-i,qt+i of the target qubit qt of the MCSLI2 gate 712 are control qubits of the MCSLI2 gate 712. However, it should be appreciated that both neighbouring qubits qt-1 ,qt+i of the target qubit qt of the MCSLI2 gate 712 may be control qubits of the MCSLI2 gate 712. In such cases, the same techniques applied as discussed above in relation to Figure 17 may be used for both the A2, A2fgates (as shown in Figure 17) and the A1, Ai1gates. That is, the A1, Ai1gates 750(1) and adjacent MCZ gates 740(1), (3) may be replaced with MCZ, A and SWAP gates in the same way as the A2, A2fgates 850(2), (4), MCZ gates 840(2), (4), and SWAP gates 870 shown in Figure 17.

[0127] Therefore, in general compiling an MCR gate comprises identifying a first quantum circuit corresponding to the MCR gate, wherein the first quantum circuit includes: a one or more first rotation gates acting on the target qubit, a plurality of multi-qubit relative-phase gates (A) each acting on particular groups of the plurality of control qubits, and a plurality of multi-controlled-Z gates acting on respective groups of the plurality of control qubits, wherein the plurality of multi-controlled-Z gates span a respective range of qubits, and wherein each multi-controlled-Z gate additionally acts on a respective edge qubit defining an edge of the respective range of qubits. In examples, such as those described above, where the MCR gate is an MCSLI2 gate, the one or more first rotation gates acting on the target qubit may include the A1-A4 rotation gates discussed above. Furthermore, when the MCR gate is an MCSLI2 gate the A gates may act on particular groups of control qubits and at least a particular neighbouring qubit of the target qubit, however in some cases the A gates may act on the target qubit (based on whether the particular neighbouring qubit is a control qubit for the MCSLI2 gate). Furthermore, the multi-controlled Z gates may act on the particular groups of control qubits and in some cases may act on the target qubit, or a first neighbouring qubit of the target qubit, based on whether a second neighbouring qubit of the target qubit is a control qubit for the MCSLI2 gate. If a A gate does not act on the target qubit (and therefore the MCZ gate does act on the target qubit), the respective edge qubitmentioned above is the target qubit. However in cases where the A gate does act on the target qubit and a first neighbouring qubit qa+i (and therefore the MCZ gate does not act on the target qubit but does act on the first neighbouring qubit qa+i and a second neighbouring qubit qa-i) , the respective edge qubit is the second neighbouring qubit. In this example, the quantum circuit may include SWAP gates bounding the MCZ and A gate combinations, where the SWAP gates may be a set of CNOT gates.

[0128] The compiling of the MCSLI2 gate may further comprise identifying a plurality of quantum sub-circuits corresponding to a combination of the plurality of multi-qubit relative-phase gates (A) and the plurality of multi-controlled-Z gates of the first quantum circuit, wherein each quantum sub-circuit comprises: a symmetrical chain structure of controlled-NOT gates spanning the respective range of qubits on which the particular multi-controlled-Z gate acts, wherein consecutive controlled-NOT gates of the symmetrical chain structure act on consecutive focus qubits according to a first adjacent qubit of the respective focus qubit, wherein the first adjacent qubit of the respective focus qubit is located closer to the respective edge qubit of the range of qubits than a second adjacent qubit of the respective focus qubit, wherein the controlled-NOT gates of the symmetrical chain structure are either singly-controlled-CNOT gates or relativephase Toffoli gates, based on whether the second adjacent qubit of the focus qubit of the respective controlled-NOT gate is a control qubit of the MOR gate. The quantum sub-circuits further comprise: one or more additional rotation gates located at the centre of the symmetrical chain structure.

[0129] The compiling of the MCSLI2 gate further comprises identifying a final quantum circuit, wherein the final quantum circuit includes: a plurality of native gates corresponding to each of the quantum sub-circuits, and the one or more first rotation gates acting on the target qubit. The native gates being gates act on up to two adjacent qubits, and can include: singly-controlled-NOT gates, and one or more of: Hadamard gates, T gates, and S gates.

[0130] By using the symmetrical chain structure discussed above in relation to Figure 13 when compiling MCSLI2 gates, the target qubit can be located at any location within a set of qubits (which includes the target qubit, control qubits, and any ancilla qubits therebetween), without requiring rearrangement of the ordering (i.e. locations) of the qubits. Accordingly, the number of SWAP (and hence CNOT) gates can be reduced.Multi-Controlled X (MCX) Gates

[0131] While the symmetrical chain structure disclosed herein has been described primarily within the context of compiling MCSLI2 gates, it should be appreciated that the symmetrical chain structure may be used for compiling other types of MCR gates, such as multi-controlled X (MCX) gates.

[0132] Figure 18 illustrates the approach discussed in GB2400342.8 for compiling MCX gates, whereby the MCX gate is converted to two Hadamard gates acting on the target qubit of the MCX gate and bounding an MCR gate (which is an MCSLI2 gate). The MCR gate applies a rotation of 2TT about the y axis on an ancilla qubit located at the edge of the set of qubits, where the MCR gate has control qubits comprising the control qubits of the MCX gate and the target qubit of the MCX gate (in other words the target qubit of the MCX gate is changed to a control qubit for the MCR gate). The approach for compiling MCSLI2 gates discussed in GB2400342.8 may then be applied to compile the MCR gate, as shown in Figure 18.

[0133] According to the present disclosure, when compiling an MCX gate, the final circuit may include two Hadamard gates acting on the target qubit of the MCX gate which bound the quantum circuit corresponding to an MCZ gate acting on the target and control qubits of the MCX gate. The techniques discussed above in relation to the symmetrical chain structure may then be applied,but using any ancilla qubit of the set of qubits as the edge qubit qo shown in Figure 13. An example is shown in Figure 19 shows an MCX gate 900, applying an X gate to qubit q , based on the state of control qubits: {q0, q2, qs, q?, qs, qg, qi2, qis, qu, qie, qi ?}■ The MCX 900 gate therefore spans a set of 18 qubits qo-qi7. As shown in the middle section of Figure 19, this MCX gate 900 is equivalent to an MCZ gate 901 acting on the control qubits {qo, q2, qs, q?, qs, qg, qi2, qis, qi4, qie, qn} of the MCX gate 900 plus the target qubit q , where the MCZ gate 901 is bounded by two Hadamard gates acting on the target qubit q of the MCX gate 900. The right-hand section of Figure 19 shows a shorthand form of the middle section of Figure 19. Here, any ancilla qubit in the set of qubits qo-qi7 for the MCX gate 900 is chosen as an ancilla qubit qafor this representation. The MCZ gate 901 acts on a first group of control qubits including control qubits Ci of a first set of qubits Qi and qubit qa-i. In other words, the first group of control qubits includes Ci: {qo, q2} and qa-i: {qs}, where the first set of qubits Qi includes qubits qo-qs.The MCZ gate 901 also acts on a second group of control qubits including control qubits C2 of a second set of qubits Q2 and qubit qa+i. In other words, the second group of control qubits includes C2: {qs, qg, qw, qw, qw, qi4, q , qw} and qa+i: {q?}, where the second set of qubits Q2 includes qubits q7-qi7. In addition, a Hadamard gate 902 is located either side of the MCZ gate 901 only on qubit q , as denoted by the labelling of the H gates 902 with “qw”- In this manner, the middle and right-hand representations shown in Figure 19 are equivalent, however the right-hand representation will be primarily used for conciseness.

[0134] It should be appreciated that in the example of Figure 19 both the neighbouring qubits qa.1 , qa+i of the chosen ancilla qubit qaare control / target qubits of the MCZ gate 902, in some cases the MCX gate or chosen ancilla qubit qamay be such that none, either or both of the neighbouring qubits qa-i , qa+i may not be control / target qubits of the MCZ gate. The example where none of the neighbouring qubits qa-i , qa+i are control / target qubits of the MCZ gate is discussed first below. This example, where none of the neighbouring qubits qa.i , qa+iare control / target qubits of the MCZ gate, is illustrated in Figure 20. In Figure 20, the left-hand portion shows the original MCX gate 1000 to be compiled. The MCX gate 1000 acts on a target qubit qt, based on control qubits Ci , C2a, and C2b, where control qubits Ci are a group of control qubits in a set of qubits Qi, control qubits C2a are a group of control qubits in a set of qubits Cha, and control qubits C2b are a group of control qubits in a set of qubits Chb. It should be appreciated that the groups of control qubits C2a, C2b may each include one or more control qubits, or in some cases either (i.e. only one) of C2a, C2b may include no control qubits. Similarly, it should be appreciated that the set of qubits Q2a, Q2b may each include one or more qubits, or in some cases either (i.e. only one) of Q2a, Chb may include no qubits. The sets of qubits: {Cha, qt, Chb} may be collectively referred to as a set of qubits Q2, and the set of qubits: {C2a, qt, C2b} may be collectively referred to a second group of control qubits C2 within the context of the MCZ gate 1010 shown in the middle section of Figure 20.

[0135] In compiling the MCX gate 1000, an ancilla qubit qaof the MCX gate 1000 is chosen. The MCX gate 1000 is then replaced with (i.e. converted to) the MCZ gate 1010 shown in the middle section of Figure 20. The MCZ gate 1010 in the middle section of Figure 20 acts on the first group of qubits Ci , and the second group of control qubits C2, but does not act on neighbouring qubits qa-i , qa+i of a chosen ancilla qubit qaof the MCX gate 1000. The MCZ gate 1010 is bounded by Hadamard gates 1015 acting on the target qubit qtof the MCX gate 1000. A quantum circuit 2020 is then identified which is equivalent to the middle section of Figure 20. The quantum circuit includes the Hadamard gates 1015(1), (6) acting on the target qubit qt as shown in the middle section of Figure 20. In addition, the quantum circuit 1020 includes further Hadamard gates 1015(2), (3) acting on qubit qawhich bound an MCZ gate 1040(1) adjacent (i.e. followed immediately by) a multi-qubit relative phase A1 gate 1050(1). The MCZ gate 1040(1) acts on the control qubits Ci and qubit qa. The A1 gate 1050(1) acts on qubits Qi (including qubits Ci) and qa.1. In addition, the quantum circuit includes MCZ gate 1040(2) and multi-qubit relative phase A2gate 1050(2). The MCZ gate 1040(2) acts on the control qubits C2 and qubit qa. The A2 gate 1050(2) acts on qubits Q2(including qubits C2) and qa+i. In addition, the quantum circuit 1020 includes further Hadamard gates 1015(4), (5) acting on qubit qawhich bound MCZ gate 1040(3) adjacent (i.e. followed immediately by) a multi-qubit relative phase A^ gate 1050(3). The MCZ gate 1040(3) acts on the control qubits Ci and qubit qa. The Ai+ gate 1050(3) acts on qubits Qi (including qubits Ci) and qa.i. In addition, the quantum circuit includes MCZ gate 1040(4) and multi-qubit relative phase A2fgate 1050(4). The MCZ gate 1040(4) acts on the control qubits C2 and qubit qa. The A2fgate 1050(4) acts on qubits Q2 (including qubits C2) and qa+i.

[0136] The combination of the MCZ gates 1040 and their adjacent A gates 1050 may be decomposed into a symmetrical chain structure, as discussed above in relation to Figure 13 and 14A / 14B, and in the same manner as discussed above in relation to MCSLI2 gates. In particular, the MCX gate 1000 may be compiled into a final quantum circuit comprising: the H gates 1015 shown in the right-hand side of Figure 20, any CNOT and H gates included in the symmetrical chain structures corresponding to the MCZ gate 1040 and A gate 1050 combinations in the quantum circuit 1020, and native gates corresponding to the relative-phase Toffoli gates included in the symmetrical chain structures. Accordingly, the MCX gate 1000 may be compiled into native gates for a quantum computer.

[0137] While in the example of Figure 20 the neighbouring qubits qa-i , qa+i of the ancilla qubit qaare not control / target qubits of the MCZ gate 1010, as discussed above one or both of neighbouring qubits qa-i, qa+i may be control / target qubits of the MCZ gate 1010. Figure 21 illustrates an example similar to that of Figure 20, except that where qubit qa+i of the MCZ gate 1011 is a control / target qubit of the MCZ gate 1011 (and therefore a control qubit or target qubit of the MCX gate 1001). The right-hand side of Figure 21 illustrates a quantum circuit 1021 corresponding to the MCX gate 1001 in this example. The quantum circuit 1021 is the same as the quantum circuit 1020 shown in Figure 20, except that the Hadamard gates 1015(2)-(5) are replaced by singly-controlled flvgates 1060(1 )-(4) (i.e. rotation gates) acting on qubit qabased on qubit qa.i. The singly-controlled flvgates 1060 (which are all identical) are a shorthand used to represent the series of gates shown in Figure 22A. As shown in Figure 22A, the singly-controlled nvgates 1060 are: an H gate acting on qubit qa, followed by a gate acting on qubit qa, followed by a CNOT gate acting on qubit qabased on qubit qa-i , followed by a T gate acting on qubit qa, followed by an H gate acting on qubit qa. Returning to Figure 21, the combination of the MCZ gates 1040 and the A gates 1050 may be decomposed into a symmetrical chain structure as discussed above in relation to Figure 21.

[0138] As such, the MCX gate 1001 may be compiled into a final quantum circuit comprising: the H gates 1015 shown in the right-hand side of Figure 21, any CNOT and H gates included in the symmetrical chain structures corresponding to the MCZ gate 1040 and A gate 1050 combinations in the quantum circuit 1021, native gates corresponding to the singly-controlled flvgates 1060 in quantum circuit 1021, and native gates corresponding to the relative-phase Toffoli gates included in the symmetrical chain structures. Accordingly, the MCX gate 1001 may be compiled into native gates for a quantum computer.

[0139] It should be appreciated that the approach discussed in relation to Figure 21 for compiling the MCX gate 1001 may also be used for MCX gates where qubit qa+i is a control qubit of the corresponding MCZ gate, instead of qubit qa.i. However, the approach discussed in Figure 21 is just one of multiple approaches for compiling MCX gates where only one of qubits qa.i and qa+i is a control qubit or target qubit for the MCX gate. Figure 23 shows another such approach, this time illustrated with qubit qa+ias a control qubit of MCX gate 1002 instead of qubit qa.i. Here, MCZ gate 1012 is therefore the same as MCZ gate 1011, except that qubit qa+i is a control / target qubit of MCZ gate 1012 instead of qubit qa.i. The quantum circuit 1022 corresponding to the MCX gate1002 is then identical to the quantum circuit 1021, except that the singly-controlled flvgates 1060 have qubit qa+i as a control qubit instead of qubit qa-i.

[0140] As mentioned above, in some cases both neighbouring qubits qa-i, qa+i of the chosen ancilla qubit qamay be control / target qubits of the MCZ gate (i.e. both qubits qa-i , qa+i may be either a control qubit or the target qubit of the MCX gate to be compiled). This example is illustrated in Figure 24, where both qubits qa.i and qa+iare control qubits of MCX gate 1003. The MCZ gate 1013 therefore includes qubits qa.i and qa+i as control / target qubits. The final quantum circuit 1023 is then identical to quantum circuits 1021 and 1022, except that the singly-controlled flv gates 1060(1)-(4) are replaced by doubly-controlled flvgates 1070(1)-(4) (i.e. rotation gates). The doubly-controlled flvgates 1070 act on focus qubit qa, based on a first influencing qubit qa.i and a second influencing qubit qa+i , where both influencing qubits neighbour the focus qubit. The first control qubit of a doubly-controlled flvgate 1070 is shown by a circled dot, while the second control qubit of a doubly-controlled flvgate 1070 is shown by a dot. The doubly-controlled flvgates 1070 may be in any orientation (of the two possible orientations), provided all doubly-controlled flv gates 1070 have the same orientation. The doubly-controlled flvgates 1070 (which are all identical) are a shorthand used to represent the series of gates shown in Figure 22B. As shown in Figure 22B, the doubly-controlled flvgates 1070 are: an H gate acting on qubit qa, followed by a gate acting on qubit qa, followed by a relative-phase Toffoli gate having qubit qaas the focus qubit and first and second influencing qubits corresponding to the first and second influencing qubits of the doubly-controlled flvgates 1070 (i.e. qubits qa.i and qa+irespectively, followed by a T gate acting on qubit qa, followed by an H gate acting on qubit qa. The relativephase Toffoli gate is equivalent to various quantum sub-circuits of native gates (see e.g. Figures 8, 9 and 10), and as such the quantum sub-circuits of native gates corresponding to the relativephase Toffoli gate included in the doubly-controlled flvgates 1070 are included in the final quantum circuit corresponding to the MCX gate 1003. Returning to Figure 24, the combination of the MCZ gates 1040 and the A gates 1050 may be decomposed into a symmetrical chain structure as discussed above in relation to Figures 21 and 23.

[0141] As such, the MCX gate 1004 may be compiled into a final quantum circuit comprising: the H gates 1015 shown in the right-hand side of Figure 24, any CNOT and H gates included in the symmetrical chain structures corresponding to the MCZ gate 1040 and A gate 1050 combinations in the quantum circuit 1023, native gates corresponding to the doubly-controlled flvgates 1060 in quantum circuit 1023, and native gates corresponding to the relative-phase Toffoli gates included in the symmetrical chain structures. Accordingly, the MCX gate 1003 may be compiled into native gates for a quantum computer.

[0142] Therefore, as discussed above, in general compiling an MCR gate comprises identifying a first quantum circuit corresponding to the MCR gate, wherein the first quantum circuit includes: a one or more first rotation gates acting on the target qubit, a plurality of multi-qubit relative-phase gates (A) each acting on particular groups of the plurality of control qubits, and a plurality of multi-controlled-Z gates acting on respective groups of the plurality of control qubits, wherein the plurality of multi-controlled-Z gates span a respective range of qubits, and wherein each multi-controlled-Z gate additionally acts on a respective edge qubit defining an edge of the respective range of qubits. In examples, such as those described above, where the MCR gate is an MCSLI2 gate, the one or more first rotation gates acting on the target qubit may include the A1-A4 rotation gates discussed above. Furthermore, when the MCR gate is an MCX gate the A gates may act on particular groups of control qubits and at least a particular neighbouring qubit of an ancilla qubit of the MCX gate, and may act on the target qubit of the MCX gate. Furthermore, the multicontrolled Z gates act the ancilla qubit and on the particular groups of control qubits, and in some cases the target qubit. For MCX gates, the respective edge qubit mentioned above is a particular ancilla qubit of the MCX gate, which may be chosen as any ancilla qubit in the set of qubits. Furthermore, the respective edge qubit mentioned above is the chosen ancilla qubit. The one ormore first rotation gates of the first quantum circuit acting on the target qubit include Hadamard gates. The first quantum circuit additionally includes a plurality of second rotation gates acting on the ancilla qubit. Based on whether neither, one, or both of the two neighbouring qubits of the ancilla qubit are a control qubit or target qubit of the MCX gate, the plurality of second rotation gates each comprise a Hadamard gate, a first set of rotation gates including a singly-controlled CNOT gate, or a second set of rotation gates including a relative phase Toffoli gate.

[0143] The compiling of the MCX gate may further comprise identifying a plurality of quantum sub-circuits corresponding to a combination of the plurality of multi-qubit relative-phase gates (A) and the plurality of multi-controlled-Z gates of the first quantum circuit, wherein each quantum sub-circuit comprises: a symmetrical chain structure of controlled-NOT gates spanning the respective range of qubits on which the particular multi-controlled-Z gate acts, wherein consecutive controlled-NOT gates of the symmetrical chain structure act on consecutive focus qubits according to a first adjacent qubit of the respective focus qubit, wherein the first adjacent qubit of the respective focus qubit is located closer to the respective edge qubit of the range of qubits than a second adjacent qubit of the respective focus qubit, wherein the controlled-NOT gates of the symmetrical chain structure are either singly-controlled-CNOT gates or relativephase Toffoli gates, based on whether the second adjacent qubit of the focus qubit of the respective controlled-NOT gate is a control qubit of the MOR gate. The quantum sub-circuits further comprise: one or more additional rotation gates located at the centre of the symmetrical chain structure.

[0144] The compiling of the MCX gate further comprises identifying a final quantum circuit, wherein the final quantum circuit includes: a plurality of native gates corresponding to each of the quantum sub-circuits, the one or more first rotation gates acting on the target qubit, and native gates corresponding to the second rotation gates. The native gates being gates act on up to two adjacent qubits, and can include: singly-controlled-NOT gates, and one or more of: Hadamard gates, T gates, and S gates.

[0145] By using the symmetrical chain structure discussed above in relation to Figure 13 when compiling MCX gates, the target qubit and ancilla qubit can be located at any location within a set of qubits (which includes the target qubit, control qubits, and any ancilla qubits therebetween), without requiring rearrangement of the ordering (i.e. locations) of the qubits. Accordingly, the number of SWAP (and hence CNOT) gates can be reduced.Multi-Controlled U(2) MCLI2 Gates

[0146] While the symmetrical chain structure disclosed herein has been described above primarily within the context of compiling MCSLI2 and MCX gates, it should be appreciated that the symmetrical chain structure may be used for compiling multi-controlled U(2) (MCLI2) gates.

[0147] Figure 25 illustrates the approach discussed in GB2400342.8 for compiling MCLI2 gates, whereby the MCLI2 gate (applying a rotation II to a target qubit based on the state of a set of control qubits) is converted to an MCSLI2 gate acting on the target qubit with a rotation of -2qj about the z axis acting on an ancilla qubit located at the edge of the set of qubits. The resulting quantum circuit is then similar to those discussed in GB2400342.8 for MCSLI2 gates, with the addition of a plurality of rotation gates acting on the ancilla qubit, and a plurality of CNOTs acting on the target qubits according to the state of the ancilla qubit. The approach for compiling MCSLI2 gates discussed in GB2400342.8 may then be applied to compile the multi-qubit relative phase gates.

[0148] According to the present disclosure, an MCLI2 gate 1100 applying a rotation II to a target qubit qtbased on the state of a set of control qubits C, may be compiled. When compiling the MCLI2 gate 1100, the target qubit qt is located at an edge of a set of qubits: {Q, qa-i , qa, qt}, suchthat the target qubit qt has only one neighbour in the set of qubits, where the neighbour is an ancilla qubit qa. The qubits may be re-arranged in this order, if necessary, for example using a series of SWAP gates which may be implemented using CNOT gates. In addition, the MCLI2 gate 1100 has a group of control qubits C in a set of qubits Q. The qubit qa-i neighbouring the ancilla qubit qa(other than the target qubit qt) may be an ancilla qubit, as in this example, or may be a control qubit, as discussed below in relation to Figure 27. Furthermore, in order to compile the MCLI2 gate 1100, the ancilla qubit qa, should have a predetermined state, such as |0) or |1).

[0149] As shown in Figure 26, when qubit qa.i is an ancilla qubit, a first quantum circuit 1010 corresponding to the MCLI2 gate 1100 may be identified including two multi-qubit relative phase A gates 1150(1), (2) acting on the set of qubits Q and qubit qa-i, two MCZ gates 1140(1), (2) adjacent the A gates 1150(1), (2) and acting on the control qubits C and ancilla qubit qa, four Hadamard gates 1130(1 )-(4) acting on the ancilla qubit qa, and a singly-controlled rotation gate 1120 acting on the target qubit qt, based on the state of the ancilla qubit qa, where the singly-controlled rotation gate 1120 applies the same rotation II as the MCLI2 gate 1100.

[0150] As such, in the present example, the quantum circuit 1010 comprises a first rotation gate acting on the target qubit qt„ where the first rotation gate is the singly-controlled rotation gate 1120, as well as a plurality of multi-qubit relative-phase gates (A) each acting on the control qubits and a plurality of multi-controlled-Z gates acting on the control qubits and a respective edge qubit, where the respective edge qubit is the ancilla qubit qa.

[0151] Quantum sub-circuits may then be identified, as described above in relation to MCSLI2 and MCX gates, corresponding to the combination of the MCZ gates 1140 and the A gates 1150. Native gates corresponding to those quantum sub-circuits and hence a final quantum circuit may be identified. The final compiled quantum circuit corresponding to the MCLI2 gate 1100 may therefore include native (e.g. Clifford+T) gates and the singly-controlled rotation gate 1120. Alternatively, the final quantum circuit may include a set of native gates corresponding to the singly-controlled rotation gate 1120, which may be determined using known techniques.

[0152] Figure 27 illustrates an example similar to that of Figure 26, but where the qubit qa.i is a control qubit of the MCLI2 1101 gate. In this example, a quantum circuit 1111 is identified corresponding to the MCLI2 gate, where quantum circuit 1111 is identical to quantum circuit 1110, except that the Hadamard gates 1130(1)-(4) are replaced with singly-controlled rotation gates 1160(1 )-(4), corresponding to the singly-controlled rotation gates shown in Figure 22A. Therefore, it should be understood that the identified quantum circuit corresponding to an MCLI2 gate comprises a plurality of second rotation gates acting on the ancilla qubit qa, where the second rotation gates are either Hadamard gates or singly-controlled rotation gates (with qubit qa.i as the influencing qubit) based on whether qubit qa.i is a control qubit of the MCLI2 gate.

[0153] In the examples discussed above in Figures 26 and 27, the target qubit qtis located at the edge of the set of qubits, with the ancilla qubit qaneighbouring the target qubit qt. The qubits can be reordered using known techniques to ensure this order. It should, however, be appreciated that the MCLI2 gates may be compiled even when the qubits are not in this specific order. Figure 28 shows an example of this scenario, where for an MCLI2 gate 1200. The MCLI2 1200 acts on a target qubit qt having more than one neighbour. The MCLI2 gate has control qubits C = Ci + C2, where Ci and C2 are located either side of the target qubit qt, and where Ci are a first group of control qubits out of a set of qubits Qi, and C2 are a second group of control qubits out of a set of qubits Q2.

[0154] In this example, the target qubit qt of the MCLI2 gate neighbours an ancilla qubit qa, having a predefined state (e.g. |0) or |1)). The other neighbour qubit qt-i (which could also be referred to as qa.2) of the target qubit qt may be a control qubit or an ancilla qubit. Similarly, the otherneighbour qubit qa+i (which could also be referred to as qt+2) of the ancilla qubit qamay be a control qubit or an ancilla qubit. In the example of Figure 28, qubits qt.i and qa+iare both ancilla qubits.

[0155] As shown in the middle section of Figure 28, the MCLI2 gate 1200 is equivalent (i.e. corresponds to) an MCSLI2 + phase gate 1210 having the same control qubits as the MCU gate 1200, and which applies a rotation W = Rr(A) to the target qubit qt and a rotation Rz(-2^) to the ancilla qubit qa. The angle xp represents the phase of the MCLI2 gate 1200, where the MCLI2 gate 1200can be expressed as £7(2) = el^Rv). The angle i may therefore be provided as an input parameter when compiling the MCLI2 gate 1200.

[0156] As shown in the right-hand side of Figure 28, a quantum circuit 1220 can be identified corresponding to the MCLI2 gate 1200 and the MCSLI2 + phase gate 1210. The quantum circuit 1220 includes two MCZ gates 1240(1), (3) acting on the first group of control qubits Ci and the target qubit qt, two A1, A^ gates 1250(1), (3) acting on the first set of qubits Qi (including the first group of control qubits Ci) and qubit qt-i , two MCZ gates 1240(2), (4) acting on the second group of control qubits C2 and the ancilla qubit qa, two A2, A2fgates 1250(2), (4) acting on the second set of qubits Q2 (including the second group of control qubits C2) and qubit qa.i. In addition, each of the MCZ gate 1240 and A gate 1250 combinations (which are adjacent one another) are bounded by CNOT gates 1270. The CNOT gates 1270 act on the target qubit qt based on the state of the ancilla qubit qaor vice versa, bases on whether the particular the MCZ gate 1240 and A gate 1250 combination acts on the first set of control qubits Ci or the second set of control qubits C2.

[0157] The quantum circuit 1220 additionally includes single-qubit rotation gates A1-A4 1260 arranged between the MCZ gate 1240 and A gate 1250 combinations, as shown in Figure 28. These single-qubit rotation gates A1-A4 1260 act on the target qubit qt and are the same as described above in relation to Figure 15 and elsewhere. For example in some cases, A4 1260(1) = RX(01)RZ(02) where the angles e and 02depend on the axis v, and may be determined based on decomposing the |“| gates 402 into single-qubit Rx(rotation about the x axis) gates and singlequbit Rz(rotation about the z axis) gates, for example using Euler decompositions, as described in relation to Figure 5. Furthermore, in such examples, A21260(2) = V4), A3 =anc*A1 = RX(A / 4)«Z(-02).

[0158] Furthermore, the quantum circuit 1220 includes additional single-qubit rotation gates B1-B21280 acting on the ancilla qubit qa, arranged between the MCZ gate 1240 and A gate 1250 combinations. The Bi gates 1280(1), (3) are Rxgates, which is a rotation about the x axis by the angle ^ / 2. The B2 gate 1280(2) is a Rx- ^ / 2), which is a rotation about the x axis by the angle - ^ / 2. The quantum circuit 1220 additionally included Hadamard gates acting on the ancilla qubit qaarranged at the start and end of the quantum circuit 1220.

[0159] Quantum sub-circuits corresponding to the MCZ gate 1240 and A gate 1250 combinations may then be identified as described herein. In this manner, a final quantum circuit comprising native gates corresponding to the MCLI2 gate 1200 may be identified. The final quantum circuit may additionally include the single-qubit rotation gates A1-A4 1260 as well as the single-qubit rotation gates BI-B21280. Alternatively, the final quantum circuit may instead include one or more native gates corresponding to the A1-A4 gates 1260 and / or BI-B2gates 1280, using known techniques.

[0160] Therefore, as can be seen by the example illustrated in Figure 28, an MCLI2 gate may be compiled into native gates in a manner which permits the target and clean ancilla qubits of theMCLI2 gate to be located at any location in the set of qubits, provided the target qubit and clean ancilla qubit are adjacent one another.

[0161] As illustrated in Figure 28, the other neighbouring qubits of the target and ancilla qubits may be ancilla qubits. Figure 29 illustrates an example where by one of these other neighbouring qubits is a control qubit. In particular, in the example of Figure 29, an MCLI2 gate 1201 is shown which is identical to MCLI2 gate 1200, except that qubit qa+i is a control qubit. As such, qubit qa+i is also a control qubit of the corresponding MCSLI2 + phase gate 1211. The right-hand portion of Figure 29 illustrates a quantum circuit 1221 corresponding to the MCLI2 gate 1201. The quantum circuit 1221 is similar to the quantum circuit 1220 in many respects. In particular, the Ai, A^ gates 1250(1), (3), MCZ gates 1240(1), (3), A1-A4 gate 1260, B1-B2 gates 1280, and H gates 1230(1), (2) are identical to those discussed above in relation to Figure 28.

[0162] In the example of Figure 29, the quantum circuit 1221 includes A2, A2fgates 1350(2), (4) which act on qubits Q2and qa+i(as with A2, A2+ gates 1250(2), (4) in Figure 28), as well as ancilla qubit qa. Furthermore, the quantum circuit 1221 includes MCZ gates 1340(2), (4) which act on control qubits C2and the target qubit qt, and do not act on the ancilla qubit qa(unlike MCZ gates 1240(2), (4)). In addition, the A2, A2+ gate 1350(2), (4) and MCZ gate 1340(2), (4) combinations are bounded by CNOT gates 1370 acting on the target qubit qt based on the state of qubit qt-i. Furthermore, the CNOT gates 1370 bounding the A2, A2fgate 1350(2), (4) and MCZ gate 1340(2), (4) combinations are themselves bounded by first SWAP gates 1395 between the target qubit qt and ancilla qubit qa, and then by second SWAP gates 1390 between the target qubit qt and qubit qt-i. The SWAP gates may be included in the final quantum circuit, or may be represented by a plurality of CNOT gates in the final quantum circuit. Quantum sub-circuits including symmetrical chain structures may then be identified corresponding to the Ai, A^ gate 1250(1), (3) and MCZ gate 1240(1), (3) combinations, as well as the A2, A2fgate 1350(2), (4) and MCZ gate 1340(2), (4) combinations. Accordingly, the quantum circuit 1221 may be converted to a final quantum circuit comprising native gates, as discussed above.

[0163] Furthermore, while Figure 29 illustrates an example where qubit qa+i is a control qubit and qubit qt-i is not, it should be appreciated that if instead qt-i was a control qubit and qubit qa+i was not, corresponding changes to the Ai, A^ gates 1250(1), (3) and MCZ gates 1240(1), (3) and bounding CNOT gates would be made, and SWAP gates added would be added in a corresponding manner as described in relation to Figure 29 (as compared to Figure 28). That is, Ai, Ai+ gates 1250(1), (3) would be modified to additionally act on the target qubit qt, and MCZ gates 1240(1), (3) would be modified to act on ancilla qubit qainstead of the target qubit qt. Furthermore, the CNOT gates bounding the Ai, A^ gate 1250(1), (3) and MCZ gate 1240(1), (3) combinations would act on the ancilla qubit qabased on the state of qubit qa+i. In addition, the Ai, Ai+ gate 1250(1), (3) and MCZ gate 1240(1), (3) combinations and bounding CNOTs would be bounded by SWAP gates between the target qubit qtand ancilla qubit qa, as well as by SWAP gates between the ancilla qubit qaand qubit qa+i.

[0164] Similarly, if both qubits qt.i and qa+iare control qubits, then the corresponding quantum circuit would include the above-discussed changes to the Ai, A^, A2, A2+ gates 1250, MCZ gates 1240 and bounding CNOT gates, as well as the addition of SWAP gates bounding the various Ai, A^, A2, A2t gate and MCZ gate combinations. Therefore, it can be seen that substantially any MCLI2 gate can be compiled into basis gates in an efficient manner when the target qubit is adjacent a clean ancilla qubit. A clean ancilla qubit may be prepared using known techniques, and qubits may be rearranged to cause the target qubit to be adjacent a (clean) ancilla qubit, as discussed for example in GB2400342.8.Additional Techniques

[0165] It should be appreciated that the techniques discussed herein, while discussed primarily in relation to gates having a single target qubit, may also be applied to multi-controlled multi-target gates. This may be done, for example using the techniques discussed for multi-controlled multitarget gates in in GB2400342.8.

[0166] In addition, it should be appreciated that while the techniques disclosed herein are discussed primarily in relation to compiling gates for execution LNN quantum computers, the techniques may be used for compiling gates for other quantum computer having substantially any connectivity capabilities.

[0167] In addition, while decompositions of multi-controlled iZ gates are shown in Figures 8, 9, 11, and 12, multi-controlled iZ gates may alternatively be decomposed using either of the circuits shown in Figures 30A and 30B. It should be appreciated that the final quantum circuits may include combinations of these decompositions, or only a single decomposition.Depth and Cost reductions

[0168] In addition to the techniques set out above, the compilation process may in some cases be modified to reduce the overall depth of the final quantum circuit.

[0169] As one example, a pair of CNOT gates in a symmetrical chain structure as discussed herein can be replaced by a pair of SWAP gates, only changing the respective A gate. The same holds true for the pair of CNOT gates used for the central CCZ / CCiZ gates. Moreover, each pair of relative phase Toffoli gates in the symmetrical chain structures may be oriented in one of two ways, with each pair of relative-phase Toffoli gates having the same orientation. Accordingly, the orientations of pairs of relative-phase Toffoli gates in the symmetrical chain structure(s) may be set in order to reduce the overall depth of the final quantum circuit.

[0170] Figure 31 A shows a decomposition of a relative-phase Toffoli gates (i.e. a set of native gates equivalent to a relative-phase Toffoli gate) in a particular orientation. The right-hand side of Figure 31A shows a short-hand notation used in the left-hand side of Figure 31A, where a singly-controlled FIs gate is used to represent a sequence of a Ttgate, CNOT gate, and T gate all acting on the focus qubit, with the CNOT gate having an influencing qubit corresponding to the influencing qubit of the singly-controlled FIs gate. The decomposition of the relative-phase Toffoli gate shown in the left-hand side of Figure 31A is the same as the decomposition shown in the top circuit of Figure 8. This decomposition is used in the below examples depth reductions, however it should be appreciated that other relative-phase Toffoli gate decompositions could be used and the depth reduction techniques described herein applied in an analogous manner.

[0171] Figure 31B shows a set of relative-phase Toffoli gates and a SWAP gate included in one half of a symmetrical chain structure, as discussed herein (for example in relation to Figure 13). As discussed in relation to Figure 13, the symmetrical chain structure may include CNOT gates as well as relative-phase Toffoli gates. According to the present disclosure, a pair of CNOT gates (having the same focus and influencing qubits, located on opposite sides of the same symmetrical chain structure) may be replaced by a pair of SWAP gates. In other words, within a symmetrical chain structure, pairs of CNOT gates are considered equivalent to pairs of SWAP gates. This is generally true for all quantum circuits corresponding to MCZ and A combinations.

[0172] The right-hand side of Figure 31 B presents native quantum gates corresponding to the relative-phase Toffoli gates and SWAP gate shown on the left-hand side of Figure 31 B, using the short-hand notation illustrated in the right-hand side of Figure 31A. The right-hand side of Figure 31 B includes he sub-circuits M1-M4 which are achieved between sequential relative-phase Toffoli gates with opposite orientation, or between a relative-phase Toffoli and a swap. These allow for depth reductions, and the orientation of each relative-phase Toffoli can be chosen in order to maximize these reductions.

[0173] In particular, for sub-circuit M1, gates are commuted from a relative-phase Toffoli gate, and can be applied in parallel with gates of the same type which are executed before, this is achieved if the relative-phase Toffoli is not the leftmost one. In case it is the leftmost relativephase Toffoli, this case could be referred to as M5, in which only a CNOT gate can be applied in parallel. The left-hand side of Figure 31 C illustrates a set of native gates equivalent to sub-circuit M4 which reduces the overall depth of this sub-circuit. The right-hand side of Figure 31 C illustrates a set of native gates equivalent to sub-circuit M3 which reduces the overall depth of this subcircuit. These are just two examples of depth reductions that can be made and it should be appreciated that other depth reductions could be made as part of the compiling process. These depth reduction techniques may be applied as part of the compilation process. In particular, the orientations of the relative-phase Toffoli gates may be set to alternate so as to allow for these depth reductions. Similarly, when determining native gates corresponding to the symmetrical chain structure, predefined sub-circuits may be identified for which reduced-depth native gate sets (such as those shown in Figure 31 C) may be identified

[0174] While unused qubits increase the cost of multi-controlled gates in general, they can be used to reduce the cost if placed properly. A useful ancilla in our case is any unused qubit which is nearest-neighboring a control qubit “towards the target” (from below, if the control is above the target, and above if the control is below the target). It is clear that the M1 and M5 subcircuits defined in the previous section can commute freely to the left, if they occur on the left part of the symmetrical chain structure, and to the right if they occur on the right part of the symmetrical chain structure. In the multi-controlled gate decompositions disclosed herein, each symmetrical chain structure has an inverted counterpart which is applied on the same qubits. Therefore, the commuted M1 / M5 gates simply cancel out, if there is no gate which prevents a commutation of these from one symmetrical chain structure to the next. The M4 / M5 gates can be cancelled out if commuted to the left-hand and right-hand sides of the full multi-controlled gate structure, noting that these always occur when an ancilla is present, and due to their shape, these commute with the entire multi-controlled rotation gate.

[0175] Furthermore, pre-processing techniques may be used to provide depth reductions. In preprocessing SWAP gates are applied before and after the MCR gate in order to adjust the location of the controls or target. Such reordering is only applied if it allows for gate cancellation which is equal to or larger than the added cost of the SWAP gates themselves. In other words, this process does not increase cost or depth, and can only reduce one or both. This can be used, for example for unused qubits which neighbour a control qubit, where the neighbour is further away from the target qubit than said control qubit. A pair of swap gates allows to turn those to useful ancilla gates, thus reducing CNOT and T cost further. This is since while the SWAP pair increases the cost of CNOT gates by 6, applying cancellations allows to reduce the cost by 8, and thus CNOT cost is reduced by 2 for each of these SWAPS. In addition, SWAP chains can be used to bring the bottom control / target upwards, or the top one downwards. This does not increase the cost, and reduces depth.Example Implementations

[0176] Figure 32 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 MCLI2 gates, a phase). The parameters 2760 may also or alternatively include a type of 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) suchthat an explicit indication of the axis and angle is not required, and vice versa. In some cases, the parameters may also include an indication of the set of native gates for the quantum computer. In other cases, the set of native gates may be received in a separate indication. In other cases, the set of native gates may be predefined.

[0177] 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.

[0178] 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.

[0179] 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 identifies a first quantum circuit corresponding to the multi-controlled rotation gate, the first quantum circuit comprising: a one or more first rotation gates acting on the target qubit (qt) , a plurality of multi-qubit relative-phase gates (A) each acting on particular groups of the plurality of control qubits, and a plurality of multi-controlled-Z gates acting on respective groups of the plurality of control qubits, wherein the plurality of multi-controlled-Z gates span a respective range of qubits, and wherein each multi-controlled-Z gate additionally acts on a respective edge qubit defining an edge of the respective range of qubits. Examples of this decomposition of the multi-controlled rotation gate are discussed in relation to Figures 15, 16, 17, 20, 21, 23, 24, 26, 27, 28, and 29. 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. MCSLI2, MCX, or MCLI2). The plurality of first rotation gates may, for example, include rotations about the x or z axes, or H gates, or a rotation gate corresponding to a rotation of an MCLI2 gate. 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.

[0180] The plurality of multi-qubit relative-phase gates may comprise a first multi-qubit relativephase 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 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.

[0181] 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 particular qubits and / or SWAP gates.

[0182] A combination decomposer 2732 of the compiler 2730 identifies a plurality of quantum sub-circuits corresponding to the combinations of the plurality of multi-qubit relative-phase gates (A) and the plurality of multi-controlled-Z gates of the first quantum circuit. Each quantum subcircuit comprises a symmetrical chain structure of controlled-NOT gates spanning the respective range of qubits on which the particular multi-controlled-Z gate acts, wherein consecutive controlled-NOT gates of the symmetrical chain structure act on consecutive focus qubits according to a first adjacent qubit of the respective focus qubit, wherein the first adjacent qubit of the respective focus qubit is located closer to the respective edge qubit of the range of qubits than a second adjacent qubit of the respective focus qubit, wherein the controlled-NOT gates of the symmetrical chain structure are either singly-controlled-CNOT gates or relative-phase Toffoli gates, based on whether the second adjacent qubit of the focus qubit of the respective controlled-NOT gate is a control qubit of the MOR gate. Each quantum sub-circuit additionally comprises one or more additional rotation gates located at the centre of the symmetrical chain structure. The one or more additional rotation gates may include, e.g. a plurality of CNOT and Hadamard gates, or a controlled-Z gate, such as a doubly-controlled iZ gate (or its Hermitian conjugate), and CNOT or SWAP gates.

[0183] A universal gate converter 2733 then identifies a plurality of native gates corresponding to each of the quantum sub-circuits. For example, the universal gate converter 2733 may identify a circuit of native gates, such as Clifford+T gates, corresponding to each of the quantum subcircuits. In some cases, the native gates are gates acting on up to two qubits. In certain examples, the plurality of native gates comprises: a plurality of singly-controlled-NOT gates, and one or more of: Hadamard gates, T gates, and S gates. The universal gate converter 2733 may use any suitable conversion when identifying native gates corresponding to the relative-phase Toffoli gates. For example, the universal gate converter 2733 may use the same conversion for each relative-phase Toffoli gates, however in other examples a different conversion may be used for different relative-phase Toffoli gates. Furthermore, in some cases a particular conversion (or conversion scheme) for the relative-phase Toffoli gates may be used according to a desired 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.

[0184] 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 native 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.

[0185] 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 identifies the first quantum circuit corresponding to the MCR, 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.

[0186] 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 native gate or a depth for a particular native gate in the final quantum circuit; and applying the identified one or more reorderings 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.

[0187] The compiler 2730 may identify a final quantum circuit corresponding to the multicontrolled rotation gate, the final quantum circuit comprising the plurality of base gates and the one or more first rotation gates acting on the target qubit. In some cases, the one or more 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 native 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 2780. 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 computing device 2710 may convert the final quantum circuit into hardware instructions for the quantum computer 2790.

[0188] 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 2790to execute the multi-controlled rotation gate. Furthermore, while Figure 32 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.

[0189] 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.

[0190] Figure 33 illustrates an example computer-implemented method for compiling a multicontrolled rotation gate for a quantum circuit. The method according to Figure 33 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 MCR gate, and a set of qubits, the set of qubits comprising: a target qubit (qt) , and a plurality of control qubits. Step S2820 comprises identifying a first quantum circuit corresponding to the MCR gate, the first quantum circuit comprising: one or more first rotation gates acting on the target qubit (qt), a plurality of multi-qubit relative-phase gates (A) each acting on particular groups of the plurality of control qubits, and a plurality of multi-controlled-Z gates acting on respective groups of the plurality of control qubits, wherein the plurality of multi-controlled-Z gates span a respective range of qubits, and wherein each multi-controlled-Z gate additionally acts on a respective edge qubit defining an edge of the respective range of qubits.

[0191] Step S2830 comprises identifying a plurality of quantum sub-circuits corresponding to a combination of the plurality of multi-qubit relative-phase gates (A) and the plurality of multi-controlled-Z gates of the first quantum circuit, wherein each quantum sub-circuit comprises: a symmetrical chain structure of controlled-NOT gates spanning the respective range of qubits on which the particular multi-controlled-Z gate acts, wherein consecutive controlled-NOT gates of the symmetrical chain structure act on consecutive focus qubits according to a first adjacent qubit of the respective focus qubit, wherein the first adjacent qubit of the respective focus qubit is located closer to the respective edge qubit of the range of qubits than a second adjacent qubit of the respective focus qubit, wherein the controlled-NOT gates of the symmetrical chain structure are either singly-controlled-CNOT gates or relative-phase Toffoli gates, based on whether the second adjacent qubit of the focus qubit of the respective controlled-NOT gate is a control qubit of the MCR gate; and one or more additional rotation gates located at the centre of the symmetrical chain structure.

[0192] Step S2840 comprises identifying a plurality of native gates corresponding to each of the quantum sub-circuits, the native gates being gates acting on up to two adjacent qubits, the plurality of native gates comprising: singly-controlled-NOT gates, and one or more of: Hadamard gates, T gates, and S gates. Step S2850 comprises identifying a final quantum circuit corresponding to the multi-controlled rotation gate, the final quantum circuit comprising the plurality of native gates and the one or more first rotation gates acting on the target qubit (qt). Step S2860 comprises outputting an indication of the final quantum circuit.

[0193] The method described in relation to Figure 33 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 tangibleand 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.

[0194] Accordingly, from one perspective there has been described a computer-implemented method, system and computer-readable medium for compiling a quantum circuit. A first quantum circuit is identified corresponding to the multi-controlled rotation gate, the first quantum circuit including a plurality of multi-qubit relative phase gates and a plurality of multi-controlled Z gates. Quantum sub-circuits are identified corresponding to combinations of the multi-qubit relative phase gates multi-controlled Z gates, where the quantum sub-circuits comprise a symmetrical chain structure. The symmetrical chain structures comprise controlled-NOT gates spanning a range of qubits on which the particular multi-controlled-Z gate acts, wherein consecutive controlled-NOT gates of the symmetrical chain structure act on consecutive focus qubits according to a first adjacent qubit of the respective focus qubit, wherein the first adjacent qubit of the respective focus qubit is located closer to the respective edge qubit of the range of qubits than a second adjacent qubit of the respective focus qubit, wherein the controlled-NOT gates of the symmetrical chain structure are either singly-controlled-CNOT gates or relative-phase Toffoli gates, based on whether the second adjacent qubit of the focus qubit of the respective controlled-NOT gate is a control qubit of the MCR gate. Native gates corresponding the quantum sub-circuits are identified, and a final quantum circuit corresponding to the multi-controlled rotation gate is identified and output.

Claims

CLAIMS1. A computer-implemented method for compiling a multi-controlled rotation (MCR) gate of a quantum circuit for a quantum computing device, 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 (qt) , and a plurality of control qubits;identifying a first quantum circuit corresponding to the MCR gate, the first quantum circuit comprising:a one or more first rotation gates acting on the target qubit (qt),a plurality of multi-qubit relative-phase gates (A) each acting on particular groups of the plurality of control qubits, anda plurality of multi-controlled-Z gates acting on respective groups of the plurality of control qubits, wherein the plurality of multi-controlled-Z gates span a respective range of qubits, and wherein each multi-controlled-Z gate additionally acts on a respective edge qubit defining an edge of the respective range of qubits;identifying a plurality of quantum sub-circuits corresponding to a combination of the plurality of multi-qubit relative-phase gates (A) and the plurality of multi-controlled-Z gates of the first quantum circuit, wherein each quantum sub-circuit comprises:a symmetrical chain structure of controlled-NOT gates spanning the respective range of qubits on which the particular multi-controlled-Z gate acts, wherein consecutive controlled-NOT gates of the symmetrical chain structure act on consecutive focus qubits according to a first adjacent qubit of the respective focus qubit, wherein the first adjacent qubit of the respective focus qubit is located closer to the respective edge qubit of the range of qubits than a second adjacent qubit of the respective focus qubit,wherein the controlled-NOT gates of the symmetrical chain structure are either singly-controlled-CNOT gates or relative-phase Toffoli gates, based on whether the second adjacent qubit of the focus qubit of the respective controlled- NOT gate is a control qubit of the MCR gate; andone or more additional rotation gates located at the centre of the symmetrical chain structure;identifying a plurality of native gates corresponding to each of the quantum sub-circuits, the native gates being gates acting on up to two adjacent qubits, the plurality of native gates comprising:singly-controlled-NOT gates, andone or more of:Hadamard gates,T gates, andS gates;identifying a final quantum circuit corresponding to the multi-controlled rotation gate, the final quantum circuit comprising the plurality of native gates and the one or more first rotation gates acting on the target qubit (qt); andoutputting an indication of the final quantum circuit.

2. The method according to claim 1 , wherein the respective edge qubit of the range of qubits on which the multi-controlled-Z gates act is the target qubit (qt).

3. The method according to claim 2, wherein the target qubit has two neighbouring qubits (qt+i, qt-i) included within the set of qubits,wherein the plurality of multi-qubit relative-phase gates (A) included in the first quantum circuit comprise: two first multi-qubit relative-phase gates (Ai, Ai+) each acting on a first group (Ci) of the control qubits and a first neighbouring qubit (qt-i) of the target qubit, and two second multi-qubit relative-phase gates (A2, A2f) each acting on a second group of the control qubits (C2) and a second neighbouring qubit (qt+1) of the target qubit,wherein the plurality of multi-controlled-Z gates included in the first quantum circuit include: two first multi-controlled-Z gates each acting on the first group (Ci) of the control qubits and the target qubit (qt), and two second multi-controlled-Z gates each acting on the second group (C2) of the control qubits and the target qubit (qt).

4. The method according to claim 3,wherein based on whether the first neighbouring qubit (qt-i) is a control qubit of the MCR gate:the respective edge qubit of the two first multi-controlled-Z gates is either the target qubit (qt) or the second neighbouring qubit (qt+i) , and the two first multi-controlled-Z gates each selectively additionally act on the first neighbouring qubit (qt-1),the first multi-qubit relative-phase gates (A1, A^) selectively additionally act on the target qubit (qt), andpairs of first multi-controlled-Z gates and first multi-qubit relative-phase gates (A1, A^) are selectively bounded by two swap gates acting on the target qubit (qt) and the second neighbouring qubit (qt+i) ; andwherein based on whether the second neighbouring qubit (qt+i) is a control qubit of the MCR gate:the respective edge qubit of the two second multi-controlled-Z gates is either the target qubit (qt) or the first neighbouring qubit (qt-i) , and the two second multi-controlled-Z gates each selectively additionally act on the second neighbouring qubit (qt+1) ,the second multi-qubit relative-phase gates (A2, A2f) selectively additionally act on the target qubit (qt), andpairs of first multi-controlled-Z gates and first multi-qubit relative-phase gates (A2, A2f) are selectively bounded by two swap gates acting on the target qubit (qt) and the first neighbouring qubit (qt-1) .

5. The method according to claim 2, wherein the target qubit (qt) has one neighbouring qubit (qt.i) included within the set of qubits, wherein the plurality of multi-qubit relative-phase gates (A) included in the first quantum circuit comprise two multi-qubit relative-phase gates (A1, Ai1) each acting on a first group the control qubits and the neighbouring qubit (qt-i),wherein the plurality of multi-controlled-Z gates included in the first quantum circuit include two multi-controlled-Z gates each acting on the first group of control qubits and additionally acting on the target qubit (qt), andwherein based on whether the neighbouring qubit (qt.i) is a control qubit: the first quantum circuit selectively additionally includes two singly-controlled Z gates acting on the target qubit (qt) and the neighbouring qubit (qt-1).

6. The method according to any of claims 2-5, wherein the MCR gate is in a unitary group of gates of degree two (U(2)), wherein the target qubit has two neighbouring qubits in the set of qubits, wherein a first neighbouring qubit of the target qubit (qt) is a first ancilla qubit (qa) having a predetermined state;wherein the plurality of multi-controlled-Z gates of the first quantum circuit comprise: a first plurality of multi-controlled-Z gates acting on a first group (Ci) of the control qubits, and a second plurality of multi-controlled-Z gates acting on a second group (C2) of the control qubits, wherein the first plurality of multi-controlled-Z gates selectively additionally act on either the target qubit (qt) or the first ancilla qubit (qa) based on whether a second neighbouring qubit (qt.i) of the target qubit (qt) is a control qubit of the MCR gate, and wherein the second plurality of multi-controlled-Z gates selectively additionally act on either the first ancilla qubit (qa) or the target qubit (qt) based on whether another neighbouring qubit (qa+i) of the first ancilla qubit (qa) other than the target qubit (qt) is a control qubit of the MCR gate;wherein the plurality of multi-qubit relative-phase gates (A) comprise: a first plurality of multi-qubit relative-phase gates (A1, A^) acting on the first group (Ci) of the control qubits and the second neighbouring qubit (qt-1) , and a second plurality of multi-qubit relative-phase gates (A2, A2t) acting on the second group (C2) of the control qubits and the other neighbouring qubit (qa+i) of the first ancilla qubit (qa), wherein the first plurality of multi-qubit relative-phase gates (A1, Ai1) selectively additionally act on the target qubit (qt) based on whether the second neighbouring qubit (qt-1) of the target qubit (qt) is a control qubit of the MCR gate, and wherein the second plurality of multi-qubit relative-phase gates (A2, A2f) selectively additionally act on the first ancilla qubit (qa) based on whether the other neighbouring qubit (qa+i) of the first ancilla qubit (qa) is a control qubit of the MCR gate;wherein the first quantum circuit additionally comprises a plurality of second rotation gates acting on the first ancilla qubit (qa);wherein the first quantum circuit additionally comprises a plurality of CNOT gates, wherein the plurality of CNOT gates comprise a first plurality of CNOT gates and a second plurality of CNOT gates, wherein the first plurality of CNOT gates bound the first plurality of multi-controlled-Z gates and first plurality of multi-qubit relative-phase gates (Ai, A^), and wherein the second plurality of CNOT gates bound the second plurality of multi-controlled-Z gates and second plurality of multi-qubit relative-phase gates (A2, A2f);wherein based on whether the second neighbouring qubit (qt-1) of the target qubit (qt) is a control qubit of the MCR gate: the first plurality of CNOT gates either act on the target qubit (qt) according to the state of the first ancilla qubit (qa) or act on the first ancilla qubit (qa) according to the state of the other neighbouring qubit (qa+i) of the first ancilla qubit (qa);wherein based on whether the other neighbouring qubit (qa+i) of the first ancilla qubit (qa) is a control qubit of the MCR gate: the second plurality of CNOT gates either act on the first ancilla qubit (qa) according to the state of the target qubit (qt) or act on the target qubit (qt) according to the state of the second neighbouring qubit (qt-1);wherein the first quantum circuit selectively additionally comprises a plurality of SWAP gates bounding the plurality of multi-controlled-Z gates and multi-qubit relative-phase gates based on whether the second neighbouring qubit (qt-1) and / or other neighbouring qubit (qa+i) of the first ancilla qubit (qa) are control qubits of the MCR gate.

7. The method according to claim 1, wherein the MCR gate is in a unitary group of gates of degree 2 (U(2)), and wherein the target qubit (qt) has only one neighbouring qubit in the set of qubits, and wherein the neighbouring qubit is a first ancilla qubit (qa) having a predetermined state;wherein the one or more first rotation gates of the first quantum circuit comprise a singly-controlled rotation gate acting on the target qubit (qt) according to the state of the first ancilla qubit (qa), wherein a rotation amount and rotation axis of the singly-controlled rotation gate correspond to the rotation amount and rotation axis of the MCR gate;wherein the plurality of multi-controlled-Z gates of the first quantum circuit act on the first ancilla qubit (qa) and the plurality of control qubits and wherein the respective edge qubit for each of the multi-controlled-Z gates is the first ancilla qubit (qa);wherein the plurality of multi-qubit relative-phase gates (A) each act on the plurality of control qubits and another neighbouring qubit of the first ancilla qubit (qa) other than the target qubit (qt); andwherein the first quantum circuit additionally comprises a plurality of second rotation gates acting on the first ancilla qubit (qa) according to the state of a neighbouring qubit of the first ancilla qubit (qa) other than the target qubit (qt).

8. The method according to claim 7, wherein the plurality of second rotation gates comprise, based on whether of a first neighbouring qubit of the first ancilla qubit (qa) other than the target qubit (qt) is a control qubit of the MCR gate, either Hadamard gates acting on the first ancilla qubit (qa) or singly-controlled rotation gates d“|v) acting on the first ancilla qubit (qa) according to the state of the first neighbouring qubit.

9. The method according to claim 7 or claim 8, further comprising:identifying one or more re-orderings to the set of qubits to cause the target qubit (qt) to have the first ancilla qubit (qa) as an only neighbouring qubit, andwherein the final quantum circuit includes a plurality of CNOT gates implementing the one or more identified re-orderings.

10. The method according to claim 1, wherein the MCR gate is a multi-controlled NOT (MCX) gate;wherein the set of qubits includes one or more ancilla qubits;wherein the one or more first rotation gates of the first quantum circuit comprise a plurality of Hadamard gates;wherein the plurality of multi-controlled-Z gates of the first quantum circuit each additionally act on a first ancilla qubit (qa) of the one or more ancilla qubits, wherein the target qubit (qt) of the MCX gate is set as a control qubit for one or more of the multi-controlled Z gates;wherein the plurality of multi-qubit relative-phase gates (A) of the first quantum circuit each act on a particular neighbouring qubit (qa+i , qa-i) of the first ancilla qubit (qa);wherein the first quantum circuit additionally comprises a plurality of second rotation gates (riv) acting on the first ancilla qubit (qa);wherein the respective edge qubit of the range of qubits on which the multi-controlled-Z gates act is the first ancilla qubit (qa).

11. The method according to claim 10, wherein the first ancilla qubit (qa) has two neighbouring qubits (qa+i, qa.i) included within the set of qubits, and wherein both of the neighbouring qubits (qa+i , qa-i) are either the target qubit (qt) of the MCX gate or a control qubit of the plurality of control qubits of the MCX gate;wherein the plurality of multi-controlled Z gates of the first quantum circuit comprise: a plurality of first multi-controlled Z gates acting on a first group (Ci) of the plurality of control qubits and the first ancilla qubit (qa), anda plurality of second multi-controlled Z gates acting on a second group (C2) of the plurality of control qubits and the first ancilla qubit (qa);wherein the plurality of multi-qubit relative-phase gates (A) comprise:a first plurality of multi-qubit relative-phase gates (A1, A^) acting on the first group (Ci) of the plurality of control qubits, and a first neighbouring qubits (qa.i) of the first ancilla qubit, wherein the first neighbouring qubit (qa.i) is located between the first ancilla qubit (qa) and a first group (Ci) of the plurality of control qubits, anda second plurality of multi-qubit relative-phase gates (A2, A2f) acting on the second group (C2) of the plurality of control qubits, and the second neighbouring qubit (qa+i) of the first ancilla qubit (qa), wherein the second neighbouring qubit (qa+i) is located between the first ancilla qubit (qa) and the second group (C2) of the plurality of control qubits; andwherein the plurality of second rotation gates d“|v) acting on the first ancilla qubit (qa) comprise:doubly-controlled rotation gates acting on the first ancilla qubit (qa) according to both neighbouring qubits (qa+i , qa-i); andwherein the method further comprises identifying native gates corresponding to the plurality of second rotation gates (Hv)-12. The method according to claim 10, wherein the first ancilla qubit (qa) has two neighbouring qubits (qa+i, qa.i) included within the set of qubits, and wherein of the two neighbouring qubits (qa+i, qa-i) only a first neighbouring qubit (qa.i) is either the target qubit (qt) of the MCX gate or a control qubit of the plurality of control qubits of the MCX gate, wherein the first neighbouring qubit (qa.i) is located between the first ancilla qubit (qa) and a first group (Ci) of the plurality of control qubits;wherein the plurality of multi-controlled Z gates of the first quantum circuit comprise: a plurality of first multi-controlled Z gates acting on a first group (Ci) of the plurality of control qubits and the first ancilla qubit (qa), anda plurality of second multi-controlled Z gates acting on a second group (C2) of the plurality of control qubits and the first ancilla qubit (qa);wherein the plurality of multi-qubit relative-phase gates (A) comprise:a first plurality of multi-qubit relative-phase gates (A1, Ai1) acting on the first group (Ci) of the plurality of control qubits, and the first neighbouring qubit (qa-i), anda second plurality of multi-qubit relative-phase gates (A2, A2f) acting on the second group (C2) of the plurality of control qubits, and a second neighbouring qubit (qa+i) of the first ancilla qubit (qa); andwherein the plurality of second rotation gates (Hv) acting on the first ancilla qubit (qa) comprise:singly-controlled rotation gates acting on the first ancilla qubit (qa) according to the first neighbouring qubit (qa.i); andwherein the method further comprises identifying native gates corresponding to the plurality of second rotation gates (Hv).

13. The method according to claim 10, wherein the first ancilla qubit (qa) has two neighbouring qubits (qa+i, qa.i) included within the set of qubits, and wherein neither of the two neighbouring qubits (qa+i, qa.i) are the target qubit (qt) of the MCX gate or a control qubit of the plurality of control qubits of the MCX gate;wherein the plurality of multi-controlled Z gates of the first quantum circuit comprise: a plurality of first multi-controlled Z gates acting on a first group (Ci) of the plurality of control qubits and the first ancilla qubit (qa), anda plurality of second multi-controlled Z gates acting on a second group (C2) of the plurality of control qubits and the first ancilla qubit (qa);wherein the plurality of multi-qubit relative-phase gates (A) comprise:a first plurality of multi-qubit relative-phase gates (A1, Ai+) acting on the first group (Ci) of the plurality of control qubits, and a first neighbouring qubit (qa-i) of the first ancilla qubit, wherein the first neighbouring qubit (qa.i) is located between the first group (Ci) of the plurality of control qubits and the first ancilla qubit (qa), anda second plurality of multi-qubit relative-phase gates (A2, A2f) acting on the second group (C2) of the plurality of control qubits, and a second neighbouring qubit (qa+i) of the first ancilla qubit (qa); andwherein the plurality of second rotation gates d“|v) acting on the first ancilla qubit (qa) are Hadamard gates.

14. The method according to any preceding claim, wherein one or more of the groups of the plurality of control qubits include control qubits which are adjacent to one or more other control qubits.

15. The method according to any preceding claim, wherein determining the plurality of quantum sub-circuits comprises determining an orientation of relative-phase Toffoli gates of the symmetrical chain structure based on predetermined depth-reduction rules.

16. The method according to any preceding claim, wherein identifying the final quantum circuit comprises identifying two or more gates to be executed in parallel to reduce the depth of the final quantum circuit, andwherein in the final quantum circuit the two or more gates are to be executed in parallel.

17. The method according to any preceding claim, 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 native gate or a depth for a particular native gate in the final quantum circuit; andwherein the final quantum circuit includes a plurality of CNOT gates implementing the one or more identified re-orderings.

18. The method according to any preceding claim, wherein the one or more additional rotation gates comprise a multi-controlled iZ gate.

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

20. 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-18.

21. A quantum circuit for implementing multi-controlled iZ gate using a quantum computer, the 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 Hadamard gate acting on the second control qubit;a first CNOT gate acting on the first control qubit according to the second control qubit; a second CNOT gate acting on the second control qubit according to the target qubit; an S gate acting on the first control qubit, and angate acting on the second control qubit;a third CNOT gate acting on the second control qubit according to the first control qubit; a second Hadamard gate acting on the first control qubit, a first T gate acting on the second control qubit, and a third T gate acting on the target qubit;a fourth CNOT gate acting on the second control qubit according to the first control qubit; a fifth CNOT gate acting on the second control qubit according to the target qubit;a third T gate acting on the first control qubit, and a gate acting on the second control qubit;a sixth CNOT gate acting on the first control qubit according to the second control qubit; anda seventh CNOT gate acting on the second control qubit according to the target qubit.