Quantum compiler
The method of calculating geodesics on a manifold to approximate qubit transformations in quantum circuits addresses inefficiencies in existing unitary operator implementations, reducing errors and qubit requirements in quantum computers.
Patent Information
- Authority / Receiving Office
- AU · AU
- Patent Type
- Applications
- Current Assignee / Owner
- UCL BUSINESS LTD
- Filing Date
- 2024-12-03
- Publication Date
- 2026-07-23
AI Technical Summary
Existing methods for implementing unitary operators on quantum computers are inefficient, requiring large numbers of qubits and sequential operations, leading to increased computational requirements and errors, which are costly and error-prone.
A method for compiling quantum circuits by identifying a target qubit transformation and calculating a geodesic between an initial and target transformation on a manifold of qubit transformations, determining a step change in parameter values to modify the initial transformation, and iteratively approximating the target transformation until a predefined threshold of infidelity is reached.
This approach allows for efficient approximation of arbitrary qubit transformations, reducing errors and the number of required qubits, thereby minimizing computational resources and errors in quantum computers.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Technical Field
[0001] The present invention relates generally to compilers for quantum computers, more specifically to methods, systems, and computer-readable mediums for compiling quantum logic gates corresponding to unitary operators in 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 |tp) can be described as a linear combination of |0> and |1), such that |tp) = a|0) + ^|1), where |a|2 + \p|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 are generally inefficient, meaning quantum computers implementing a unitary operator require comparatively 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 unitary operators based on the hardware limitations of a physical quantum computer. Summary of the Invention
[0005] The invention is defined by the appended claims.
[0006] According to a first aspect of the invention, there is provided a computer-implemented method for compiling a quantum circuit. The method comprises: identifying a target qubit transformation, which can act on multiple qubits, in a quantum circuit; and identifying an initial qubit transformation as a function of a set of parameters having particular parameter values, the set of parameters corresponding to parameters for one or more available qubit interactions for one or more qubits, wherein the target qubit transformation and initial qubit transformation exist on a manifold of qubit transformations. The method further comprises identifying a modified qubit transformation based on a geodesic between the initial qubit transformation and the target qubit transformation, wherein identifying the modified qubit transformation comprises: calculating the geodesic on the manifold between the target qubit transformation and the initial qubit transformation; for a point on the manifold corresponding to the initial qubit transformation, calculating a directional derivative for each parameter of the set of parameters; based on the geodesic and the directional derivatives of the parameters, determining a step change in the particular parameter values of the initial transformation; and based on the determined step change, modifying the initial qubit transformation to determine the modified qubit transformation. The method further includes identifying the modified qubit transformation as a final qubit interaction, wherein the final qubit transformation corresponds to final values of the set of parameters.
[0007] As such, a method is provided which allows arbitrary qubit transformations to be closely approximated and in a manner which does so quickly. Accordingly, a large quantum gate acting on several qubits can be approximated closely and implemented as a single transformation. This significantly reduces the errors within the quantum computer, and therefore also reduces the number of required qubits in the quantum computer.
[0008] In some cases, the method further comprises: identifying a target quantum circuit comprising a plurality of base quantum gates; and identifying the target qubit transformation comprises: selecting two or more of the plurality of base quantum gates of the target quantum circuit; calculating a combination of the two or more base quantum gates as the target qubit transformation. As such, the method may be used for quantum circuits which have already been compiled, for example with a standard universal gate set, which is not optimised for the hardware implementation. The base quantum gates may be qubit interactions acting on two or fewer qubits however other definitions are possible. Advantageously, the target qubit transformation may act on more than two qubits.
[0009] According to some examples, modifying the initial qubit transformation comprises modifying one or more of the particular values of the initial transformation according to the determined step change. As such, the initial qubit transformation may approach the target transformation by updating the parameter values with a calculated change.
[0010] In some examples, the method comprises identifying the final qubit transformation iteratively, wherein a modified qubit transformation for a particular iteration is identified as a subsequent initial qubit transformation for a subsequent iteration, wherein the identifying of the modified qubit transformation is performed iteratively until a particular modified qubit transformation is identified as the final qubit transformation. As such, the target qubit transformation may be closely approximated by repeating the method until and acceptable solution is reached.
[0011] Advantageously, wherein the modified qubit transformation may be identified as the final qubit transformation based on an infidelity between the modified qubit transformation and the target qubit transformation being below a predefined threshold. As such, the required closeness of the approximation of the target qubit interaction may be defined in advance, and the method may continue autonomously until the required closeness is reached.
[0012] In some cases, determining the step change in the particular parameter values comprises: determining a direction of the step change on the manifold; and determining a size of the step change on the manifold. Accordingly, both the direction and size of the step change may be separately optimised in order to more closely follow the geodesic and approach the target qubit transformation.
[0013] In certain examples, determining the direction of the step change comprises determining the direction of the step change to be a direction that most closely follows the geodesic. Accordingly, an optimal direction for the step change that allows the qubit transformation to approach that target qubit transformation most quickly may be determined. Advantageously, the direction of the step change may be determined as a linear combination of the directional derivatives of the parameters. Accordingly, the change to the parameters can be easily determined and multiplied by a scalar size factor. In some examples, the direction of the step change is determined using a convex optimisation process. Accordingly, known mathematical techniques may be applied in order to determine the direction of the step change.
[0014] According to some examples, determining the size of the step change comprises determining the size of the step change through a line search, such as a golden section line search. For example, determining the size of the step change may comprise determining the size of the step change which minimises an infidelity between the modified qubit transformation and the target qubit transformation. As such, an optimal step change size can be determined which allows the qubit transformation to quickly and closely approach the target qubit transformation.
[0015] In certain examples, the method further comprises: determining that the initial qubit transformation is at a local minimum; and based on determining that the initial qubit transformation is at the local minimum, determining the step change based on a relocation vector. Accordingly, any local minima may be escaped as part of the method according to this example, meaning the target qubit transformation can be closely approximated.
[0016] Advantageously, determining the step change may comprise setting the step change to be orthogonal to the geodesic. As such, the likelihood of the qubit transformation finding the same local minima in subsequent iterations is reduced. In some cases, the step change is set to be orthogonal to the geodesic using a Gram-Schmidt process. As such, known mathematical techniques may be applied in order to determine a step change which is orthogonal to the geodesic. Furthermore, in certain examples, the relocation vector is generated randomly. As such, the method may automatically escape local minima.
[0017] According to some examples, determining that the initial qubit transformation is at the local minimum is based on determining a first fidelity between the initial qubit transformation and the target qubit transformation is greater than or equal to a second fidelity between the modified qubit transformation and the target qubit transformation. As such, the method may accurately determine whether the qubit transformation is at a local minima, thereby providing an efficient method for escaping the local minima.
[0018] In certain examples, the method further comprises: receiving an indication of the set of parameters. As such, the method may use substantially any set of parameters as input when parameterising the initial qubit transformation. In certain examples, the method further comprises receiving an indication of possible values for each of the set of parameters. As such, the possible ways in which the parameter values may be modified may be defined and set according to substantially any criteria.
[0019] Advantageously, the available qubit interactions may be known physically realisable qubit interactions. As such, the method ensures that any approximation of the target qubit transformation can be implemented on a real-world quantum computer. Moreover, the method is agnostic to the type of quantum computing technology or any specific quantum computer, as the physically realisable qubit interactions can be defined for individual quantum computers or quantum computing technologies. The method is therefore flexible and may be used for substantially any real-world quantum computer.
[0020] According to some examples, the target qubit transformation is a first target qubit transformation, and the initial qubit transformation is a first initial qubit transformation, and the modified qubit interaction is a first modified qubit interaction, and wherein the method further comprises: identifying a second target qubit transformation by calculating a result of the first target qubit transformation and one or more other qubit interactions; identifying a second initial qubit transformation; identifying a second modified qubit transformation based on a geodesic between the second initial qubit transformation and the second target qubit transformation. Accordingly, the method maximises the size of individual quantum gates in a quantum circuit, thereby reducing the cost and depth of the circuit, and reducing the errors introduced by a quantum computer, and the number of qubits required to correct errors.
[0021] In some examples, the method further comprises outputting the final qubit transformation. As such the final qubit transformation may be used e.g. by a quantum computer as a close approximation of the target qubit transformation. The final qubit transformation may be output to a quantum computer or to some other entity configured to generate hardware instructions for a quantum computer based on the final qubit transformation. As such, the result of the method may be directly used in the operation of a quantum computer.
[0022] In some cases, the method further comprises outputting the values for the parameters for the one or more available qubit interactions for the one or more qubits corresponding to the final values of the set of parameters. As such, the result of the method may be directly used in the operation of a quantum computer. As an example, the values for the parameters for the one or more available qubit interactions for the one or more qubits are output to a controller for an apparatus configured to carry out the one or more available qubit interactions.
[0023] In certain examples, the method further comprises outputting final parameter values for the set of parameters, the final parameter values being the values of the set of parameters associated with the final qubit transformation. As such the final parameter values may be used e.g. by a quantum computer in order to closely approximate the target qubit transformation. The final parameter values may be output to a quantum computer or to some other entity configured to generate hardware instructions for a quantum computer based on the final parameter values. As such, the result of the method may be directly used in the operation of a quantum computer.
[0024] 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 the method described above.
[0025] 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 the method described above. Brief Description of the Drawings
[0026] 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 |t / 0-
[0027] Figure 2 illustrates an example system for converting a quantum circuit into the execution of a quantum algorithm on a quantum computer.
[0028] Figure 3A illustrates the calculation of a geodesic between an initial qubit transformation and a target qubit transformation on a manifold, according to an example of the present disclosure.
[0029] Figure 3B illustrates the calculation of directional derivatives on the manifold for each parameter in a parameter set at the initial qubit transformation, according to an example of the present disclosure.
[0030] Figure 3C illustrates determining a step change in the parameters according to an example of the present disclosure.
[0031] Figure 3D illustrates determining a modified qubit integration using the step change in the parameters, and iteratively repeating the steps of Figures 3A-3C, according to an example of the present disclosure.
[0032] Figure 3E illustrates determining a step change in the parameters when the parameter values are at a local minimum,
[0033] Figure 4 illustrates an example computing system for carrying out examples of the claimed invention, for example as shown in Figures 3A-3D.
[0034] Figure 5 illustrates an example use of techniques according to the present disclosure in decomposing a quantum gate.
[0035] Figure 6 illustrates an example use of techniques according to the present disclosure in combining multiple quantum gates.
[0036] Figure 7 illustrates a flowchart of an example method according to the present disclosure. Detailed Description Qubits and Quantum Gates
[0037] Quantum computing encompasses computing technologies which use quantum bits, referred to as ‘qubits’, to store information and perform calculations. The state of a qubit |t / 0 can exist in a superposition of two states |0) and 11>, and as such may be described as a linear combination of |0) and |1>, such that |t / 0 = a|0) + ^|1), where a and p are complex numbers and |a|2 + | / ?|2 = 1. Upon measuring the state of a qubit, the qubit takes a value of either |0) or |1) based on the probability amplitudes |a|2 and | / ?|2 for 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 state |V>> of a qubit 100 may be considered a vector on magnitude 1 on the Bloch sphere, which has three axes: x, y and z. The states |0) and |1) exist on opposite points on the Bloch sphere, where the z axis extends between |0) and 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 |V0. and the angle (p is defined between the x axis and |V0. such that a = cos M and p = e‘^sin(-).
[0038] The state of a qubit, namely the values of a and p (or 0 and cp) 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 11>, 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|0>, and maps 11> to - i|0> 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 ei<p 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 by ^ / 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 by radians, such that T = 4s = y[z.
[0039] 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 11> 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 a 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>.
[0040] 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 multicontrolled NOT gate. A NOT gate is applied to a target qubit only if two control qubits are in state 11>. The Toffoli gate is just one example of a multi-controlled gate, however other multicontrolled gates may be implemented where any arbitrary gate may be implemented based on substantially any number of control gates.
[0041] 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 by71radians, the Tf gate rotates the state of the qubit around the z axis by ~n / ^. radians.
[0042] Quantum gates acting on one or more of a set of qubits may be performed sequentially 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, implementing said quantum circuits on real-world quantum computers often prove challenging. Physical Quantum Computers
[0043] 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.
[0044] 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 in 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.
[0045] 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.
[0046] 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.
[0047] An additional challenge with such physical quantum computing systems is the inability of such systems to implement generic gates acting on an arbitrary number of qubits. For example, current physical quantum computers may, for example, only be able to implement quantum gates acting on one, two, or three qubits, depending on the quantum computing technology used. As such, large multi-qubit gates (including multi-controlled gates with more than one or two control qubits) may not be directly implementable by physical quantum computers. In other words, a physical quantum computer might not be able to implement such a gate in a single operation.
[0048] 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
[0049] 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 Sf and Tf 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 Tf gate, and an S gate may be an S gate or a Sf gate. In other words, any quantum gate can be expressed using some combination of a finite number of CNOT, H, S (and Sf), and / or T (and Tf) 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)}. 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.
[0050] 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. 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 noisy intermediate-scale quantum (NISQ) era, physical quantum computers are generally prone to errors, for example due to quantum decoherence, noise, or imprecise gate application. These errors scale with the cost and depth of a quantum circuit, such that the greater the cost and / or depth of the quantum circuit, the greater the likelihood of errors. This in turn may require additional quantum circuitry (i.e. additional qubits and gates) in order to mitigate these errors and provide a functioning quantum computer. Quantum Compilers
[0051] 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.
[0052] Figure 2 illustrates an example system 200 for converting a logical quantum circuit into qubit interactions. The system 200 includes a quantum circuit 210 which is intended to be executed by a quantum computer 235. The quantum circuit 210 may in principle include any combination of one or more quantum gates, and may be created by a user or determined autonomously. A circuit compiler (i.e. quantum compiler) 220 may receive the quantum circuit 210 and decompose the quantum circuit 210 into base quantum gates which are implementable by the quantum computer 235 which is intended to implement the quantum circuit 210. The circuit compiler 220 may receive an indication of the base quantum gates. The indication of the base quantum gates may be indicated by a user or received from the quantum computer 235 itself, or another external entity. The circuit compiler may be provided with or may access a set (or database) of decompositions, where certain quantum gates or combinations of quantum gates are decomposed into a particular known arrangement of base quantum gates. Furthermore, the circuit compiler 220 may be implemented on the same computing system on which the quantum circuit 210 is determined, or the circuit compiler 220 may be implemented on a different computing system to the computing system on which the quantum circuit 210 is determined. The base quantum gates may, for example, be a universal gate set or a predefined set of gates which a particular quantum computer is capable of implementing via a single interaction with one or more qubits, such as gates acting on one or two qubits.
[0053] 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.
[0054] The decomposed quantum circuit may then be converted into a set of instructions for the quantum computer 235, for example by an instruction generator 230. The instruction generator 230 receives the decomposed quantum circuit and converts the decomposed quantum circuit into a set of physical operations to be carried out by the qubit interaction hardware 250 of the quantum computer 235, corresponding to the decomposed quantum circuit. The instruction generator 230 may be a separate logical entity to the circuit compiler 220, or the instruction generator 230 and circuit compiler 220 may be part of the same logical entity. Therefore, the instruction generator 230 and circuit compiler may be implemented on the same computing device, or on different computing devices. Furthermore, while the instruction generator 230 is shown as being outside the quantum computer 235, the instruction generator 230 may in some cases be considered to be part of the quantum computer 235.
[0055] 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 the 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).
[0056] Accordingly, the instruction generator 230 can output a set of instructions for the quantum computer 230 which allow the quantum computer 235 to implement the quantum circuit 210 on the qubits 261 of the qubit assembly 260. In the example of an EM pulse, the hardware instructions may include the amplitude, pulse length, phase, and / or frequency of one or more EM pulses by one or more EM pulse emitters towards one or more qubits 261a-n, and the timing and / or order of the one or more EM pulses.
[0057] 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.
[0058] 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. Unitary Gates and the SU(N) Special Unitary Group
[0059] As discussed above, a quantum computer may have a predefined finite set of gates which it is known to be able to implement, and a quantum complier may decompose quantum circuits into combinations of these gates. However, the types of qubit hardware interaction provided by a given quantum computer or quantum computing technology may allow for more varied quantum gates beyond the predefined finite set of gates. That is, the qubit hardware interactions available in a particular quantum computer may extend beyond such a predefined set of quantum gates. More specifically, different quantum gates are executed with a particular qubit hardware interaction (such as a laser pulse or microwave radiation pulse) using different parameters. For example, in the case of a pulse of EM radiation (which in some examples may be used in various forms in each of superconducting quantum computing, trapped ion quantum computing, and neutral atom quantum computing), parameters affecting the qubit hardware interaction include the amplitude (e.g. peak amplitude), pulse length, phase, and / or frequency of the EM pulse, such that changing these parameters changes the operation applied to the qubit. However, these parameters are not limited to a predefined finite set of values (corresponding to a predefined finite set of quantum gates) and can in principle be modified arbitrarily to provide a far larger number of possible qubit hardware interactions.
[0060] In other words, the parameters affecting the qubit hardware interaction (e.g. the amplitude, pulse length, phase, and / or frequency of the pulse of EM radiation) may be set to predefined values in order to perform one or more predefined quantum gates, and the parameters affecting the qubit hardware interaction may in some cases be set to one or more non-predefined values in order to implement a quantum gate that has not been predefined. As such, a particular quantum computer may be capable of implementing quantum gates extending beyond a standardized, pre-defined quantum gate set.
[0061] A generic quantum gate U acting on n qubits can be expressed as an N x N unitary matrix which is an element of the unitary group of degree N U(N), such that UU^ = U^U = I, wherein is the Hermitian conjugate of the gate U, and I is the identity operator (which does not modify the state of qubits on which it acts), and where N = 2”. If the global phase of qubits on which the unitary gate U act is ignored, the unitary gate U is an element of the special unitary group SU(N), where special unitary group of degree N SU(N) includes all N x N unitary matrices with determinant 1 and has dimension N2-l. Furthermore, the special unitary group SU(N) is a Lie group, meaning that mathematically all unitary matrices (which correspond to quantum gates) which are in the special unitary group SU(N) exist on a smooth manifold. Each unitary matrix U (corresponding to mathematical quantum gates) on the special unitary group SU(N) manifold can be defined by a vector, the vector having components 010m (where m = N2 - 1), such that the components 0i-0m of the vector define the co-ordinates of the unitary matrix U(9) (the unitary matrix U expressed in terms of the components 0i-0m of the vector) on the SU(N) manifold. The unitary matrix U(9) can therefore be expressed as: U(9) = exp{i / / (0)} (1) where i is the imaginary unit, and H(9) is the Hamiltonian of the unitary matrix U(9), which is defined as: N2-l H(9) = 9jGj = 0 G J=i (2) where Gj is a qubit interaction (i.e. transformation) corresponding to the f1 element of the set of Pauli words for n qubits. The single-qubit Pauli group consists of four single qubit operations: {I,X,Y,Z}, i.e. the identity operator and the X, Y, and Z gates. The set of Pauli words for n qubits includes all possible N x N tensor products of the elements of the singlequbit Pauli group, and has size 4".
[0062] As an example, for a two-qubit system, the set of Pauli words includes 4x4 matrices which are the tensor products of all possible combinations of two (identical or non-identical) operators of the single-qubit Pauli group {^X,Y,Z}: {I0IJ0XJ0Y,I0Z,X0I,X0 X,X ®Y,X ®Z,Y ® I,Y ®X,Y ®Y,Y ®Z,Z ® I,Z ®X,Z ®Y,Z ®Z}. As such, the unitary matrix is the exponential of: the imaginary unit multiplied by a Hamiltonian, and the Hamiltonian is the sum over all of: a particular qubit interaction Gj multiplied by a parameter 9j defining a strength of that particular qubit interaction Gj. In other words, the Hamiltonian is a linear combination of all possible qubit interactions Gj in an n qubit system, where the strength of each of the qubit interactions Gj is defined by the values of the set of parameters 0, and the unitary matrix is the exponential of: the imaginary unit multiplied by that Hamiltonian. Furthermore, while the above discussion uses tenor products of the single-qubit Pauli group, this is just one illustrative example and other base interactions may be used instead, such as gates in a universal gate set. For generating the special unitary group SU(N), the Hamiltonian basis does not include the Pauli word of n identity operators (e.g. / ® / for two qubits), giving the dimension of the Hamiltonian as 4” - 1 or equivalently N2 - 1.
[0063] The values of the set of parameters 0 therefore determine the unitary matrix U(9), which corresponds to a particular qubit transformation (quantum gate), such that the values of the set of parameters 0 determine the transformation applied to one or more qubits. The set of parameters 0 can in principle take any values where the unitary matrix U(6) is in the special unitary group SU(N). However, in many quantum computers certain qubit interactions or types of qubit interaction may not be physically realisable. For example, as discussed above, in some quantum computers it is only possible to implement qubit interactions which act on up to two qubits. Furthermore, qubit interactions may be limited by the physical locations of the qubits, such that interactions may only be performed on LNN qubits, or multiple qubits having a particular geographical relationship to one another. It should also be appreciated that other potential restrictions on the possible qubit interactions may exist.
[0064] Accordingly, a reduced parameter set (p can be defined including only the qubit interactions which are physically realisable in the quantum computer. That is, values of parameters in the reduced parameter set (p corresponding to the strength of qubit interactions which are not physically realisable in the quantum computer may be set to zero. As such, the unitary matrix U may be expressed in terms of the parameters (pi- (pm in the reduced parameter set (p as U(cp), which include only terms corresponding to physically realisable qubit interaction, referred to as the set Jf. The reduced parameter set (p may depend e.g. on the number of qubits a particular quantum gate is arranged to operate (e.g. to include only one or two qubit interactions) or on the capabilities of a particular quantum computer. As the reduced parameter set (p corresponds to physically realisable qubit interactions, the parameters in the reduced parameter set (p may each be related to one or more physical parameters p which define properties of the physical interaction with the physical qubit(s) in the quantum computer. That is, the one or more physical parameters p may be defined as a function of one or more of the reduced parameter set (p. The relationship between the one or more physical parameters p and the reduced parameter set <p will be different for each quantum computer, but may be determined through calibration, such that the relationship between the one or more physical parameters p and the reduced parameter set (p may be predefined. Therefore, a unitary matrix U((p) can be ultimately expressed in terms of one or more physical parameters p which define properties of the physical interaction with the physical qubit(s) in the quantum computer. Geodesic Unitary Gate Design
[0065] As discussed above, any unitary matrix corresponding to a quantum gate exists on the special unitary group SU(N) manifold. Accordingly, a target qubit transformation V (which is a unitary matrix) which is desired to implemented on a physical qubit exists on that manifold. Moreover, as discussed above, the values of parameters in the reduced parameter set (p can be modified to change the location of a generic unitary matrix U((p) on the manifold. Accordingly, the values of parameters in the reduced parameter set (p can be modified in order to cause U((p) to be equal to, or approximate, the target qubit transformation V. Therefore, the values of the parameters in the reduced parameter set (p can be determined and used to determine the appropriate values of the physical parameters p for performing the target qubit transformation V on a physical qubit in a quantum computer.
[0066] According to the present disclosure, parameter values are determined by calculating a geodesic between a target qubit transformation V and an initial qubit transformation U((p) on a manifold, and determining a step change in the parameter values (p that most closely follows the geodesic.
[0067] Figures 3A-3D illustrate an example approach for compiling a quantum gate using a geodesic approach. A geodesic is the shortest path between any two points on a curved surface, such as the SU(N) manifold. Figure 3A illustrates a geodesic 320 on a manifold 300 (e.g. the Sll(N) manifold) having a starting point 310 and an end point 330. Where the starting point 310 is an initial qubit transformation U, and the end point 330 is a target qubit transformation V, an example approach for calculating the geodesic is as follows: X(t) = expert) (3) where X(t) is the geodesic, parameterised by a single parameter t, such that UX(&) = U and UX(1) = V, and r is the direction of the geodesic on a tangent space, given by: r = -i\og(U^V) (4)
[0068] As such, starting with any arbitrary initial qubit transformation U(cp), which is defined by the values of a set of parameters (p (which may have any values, such as randomised values or predefined values), and a target qubit transformation V, a geodesic on the manifold can be calculated between the initial qubit transformation U((p) and the target qubit transformation V.
[0069] Figure 3B illustrates the calculation of directional derivatives 340 on the manifold for each parameter of the set of parameters (p of the initial qubit transformation U(cp). As an example, the directional derivatives can be calculated as follows: (5) where is the partial derivative of the initial qubit transformation U(cp) with respect to an Zth parameter <pt of the set of parameters (p, and is the directional derivative of U(cp) with respect to an Zth parameter <pt. Figure 3B shows two directional derivatives 340a, 340b, such that the set of parameters (p includes only two parameters, however it should be appreciated that the set of parameters (p may include any number parameters, such that there may be any number of directional derivatives 340.
[0070] Based on the geodesic 320 and the directional derivatives 340, a step change 350 in the values of the set of parameters (p can be identified which most closely follows the geodesic. In particular, the method determines the optimal step change 350 by which to update initial parameter values such that, to obtain updated parameter values, as shown below: = (p^ + 8<p^ (6) where k indicates a particular iteration, <p^k+1^ are the set of updated parameters values, (p^ are the initial parameter values, and 8<p^ is the step change to the initial parameter values. The step change may be calculated based on the geodesic and directional derivatives in any manner. That is, it should be appreciated that the general approach disclosed herein is applicable to various other techniques.
[0071] An example of the relationship between the step change 350, directional derivatives 340, and geodesic 320 may be as follows: n2-i 8<p^nj(<p^ = j=i (7) where 6(^ is the step change in the jth parameter <pj of the set of parameters (p at the / cth iteration, / 27(< / / k)) is the directional derivative of the initial qubit transformation U((p) 310 at the / cth iteration with respect to the jth parameter <pj, and is the direction of the geodesic between U((p) and V at the / cth iteration. The task of finding the step change 350 can be restated as finding a linear combination of vectors. First, the geodesic can be written as a vector in the Lie algebra, as follows: N2-l y™ = Tr{G7rW}e7 j=i (8) where y® is the geodesic vector in the Lie algebra at the / cth iteration, N = 2" where n is the number of qubits on which the gate acts, Gj is the jth element of the set of qubit interactions for n qubits, Tr indicates the trace operation, is the direction of the geodesic between U((p) and V at the / cth iteration, and e( is a basis vector.
[0072] The directional derivatives can also be written as a vector in the Lie algebra, as follows: N2-l = TrlGjn^^ej J=i (9) where is the vector for the directional derivative of the Zth parameter <pt of the set of parameters cp, and / 2((< / / k)) is the directional derivative of the initial qubit transformation U((p) 310 at the / cth iteration with respect to the Zth parameter <pt. Using the vectors in Equations 8 and 9, the step change vector 350 can be determined as the vector 8<p^ which minimises the difference between the updated qubit transformation u(<p^k+1^ and the geodesic. As an example, the vector 8<p^ can be found by solving the following convex optimisation problem: minimise 8<p^ — y^ jVGjEJf (10) where ||-||2 is the Euclidian 2-norm. Accordingly, the direction of the step change 350 shown in Figure 3C can be determined based on the geodesic and the directional derivatives, so as to change the values of the parameters in a manner which minimises the difference between the step change and the geodesic.
[0073] An additional constraint may in some examples be introduced to the convex optimisation problem, namely that the parameter vectors tp® satisfy the commutator condition: (11) for all k. In other words, this constraint sets out that for a given set of values of the parameters <p, the commutator of the Hamiltonian for the set of values of the parameters <p and the logarithm of the target qubit transformation is zero. This constraint reduces the number of independent <p parameter components, thereby decreasing the number of steps to reach a parameter vector that generates a unitary evolution sufficiently close to the target.
[0074] In addition, to determine the step change 350 direction, the size of the step change may also be determined. The modified qubit transformation U(<p(k+^) 360 is the initial qubit transformation U(<p(k)) 310 with updated parameter values <p(k+1\ the updated parameter values <p(k+V being the initial parameter values (p^ (which are the parameter values for the initial qubit transformation U(<p(k)) 310) plus the step change 8<p^ 350. In other words, the modified qubit transformation 350 is U(<p + Sep). The size of the step change is chosen to minimise the infidelity (i.e. difference) between the target qubit transformation V 330 and the modified qubit transformation U(<ptk+V) 360. This may be done, for example, by calculating the inner product between the target qubit transformation V 330 and the modified qubit transformation U(<ptk+V) 360 on the manifold, for example, by maximising the size of Tr{C / (< / ?<:fe+1))tV}, i.e. using a line search (e.g. golden section line search) on the magnitude of the step change vector.
[0075] Therefore, as shown in Figure 3D, starting with an initial qubit transformation 310 and a target qubit transformation 330, it is possible to identify a step change 350 in the parameters which results in a modified qubit transformation 360 that closely follows the geodesic 320 between the initial qubit transformation 310 and the target qubit transformation 330. This process may be iteratively repeated until a stop condition is reached. In iteratively repeating the method, the modified qubit transformation U(<p(k+^) 360 after the first iteration is set as the initial qubit transformation, a new geodesic 321 is calculated between U(<p(k+^) 360 and the target qubit transformation 330, directional derivatives are calculated at U(<p(k+^) 360, a new step change 8<p(k+V is calculated, and a new modified qubit transformation U((p^k+2^) is determined with new parameter values <p(k+2\ This process may repeat until a stop condition is reached. In some cases, the stop condition may be reached after only one iteration (i.e. the process does not repeat), however in other cases the stop condition may be reached after any number of iterations.
[0076] One example of a stop condition is that the modified qubit transformation obtained in that iteration is adequately close to the target qubit transformation. That is, after each iteration in the process the infidelity (i.e. difference) between the target qubit transformation 330 and modified qubit transformation may be determined, and if the infidelity is above a predetermined threshold the process continues for another iteration. However, if the infidelity is below the predetermined threshold the process ends and the modified qubit transformation is output as a final modified qubit transformation. Alternatively, the fidelity (i.e. closeness) of the target qubit transformation 330 and modified qubit transformation may be calculated and used in an analogous way to the infidelity, such that the process continues for another iteration if the fidelity is above a predetermined threshold, and the process ends if the fidelity is below the predetermined threshold. The predetermined threshold(s) described above may be predefined, such as by a user or by other means. In addition, it is possible that the modified qubit transformation may be adequately close to the target qubit transformation after only one iteration (i.e. the process does not repeat), however in other cases the stop condition may be reached after any number of iterations. Furthermore, it should be appreciated that the above are just examples of stop conditions, and that the method may be used with different stop conditions, such as a set or maximum number of iterations, where the set or maximum number of iterations may be substantially any number which may be set by a user or determined in substantially any other manner. For example, the process may continue to iterate either until the infidelity or fidelity between the target qubit transformation and modified qubit transformation reach their respective predetermined thresholds, or until a maximum number of iterations has been reached.
[0077] In using the techniques described above, an arbitrary qubit transformation can be modified to approximate (or in some cases reach) a target qubit transformation, and the values for a set of parameters for the qubit transformation can be obtained. These parameter values relate to hardware qubit interactions with a physical qubit, and as such the hardware parameters for a quantum computer for executing the target qubit transformation (or an approximation thereof) can be obtained. In this way, the quantum computer may implement the target qubit transformation using the parameters, despite the values of the parameters not being predefined.
[0078] Furthermore, by following the geodesic in updating the values of the parameters, the target qubit transformation can be closely approximated, such that the target qubit interaction can be accurately executed on a quantum computer. In addition, said approximation can be reached in a small number of iterations, such that compiling of quantum circuits including the target qubit transformation can be performed quickly.
[0079] In some cases, the approaches described herein can result in a qubit transformation that exists in a local minima. That is, the described process may result in a modified qubit transformation that has an infidelity with the target qubit transformation that is above the predetermined threshold, but where any sized step change in the parameters increases the infidelity between the qubit transformation and the target qubit transformation. Accordingly, a number of approaches may be taken in order to move the qubit transformation away from the local minima. As one example, a relocation vector that is orthogonal to the geodesic may be generated and used for the step change in the parameter. An example of this approach is to use a Gram-Schmidt procedure, using the following equation: (k> ||y(m)||2^ (12)
[0080] where 8<p^ is the step change vector, rK is a random vector (within the reduced parameter set), and y® is the geodesic vector (e.g. defined in Equation 8). The size of the step change vector may be a predetermined value, or may be predefined, for example by a user, or by an external entity. In some cases, if the qubit transformation arrives in the same local minima multiple times (for example through comparison of present and past qubit transformation), the size of the step change vector in this process may be increased with each arrival at the local minima.
[0081] Alternatively, in some cases, instead of generating a particular step change to escape the local minima, the values of the set of parameters may be re-initialised to different values, and the process restarted. The re-initialised parameter values may be randomly generated, may be a different set of predetermined parameter values, or an indication of the re-initialised parameter values may be received from a user or an external entity.
[0082] The geodesic-based approach according to the present disclosure has been tested to verify its effectiveness. As an example, the geodesic-based approach according to the present disclosure has been used to identify parameters which approximate Toffoli and Fredkin (controlled SWAP) gates with an infidelity of less than 0.001, with 1000 random initializations of the parameters. The geodesic-based approach identified a solution for the Toffoli gate with a mean of 3.2 iterations. By way of comparison, a stochastic gradient descent approach identified a solution for the Toffoli gate with a mean of 13.6 iterations, and a simple gradient descent approach identified a solution for the Toffoli gate with a mean of 80.9 iterations. Similarly, the geodesic-based approach identified a solution for the Fredkin gate with a mean of 7.6 iterations. By way of comparison, a stochastic gradient descent approach identified a solution for the Fredkin gate with a mean of 21.4 iterations, and a simple gradient descent approach identified a solution for the Fredkin gate with a mean of 85.8 iterations.
[0083] Furthermore, the effectiveness of the geodesic-based approach according to the present disclosure in generating unitary gates corresponding to weighted X and weighted Z parity checks (used in some quantum error-correction codes) has been tested. A parity check gate of size k involves k + 1 qubits. For a weighted X parity check of size 2, the geodesicbased approach according to the present disclosure finds solutions having an infidelity of 0.001 in approximately 11.0 iterations; for a weighted X parity check of size 3, the geodesicbased approach according to the present disclosure finds solutions having an infidelity of 0.001 in approximately 98.3 iterations, and for a weighted X parity check of size 4, the geodesic-based approach according to the present disclosure finds solutions having an infidelity of 0.001 in approximately 2320.6 iterations. Furthermore, for a weighted X parity check of size 5 is capable of finding a solution having an infidelity of 0.001 after approximately 3 x 104 iterations.
[0084] Similarly, for a weighted Z parity check of size 2, the geodesic-based approach according to the present disclosure finds solutions having an infidelity of 0.001 in approximately 40.4 iterations; for a weighted Z parity check of size 3, the geodesic-based approach according to the present disclosure finds solutions having an infidelity of 0.001 in approximately 123.6 iterations, and for a weighted Z parity check of size 4, the geodesic-based approach according to the present disclosure finds solutions having an infidelity of 0.001 in approximately 1555.2 iterations. Furthermore, for a weighted Z parity check of size 5 is capable of finding a solution having an infidelity of 0.001 after approximately 3 x 104 iterations. In contrast, unitary gates corresponding to weighted X and weighted Z parity checks are not generally producible with this level of infidelity (0.001) using stochastic gradient descent approaches or simple gradient descent approaches unless the commutator ansatz is used or the number of qubits is 4 or fewer. Moreover, stochastic gradient descent approaches and simple gradient descent approaches are generally considered unsuitable or unable to approximate non-trivial quantum gates with more than 4 qubits.
[0085] Figure 4 shows an illustrative computing system 400 for carrying out examples of the present disclosure. The computing system 400 includes a computing device 410 comprising one or more processors 440 and one or more memories 450. The computing device 410 receives an indication of the available qubit interactions 460 for a quantum computer 490, for example via one or more Input and / or Output (I / O) devices, or a network interface. An initial transformation generator 420 of the computing device 410 may utilise the indication of the available qubit interactions 460 in generating an initial qubit transformation as a function of a set of parameters having particular parameter values. In particular, the set of parameters may correspond to parameters (e.g. a strength) for the available qubit interactions 460. The initial transformation generator 420 may set values for each parameter of the set of parameters in a number of different ways. For example, the values of one or more of the parameters may be set randomly, or the values of one or more of the parameters may be predefined, set by a user, or received from an external entity.
[0086] The computing device 410 also includes a transformation update module 430 configured to identify a modified qubit transformation based on a geodesic between the initial qubit interaction (e.g. generated by the initial transformation generator) and a target qubit transformation 470. The one or more processors 440 and one or more memories 450 are configured to implement the initial transformation generator 420 and transformation update module 430 of the computing device 410.
[0087] The computing device 410 receives an indication of the target qubit transformation 470, for example via one or more Input and / or Output (I / O) devices, or a network interface. A geodesic calculator 410 of the transformation update module 430 utilises the target qubit transformation 470 and the initial qubit transformation to calculate the geodesic on the manifold between the target qubit transformation 470 and the initial qubit transformation. An example of one approach for calculating the geodesic is discussed in relation to Figure 3A above, however it should be appreciated that the techniques of the present disclosure are compatible with other techniques for calculating the geodesic. For a point on the manifold corresponding to the initial qubit interaction, a derivative calculator 432 of the transformation update module 430 calculates a directional derivative for each parameter of the set of parameters. An example of one approach for calculating the directional derivatives is discussed in relation to Figure 3B, however it should be appreciated that the techniques of the present disclosure are compatible with other techniques for calculating the directional derivatives.
[0088] A parameter change calculator 433 of the transformation update module 430 determines, based on the geodesic and the directional derivatives of the parameters, a step change in the values of the parameters. In some cases, the parameter change calculator 433 may include a direction calculator 434 configured to calculate a direction of a parameter step change vector, and a size calculator 435 configured to calculate a size of the parameter step change in the direction of the parameter step change vector. Alternatively, in some examples the direction and size of the step change may be calculated concurrently by the parameter change calculator 433. An example of one approach for determining the step change based on the geodesic is discussed in relation to Figure 3C above, however it should be appreciated that the techniques of the present disclosure are compatible with other techniques for determining the step change based on the geodesic.
[0089] A transformation modifier 436 of the transformation update module 430 modifies the initial qubit transformation based on the step change determined by the parameter change calculator 433 to determine a modified qubit transformation. An example of one approach for modifying the initial qubit transformation is discussed in relation to Figure 3D above, however it should be appreciated that the techniques of the present disclosure are compatible with other techniques for determining the step change based on the geodesic.
[0090] After the transformation modifier 436 has determined the modified qubit transformation, a final transformation identifier 437 of the transformation update module 430 may determine whether the modified qubit transformation is a final qubit transformation. In particular, the final transformation identifier 437 may determine whether a stop condition has been reached. For example, a stop condition may be reached if the infidelity between the modified qubit transformation and the target qubit transformation is below a predetermined threshold. A stop condition may also or alternatively be reached if a predetermined number of iterations have been performed. If the final transformation identifier 437 determines that a stop condition has not been reached, the modified qubit transformation is passed to the geodesic calculator 431 for the transformation update module 430 to perform another iteration of the process. In particular, the geodesic calculator 431 utilises the modified qubit transformation output by the transformation modifier as an initial qubit transformation for calculating the geodesic as already described. In addition, an example for one approach for iterating the above-described process is discussed in relation to Figure 3D, however it should be appreciated that the techniques of the present disclosure are compatible with other techniques for iteratively repeating the method.
[0091] If the final transformation identifier 437 determines that a stop condition has been reached, the modified qubit transformation output by the transformation modifier 436 is identified as a final qubit transformation by the final transformation identifier 437. The transformation update module 430 may therefore output an indication of the final qubit transformation and / or an indication of the parameter values associated with the final qubit transformation. For example, the indication of the final qubit transformation and / or parameter values associated with the final qubit transformation may be output to a hardware instruction generator 480. The hardware instruction generator 480 may convert the parameter values associated with the final qubit transformation into hardware parameter values associated with a quantum computer (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. Alternatively, in some cases the computing device 410 may convert the parameter values associated with the final qubit transformation into the hardware parameter values, and the hardware instruction generator 480 may receive the hardware parameter values from the computing device 410.
[0092] The hardware instruction generator 480 may then use the hardware parameter values to determine a set of physical operations to be carried out by qubit interaction hardware of the quantum computer 490 in order to execute the target qubit transformation. The hardware instruction generator 480 may then output the set of physical operations to the quantum computer 490 to cause the quantum computer 490 to execute the target qubit transformation (or a close approximation thereof). Furthermore, while Figure 4 shows the hardware instruction generator 480 as being external to the computing device 410, in some cases the hardware instruction generator 480 may be included in the computing device 410 such that the computing device 410 may output the set of physical operations to the quantum computer 490.
[0093] The computing device 410 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 410 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 quantum gate acting on a large number of qubits (for example, three or more qubits) which 20 RECTIFIED SHEET (RULE 91) ISA / EP may be received as part of a quantum circuit to be compiled. An example is shown in Figure 5, which depicts a quantum gate 510 acting on 7 qubits qo-qe as part of a first quantum circuit 500a. The geodesic-based techniques according to the present disclosure may be used to determine parameters for the 7-qubit quantum gate 510 to be implemented by a quantum computer.
[0094] In some cases the 7-qubit quantum gate 510 may not be directly implementable on a particular quantum computer. For example, if a predetermined maximum number of iterations has been reached the infidelity between the quantum gate 510 and the qubit transformation identified by the geodesic-based approaches according to the present disclosure is above a predetermined threshold, the program may determine that the quantum gate 510 may not be directly implementable on the particular quantum computer.
[0095] As such, the 7-qubit quantum gate 510 may be decomposed, for example using conventional compiling techniques, into smaller quantum gates 520 as a second quantum circuit 500b. Figure 5 shows three quantum gates 520a-c in the second quantum circuit 500b: a first quantum gate 520a acting on qubits q2-qe, a second quantum gate 520b acting on qubits qo-q2, and a third quantum gate 520b acting on qubits q2-qe. The geodesic-based techniques according to the present disclosure may then be used on each of these quantum gates 520. If any of the quantum gates 520 are determined to not be implementable on the particular quantum computer, then those particular gates may be further decomposed into smaller quantum gates using conventional compiling techniques.
[0096] Furthermore, the techniques disclosed herein may be used in combining multiple quantum gates with one another to form a larger or more complex quantum gate. For example, Figure 6 shows a quantum circuit 600a including a plurality of quantum gates 610a-610o. The quantum gates 610 are one or two qubit quantum gates which, for example, may have been generated by a quantum compiler, or by any other means. The geodesic based approached may be used to combine multiple ones of these quantum gates 610 to form larger quantum gates 620. For example, the combination of multiple ones of these quantum gates 610 may first be calculated mathematically to form quantum gates 620a-e. The quantum gates to be combined may be chosen in substantially anyway, provided the logical operation(s) provided by the quantum circuit remains unchanged, to generate a second quantum circuit 600b. In other words, a target quantum circuit corresponding to a plurality of base quantum gates may be identified, and a particular target qubit transformation may be identified by selecting two or more of the plurality of base quantum gates of the target quantum circuit and calculating a combination of the two or more base quantum gates as the target qubit transformation.
[0097] The geodesic-based approaches according to the present disclosure may then be used on each of the quantum gates 620 of the second quantum circuit 600b to determine if the individual gates 620a-e can be executed on a particular quantum computer as a single gate. If any of the quantum gates 620 are determined to not be implementable on the particular quantum computer, then those gates may be decomposed, and a different combination(s) of either the sub-gates in said gate or the quantum circuit as a whole may be generated and tested using the geodesic-based methods disclosed herein.
[0098] In some cases, if the individual gates 620a-e are implementable on the particular quantum computer as a single gate, the combination of multiple ones of quantum gates 620 may be calculated to form quantum gates 630a-c in a third quantum circuit 600c. For example, gates 620b and 620d may be combined to form gate 630a. The geodesic-based approaches according to the present disclosure may then be used on each of the quantum gates 630 of the third quantum circuit 600c to determine if the individual gates 630a-c can be executed on a particular quantum computer as a single gate. This process may continue until no further combining of gates is possible. When repeating the process for gates 630, the initial qubit transformation may be determined in any of the ways described previously, or the initial qubit interaction may be the final qubit interaction output from using the geodesic-based approaches described herein for constituent gates.
[0099] These approaches discussed in relation to Figured 5 and 6 maximise the size of quantum gates executed by a quantum computer, thereby reducing the number of hardware interactions with the qubits of a quantum computer. This reduces the amount of errors produced in the quantum computer and therefore increases the possible depth of the quantum circuit, and can reduce the number of qubits required to execute a particular quantum circuit.
[00100] Figure 7 illustrates an example method for a geodesic-based approach for approximating a target qubit transformation. The method according to Figure 7 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.
[00101] The method includes a step 710 of identifying a target qubit transformation. This may include receiving a user input indicating the target qubit transformation or from an external entity. Furthermore, in some cases the method may include identifying a target quantum circuit comprising a plurality of base quantum gates and the target qubit transformation may be identified by selecting two or more of the plurality of base quantum gates (e.g. qubit interactions acting on at most one qubit, or at most two qubits, or specific quantum gates which are known to be implementable on the quantum computer with a single qubit interaction) of the target quantum circuit and calculating a combination of the two or more base quantum gates as the target qubit transformation. The target quantum circuit may be indicated in a user input or received from an external entity.
[00102] At step 720 the method identifies an initial qubit transformation. In particular, the initial qubit transformation may be identified in terms of particular values for a set of parameters. The initial qubit transformation may be identified in a number of ways. For example, the parameter values may be generated randomly, indicated by a user input, predefined, or received from an external entity. In addition, the method may include determining the set of parameters. For example, a restricted parameter set may be identified which includes only parameters corresponding to qubit interactions which are physically realisable in a particular quantum computer. The initial qubit transformation may then be identified in terms of the restricted parameter set. The restricted parameter set and / or the qubit interactions which are physically realisable in the particular quantum computer may be predefined, indicated in a user input, or received from an external entity. The method may also include determining possible values for each of the set of parameters. The possible values may be determined in a number of ways, for example, the possible values may be indicated by a user input, predefined, or received from an external entity. It should also be noted that steps 710 and 720 may be executed in any order.
[00103] The method then includes step 730 where a geodesic is calculated between the target qubit transformation and the initial qubit transformation. Both the target qubit transformation and the initial qubit transformation exist mathematically on a manifold (e.g. the manifold of the special unitary group of degree N (Sll(N), which includes all N x N unitary matrices with determinant 1 and having dimension N2 - 1), and the geodesic calculated also exists on this manifold. The method additionally includes step 740 of, for a point on the manifold corresponding to the initial qubit transformation, calculating a directional derivative for each parameter of the set of parameters. It should be noted that steps 730 and 740 may be executed in any order.
[00104] Then the method includes, at step 750, using the directional derivatives and the geodesic to determine a step change in one or more of the parameter values of the initial qubit transformation. In particular, the step change may be determined to follow the geodesic. For example, the step change may follow the geodesic as closely as possible or within a predefined infidelity between a modified qubit transformation including modified parameter values (modified with the step change) and the geodesic. Determining the step change may include determining a direction of the step change on the manifold, and determining a size of the step change on the manifold. For example, determining the direction of the step change may include determining the direction of the step change to be a direction that most closely follows the geodesic. The direction of the step change may be determined as a linear combination of the directional derivatives of the parameters, and in some cases may be determined using a convex optimization process. Furthermore, determining the size of the step change may comprise determining the size of the step change which minimises an infidelity between a modified qubit transformation including modified parameter values (modified with the step change) and the target qubit transformation. For example, the size of the step change may be determined through a line search.
[00105] In some cases, the method may determine that the initial qubit transformation is at a local minimum and, based on determining that the initial qubit transformation is at the local minimum, determining the step change based on a relocation vector. It may be determined that the initial qubit transformation is at the local minimum for example by determining that any size step change (within a threshold step change size) results in an increase in the infidelity between the target qubit transformation and the modified qubit transformation. Furthermore, the relocation vector may in some cases be a randomly generated vector. The relocation vector may be used to determine a step change direction which is orthogonal to the geodesic, for example using a Gram-Schmidt process. The size of the orthogonal step change may be predetermined, defined by a user, or determined in any other way, such as through an iterative increase until the local minimum is escaped.
[00106] At step 760 the method modifies the initial qubit transformation to determine a modified qubit transformation. It should be noted that this step may be performed as part of the process of determining the step change in the parameter values in step 750, or may be performed separate from step 750. The method may then determine, at step 770, whether a stop condition for the method has been reached. Various stop conditions may be used. One example is whether the infidelity between the target qubit transformation and the modified qubit transformation is below a predetermined threshold. The threshold infidelity may be predetermined in a number of ways, for example the threshold may be predefined, indicated by a user, or received from an external entity. Another example of a stop condition is whether a number of iterations of the method has reached or exceeded a threshold number of iterations. The threshold number of iterations may be predetermined in a number of ways, for example the threshold may be predefined, indicated by a user, or received from an external entity.
[00107] If at step 770 a stop condition has not been reached, the method may proceed to step 780, where the modified qubit transformation resulting from step 760 is set as the initial qubit transformation, and steps 720-770 are repeated. This process may continue iteratively until a stop condition is reached at step 770. When a stop condition is reached, the modified qubit transformation of the last iteration may be set or identified as a final qubit transformation. At step 790 the final qubit transformation may be output as a result of the method. Additionally or alternatively, the parameter values associated with the final qubit transformation may be output as a result of the method. In some cases, the method may additionally include converting the parameter values associated with the final qubit transformation to values for hardware parameters associated with qubit interaction hardware. Regardless of form, the output of the method may in some cases be output to an external entity (for example over a network), or to an output device. The output may also be output to a quantum computer (e.g. a controller for a quantum computer), and / or to an entity configured to convert parameter values into hardware instructions for a quantum computer.
[00108] The method described in relation to Figure 7 may also be embodied or encoded in a computer-readable medium, such as a computer-readable storage medium, containing instructions. Instructions embedded or encoded in a computer-readable medium may cause a programmable processor, or other processor, to perform the method, e.g., when the instructions are executed. Computer-readable media may include non-transitory computer-readable storage media and transient communication media. Computer readable storage media, which is tangible and non-transitory, may include random access memory (RAM), read only memory (ROM), programmable read only memory (PROM), erasable programmable read only memory (EPROM), electronically erasable programmable read only memory (EEPROM), flash memory, a hard disk, a CD-ROM, a floppy disk, a cassette, magnetic media, optical media, or other computer-readable storage media. The term “computer-readable storage media” refers to physical storage media, 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.
[00109] Accordingly, from one perspective there has been described a computer-implemented method, system and computer-readable medium for compiling a quantum circuit. The geodesic is calculated between a target qubit transformation and a parameterised initial qubit transformation. The parameters of the initial qubit transformation are iteratively updated to follow the geodesic to closely approximate the target qubit transformation.
Claims
1. A computer-implemented method for compiling a quantum circuit, the method comprising:identifying a target qubit transformation (330) for a plurality of qubits in a quantum circuit;identifying an initial qubit transformation (310) for the plurality of qubits as a function of a set of parameters having particular parameter values, the set of parameters corresponding to parameters for one or more available qubit interactions for one or more of the plurality of qubits, wherein the target qubit transformation (330) and initial qubit transformation (310) exist on a manifold (300) of qubit transformations;identifying a modified qubit transformation (360) based on a geodesic (320) between the initial qubit transformation (330) and the target qubit transformation (330), wherein identifying the modified qubit transformation (360) comprises:calculating the geodesic (320) on the manifold (300) between the target qubit transformation (330) and the initial qubit transformation (310),for a point on the manifold (300) corresponding to the initial qubit transformation (310), calculating a directional derivative (340) for each parameter of the set of parameters,based on the geodesic (320) and the directional derivatives (340) of the parameters, determining a step change (350) in the parameter values of the initial qubit transformation (310), andbased on the determined step change (350), modifying the initial qubit transformation (310) to determine the modified qubit transformation (360);identifying the modified qubit transformation (360) as a final qubit transformation, wherein the final qubit transformation corresponds to final values of the set of parameters .
2. The method according to claim 1, further comprising:identifying a target quantum circuit comprising a plurality of base quantum gates; andwherein identifying the target qubit transformation (330) comprises:selecting two or more of the plurality of base quantum gates of the target quantum circuit;calculating a combination of the two or more base quantum gates as the target qubit transformation (330).
3. The method according to claim 2, wherein the base quantum gates are quantum gates acting on two or fewer qubits.
4. The method according to any preceding claim, wherein modifying the initial qubit transformation (310) comprises modifying one or more of the parameter values of the initial transformation (310) according to the determined step change (350).
5. The method according to any preceding claim, comprising identifying the final qubit transformation iteratively, wherein a modified qubit transformation for a particular iteration is identified as a subsequent initial qubit transformation for a subsequent iteration, wherein the identifying of the modified qubit transformation is performed iteratively until a particular modified qubit transformation is identified as the final qubit transformation.
6. The method according to any preceding claim, wherein the modified qubit transformation is identified as the final qubit transformation based on an infidelity between the modified qubit transformation (360) and the target qubit transformation (330) being below a predefined threshold.
7. The method according to any preceding claim, wherein determining the step change (350) in the parameter values comprises:determining a direction of the step change (350) on the manifold (300); anddetermining a size of the step change (350) on the manifold (300).
8. The method according to claim 7, wherein determining the direction of the step change (350) comprises determining the direction of the step change (350) to be a direction that most closely follows the geodesic (320).
9. The method according to claim 8, wherein the direction of the step change (350) is determined as a linear combination of the directional derivatives (340) of the parameters.
10. The method according to claim 9, wherein the direction of the step change (350) is determined using a convex optimisation process.
11. The method according to any of claims 5-10, wherein determining the size of the step change (350) comprises determining the size of the step change (350) through a line search.
12. The method according to any of claims 7-11, further comprising:determining that the initial qubit transformation (310) is at a local minimum;based on determining that the initial qubit transformation (310) is at the local minimum, determining the step change (350) based on a relocation vector (355).
13. The method according to claim 12, wherein determining the step change (350) comprises setting the step change (350) to be orthogonal to the geodesic (320).
14. The method according to any of claims 12-13, further comprising generating the relocation vector (355) randomly.
15. The method according to any of claims 12-14, wherein determining that the initial qubit transformation (310) is at the local minimum is based on determining a first fidelity between the initial qubit transformation (310) and the target qubit transformation (330) is greater than or equal to a second fidelity between the modified qubit transformation (360) and the target qubit transformation (330).
16. The method according to any preceding claim, further comprising:receiving an indication of the set of parameters.
17. The method according to any preceding claim, further comprising:receiving an indication of possible values for each of the set of parameters.
18. The method according to any preceding claim, wherein the available qubit interactions are known physically realisable qubit interactions.
19. The method according to any preceding claim, wherein the target qubit transformation (330) is a first target qubit transformation, and the initial qubit transformation (310) is a first initial qubit transformation, and the modified qubit interaction (360) is a first modified qubit interaction, and wherein the method further comprises:identifying a second target qubit transformation by calculating a result of the first target qubit transformation and one or more other qubit interactions;identifying a second initial qubit transformation;identifying a second modified qubit transformation based on a geodesic between the second initial qubit transformation and the second target qubit transformation.
20. The method according to any preceding claim, further comprising outputting the final qubit transformation.
21. The method according to any preceding claim, further comprising outputting the values for the parameters for the one or more available qubit interactions for the one or more qubits corresponding to the final values of the set of parameters.
22. The method according to claim 21, wherein the values for the parameters for the one or more available qubit interactions for the one or more qubits are output to a controller for an apparatus configured to carry out the one or more available qubit interactions.
23. The method according to any preceding claim, further comprising outputting the final values for the set of parameters, the final parameter values being the values of the set of parameters associated with the final qubit transformation.
24. A system comprising:a memory; andone or more processors configured to carry out the method according to any preceding claim.
25. 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-23.