This disclosure relates to compiling quantum computing program specifications based on quantum operations.
A quantum computer can be used to perform classically challenging computational tasks. A quantum compiler is able to translate a desired computational task expressed in a higher-level program specification into a lower-level compiled specification that includes information (e.g., about particular quantum gates) that can be used to configure a particular type of quantum computer to perform the computational task, possibly in conjunction with a classical computer and classical operations.
In one aspect, in general, a method for compiling a program specification that comprises at least one quantum circuit associated with both a set of quantum operations and a first schedule for the set of quantum operations comprises: assigning each quantum operation in the set of quantum operations to a first passed set, a first caught set, or a first blocked set, based at least in part on one or more of the first schedule, types of the quantum operations, or qubits addressed by the quantum operations, wherein the first blocked set includes a first quantum operation that addresses one or more qubits that are addressed by at least one quantum operation in the first caught set; determining a first passed set ordering based at least in part on one or both of the first schedule or the qubits addressed by the quantum operations; determining a first caught set ordering based at least in part on one or both of the first schedule or the qubits addressed by the quantum operations; and determining a second schedule for the set of quantum operations, the determining comprising: assigning the quantum operations in the first caught set to be performed after the quantum operations in the first passed set, and assigning the quantum operations in the first blocked set to be performed after the quantum operations in the first caught set.
Aspects can include one or more of the following features.
The method further comprises assigning each quantum operation in the first blocked set to a second passed set, a second caught set, or a second blocked set, based at least in part on one or more of the first schedule, types of the quantum operations, or qubits addressed by the quantum operations, where the second blocked set includes at least one quantum operation that addresses one or more qubits that are addressed by at least one quantum operation in the second caught set.
The method further comprises determining a second passed set ordering based at least in part on one or both of the first schedule or the qubits addressed by the quantum operations, and determining a second caught set ordering based at least in part on one or both of the first schedule or the qubits addressed by the quantum operations.
Each quantum operation in the second caught set is a unitary single-qubit quantum operation.
Each quantum operation in the second passed set is a multi-qubit quantum operation that operates on two or more qubits.
The determining of the second schedule for the set of quantum operations further comprises: assigning the quantum operations in the second caught set to be performed after the quantum operations in the second passed set, and assigning the quantum operations in the second blocked set to be performed after the quantum operations in the second caught set.
The first blocked set comprises a plurality of quantum operations, and each remaining quantum operation other than the first quantum operation in the first blocked set addresses one or more qubits that are addressed by at least one quantum operation in the first caught set or the first blocked set other than that remaining quantum operation.
The method further comprises generating a first graph-based representation based at least in part on the program specification.
The first graph-based representation is a directed acyclic graph.
The method further comprises comprising generating respective graph-based representations for the first passed set, the first caught set, and the first blocked set.
The respective graph-based representation associated with the first caught set contains no edges.
Each quantum operation in the first caught set is a unitary single-qubit quantum operation.
Each quantum operation in the first passed set is a multi-qubit quantum operation that operates on two or more qubits.
The set of quantum operations comprises non-unitary quantum operations.
The quantum circuit is associated with binary information.
At least a portion of the binary information is associated with outcomes from qubit measurements.
One or more of the quantum operations in the set of quantum operations depends on the binary information.
The first caught set comprises one or more unitary single-qubit quantum operations that depend on the binary information.
The first passed set comprises one or more non-unitary quantum operations that depend on the binary information.
The at least one quantum circuit is associated with classical operations.
In another aspect, in general, a method for compiling a program specification comprises: receiving the program specification that includes at least one quantum circuit associated with a first set of quantum operations; and generating a compiled program specification, wherein the compiled program specification performs the same computational task as the received program specification, the generating comprising: calculating a respective set of quantum operations and a respective set of rotation angles for each quantum operation in the first set of quantum operations, and determining at least one global quantum operation and at least one inverse of the global quantum operation, wherein the calculating is based at least in part on the first set of quantum operations, the global quantum operation, and the inverse of the global operation.
Aspects can include one or more of the following features.
The determining further comprises: combining a first quantum operation and a second quantum operation in a second set of quantum operations within the set of quantum operations calculated for each quantum operation in the first set of quantum operations, the first quantum operation and the second quantum operation each comprising at least one angle of rotation about an axis common to the first and second quantum operations, into one or more quantum operations in a third set of quantum operations, the combining comprising geometrically adding the angles of rotation of the first and second quantum operations about the common axis to calculate a combined angle of rotation.
The third set of quantum operations contains fewer quantum operations than the second set of quantum operations.
At least one global quantum operation and at least one inverse of the global quantum operation are scheduled to execute between the execution of the first quantum operation and the second quantum operation in the second set of quantum operations.
A magnitude of an angle of rotation of the first global quantum operation is equal to half of an angle of rotation specified by a quantum operation in the received program specification.
The at least one quantum circuit is associated with a second set of quantum operations.
The method further comprises calculating a respective set of quantum operations and a respective set of rotation angles for each quantum operation in the second set of quantum operations.
The calculated set of quantum operations for each quantum operation in the second set of quantum operations comprises at least one of the quantum operations in the second set of quantum operations.
The calculated set of quantum operations for each quantum operation in the second set of quantum operations comprises a second global quantum operation and an inverse of the second global quantum operation.
The second global quantum operation and the inverse of the second global quantum operation each perform a quantum rotation with angles of rotation that are approximately equal in magnitude and that are each less than pi/2 radians in magnitude.
The calculated set of rotation angles for two or more of the quantum operations in the first set of quantum operations are calculated to reduce the total number of quantum operations performed.
The calculated set of rotation angles for two or more of the quantum operation in the first set of quantum operations are calculated to reduce the sum of the magnitudes of the rotations performed by the single-qubit quantum operations.
The at least one quantum circuit is associated with binary information.
At least a portion of the binary information is associated with outcomes from measurements of one or more qubits associated with the at least one quantum circuit.
One or more of the quantum operations in the first set of quantum operations depends on the binary information.
The at least one quantum circuit is associated with classical operations.
In another aspect, in general, a method for compiling a program specification comprises: receiving the program specification that includes at least one quantum circuit associated with a first set of quantum operations, the first set of quantum operations comprising a first quantum operation; and decomposing the first quantum operation into a second set of quantum operations, the second set of quantum operations comprising one or more single-qubit quantum operations, a first global quantum operation, and an inverse of the first global quantum operation; wherein the first global quantum operation and the inverse of the first global operation each perform a quantum rotation with angles of rotation that are approximately equal in magnitude and that are each less than pi/2 radians in magnitude.
Aspects can include one or more of the following features.
The magnitude of the angle of rotation of the first global quantum operation is equal to half of an angle of rotation specified by the first quantum operation.
A second quantum operation in the first set of quantum operations is decomposed into a third set of quantum operations, the third set of quantum operations comprising a second global quantum operation and an inverse of the second global quantum operation.
The second global quantum operation and the inverse of the second global quantum operation each perform a quantum rotation with angles of rotation that are approximately equal in magnitude and that are each less than pi/2 radians in magnitude.
The method further comprises choosing a set of angles used as parameters for the one or more single-qubit quantum operations.
The set of angles are chosen to reduce the total number of quantum operations performed.
The set of angles are chosen to reduce the sum of the magnitudes of the rotations performed by the single-qubit quantum operations.
The determining further comprises: combining a third quantum operation and a fourth quantum operation in a fourth set of quantum operations, the third quantum operation and the fourth quantum operation each comprising at least one angle of rotation about an axis common to the third and fourth quantum operations, into one or more quantum operations in a fifth set of quantum operations, the combining comprising geometrically adding the angles of rotation of the third and fourth quantum operations about the common axis to calculate a combined angle of rotation.
The fifth set of quantum operations contains fewer quantum operations than the fourth set of quantum operations.
At least one global quantum operation and at least one inverse of the global quantum operation are scheduled to execute between the execution of the third quantum operation and the fourth quantum operation.
The at least one quantum circuit is associated with binary information.
At least a portion of the binary information is associated with outcomes from qubit measurements.
One or more of the quantum operations in the first set of quantum operations depends on the binary information.
In another aspect, in general, a method for compiling a program specification that comprises at least one quantum circuit associated with both a first set of quantum operations and a first schedule for the first set of quantum operations comprises: assigning each quantum operation in the first set of quantum operations to either (1) one passed set from a set of one or more passed sets or (2) one caught set from a set of one or more caught sets, based at least in part on one or more of the first schedule, types of the quantum operations, or qubits addressed by the quantum operations; and decomposing two or more quantum operations in a first caught set of the one or more caught sets into a second set of quantum operations, the second set of quantum operations comprising one or more single-qubit quantum operations, a first global quantum operation, and an inverse of the first global quantum operation.
Aspects can include one or more of the following features.
The method further comprises, after the assigning, determining a second schedule for the first set of quantum operations.
Determining the second schedule comprises: determining a first passed set ordering based at least in part on one or both of the first schedule or the qubits addressed by the first set of quantum operations, and determining a first caught set ordering based at least in part on one or both of the first schedule or the qubits addressed by the first set of quantum operations.
Determining the second schedule comprises: assigning quantum operations in the first caught set to be performed after quantum operations in a first passed set, and assigning quantum operations in a second passed set to be performed after quantum operations in the first caught set.
Each quantum operation in the one or more caught sets is a single-qubit quantum operation.
Each quantum operation in the one or more passed sets is a multi-qubit quantum operation that operates on two or more qubits.
The method further comprises decomposing two or more quantum operations in a second caught set of the one or more caught sets into a third set of quantum operations, the third set of quantum operations comprising one or more single-qubit quantum operations, a second global quantum operation, and an inverse of the second global quantum operation.
The method further comprises determining a third schedule comprising the first set of quantum operations, the second set of quantum operations, and the third set of quantum operations, excluding quantum operations that were decomposed into the second set of quantum operations or that were decomposed into the third set of quantum operations.
The method further comprises generating a first graph-based representation based at least in part on the program specification.
The first graph-based representation is a directed acyclic graph.
The method further comprises generating respective graph-based representations for at least one of the one or more passed sets and at least one of the one or more caught sets.
The respective graph-based representation associated at least one of the one or more caught sets contains no edges.
The first set of quantum operations comprises non-unitary quantum operations.
The at least one quantum circuit is associated with binary information.
At least a portion of the binary information is associated with outcomes from qubit measurements.
One or more of the quantum operations in the first set of quantum operations depends on the binary information.
At least of the one or more caught sets comprise one or more unitary single-qubit quantum operations that depend on the binary information.
The at least one of the one or more passed sets comprise one or more non-unitary quantum operations that depend on the binary information.
The at least one quantum circuit is associated with classical operations.
In another aspect, in general, an apparatus for compiling a program specification comprises: a digital computer comprising at least one central processing unit, the digital computer configured to: process information based on at least one quantum circuit associated with both a first set of quantum operations and a first schedule for the first set of quantum operations, and provide a compiled quantum program; memory storing the compiled quantum program; a quantum computer comprising a plurality of quantum processing elements associated with respective quantum states, and configured to apply coupling and transformation operations to a plurality of the quantum states according to the compiled quantum program; where the processing comprises: assigning each quantum operation in the first set of quantum operations to either (1) one passed set from a set of one or more passed sets or (2) one caught set from a set of one or more caught sets, based at least in part on one or more of the first schedule, types of the quantum operations, or qubits addressed by the quantum operations, and decomposing two or more quantum operations in a first caught set of the one or more caught sets into a second set of quantum operations, the second set of quantum operations comprising one or more single-qubit quantum operations, a first global quantum operation, and an inverse of the first global quantum operation.
Aspects can include one or more of the following features.
Each quantum operation in the caught sets is a unitary single-qubit quantum operation.
Each quantum operation in the passed sets is a multi-qubit quantum operation that operates on two or more qubits.
The plurality of quantum processing elements are neutral atoms or trapped ions.
The quantum computer further comprises a microwave source configured to perform the first global quantum operation and the inverse of the first global quantum operation.
The quantum computer further comprises a laser source configured to perform the one or more single-qubit quantum operations.
The first global quantum operation and the inverse of the first global operation each perform a quantum rotation with angles of rotation that are approximately equal in magnitude and that are each less than pi/2 radians in magnitude.
The quantum circuit is associated with classical operations.
Aspects can have one or more of the following advantages.
Some implementations of the techniques described herein are able to compile a program specification in a manner that avoids certain experimentally intractable quantum operations in an efficient manner. For example, to avoid a particular type of experimentally intractable quantum operation, one or more translated quantum operations can be performed that would yield an equivalent result. If some of the translated quantum operations would be computationally expensive to perform, techniques can be used to reduce the number of the computationally expensive quantum operations in the compiled specification, as described in more detail below.
Other features and advantages will become apparent from the following description, and from the figures and claims.
The disclosure is best understood from the following detailed description when read in conjunction with the accompanying drawing. It is emphasized that, according to common practice, the various features of the drawing are not to-scale. On the contrary, the dimensions of the various features are arbitrarily expanded or reduced for clarity.
While a classical computer operates on binary information (e.g., in terms of classical bits represented as having a value of 0 or 1, or any equivalent representation of binary information, such as hexadecimal), a quantum computer operates on quantum bits, also called “qubits”. Qubits may be composed of a weighted combination of two quantum states that are used as basis states, often labelled |0 and |1
. In general, more than two quantum states may be used, which can result in information often termed “qudits”. Herein qubits are used for explanation purposes, though the examples may also apply to qudits. The quantum nature of qubits allows one to utilize quantum properties such as superposition, entanglement, and interference to perform computations.
to |1
.
Referring to to |1
, or other orthogonal basis states). For example, the readout module 108 may include lasers and imaging devices that perform fluorescence imaging. In one example of fluorescence imaging, each atom in measured to be in the state |0
would appear bright, while atoms measured to be in the state |1
would appear dark. A quantum circuit that includes a series of quantum gates performing quantum operations on a number of qubits in a quantum register will typically also include measurement operations. A given quantum circuit may specify that qubits are to be measured at the end of the quantum circuit, and/or within the quantum circuit (i.e., for mid-circuit measurement). Some measurements may “collapse” the state of a qubit to a particular basis state, or may leave the qubit in a state that is not fully collapsed (e.g., for a quantum nondemolition measurement). The classical computer 101 may use the information from the readout module 108 to perform further quantum computation using the quantum computer 103, or to provide information to a classical algorithm, to a different computing system, and/or to a user of the quantum computing system 100.
Referring to
There are various kinds of physical systems that can allow for quantum computation, including trapped ions, superconducting circuits, neutral atoms, NV-centers, and photonics. Trapped ion quantum computing can utilize electromagnetic fields to trap charged atomic particles-ions. Neutral atom quantum computing can utilize an array of laser light to trap cold atoms. In both trapped ions and neutral atoms, the energy levels of the ions or atoms may be used as quantum states for quantum computation. Once the ions or atoms are confined, two of their energy levels can be coupled (e.g., via laser light and/or microwaves), thus allowing one to perform a set of quantum operations. In some example trapped ion systems, the motion of the ions may be altered by laser light, and through the Coulomb force, one may quantum mechanically entangle two or more ions. In some example neutral atom systems, a Rydberg blockade may allow for quantum mechanical entanglement across two or more atoms. Some physical systems may allow for the representation of quantum states based on more than two basis states, which can be referred to as quantum digits, also called “qudits.” The techniques described herein with respect to quantum states expressed in qubits can also be implemented using quantum states expressed in qudits.
Both trapped ion and neutral atom quantum computing platforms can store the ions or atoms in a vacuum chamber, thus preventing collisions with background atmospheric gases that would lead to heating. Superconducting circuits, on the other hand, may be stored in a cryogenic environment, such as a dilution refrigerator.
The quantum operations that a quantum computer can perform may be limited by experimental factors. For instance, for some neutral atom quantum computing platforms (also called cold atom quantum computing platforms), it may be experimentally challenging to rotate a single qubit state about the y-axis of the Bloch sphere. Experimentally, it may be simpler to perform global operations on many qubits, rotating each qubit around the y-axis of its respective Bloch sphere. The inverse of the global operation can be applied to return the many qubits to their original locations on their respective Bloch spheres. However, in some examples it may be beneficial to perform a net rotation on a single qubit by performing an experimentally simpler rotation such (e.g., a rotation about the z-axis) on that single qubit between a global operation and an inverse of the global operation. Then, the sequence of operations would be: a global operation, followed by a single-qubit rotation, followed by an inverse of the global operation. Thus, at the end of the sequence of operations, the single qubit is rotated about an axis with respect to its original position while the other qubits are unchanged.
The above approach is able to circumvent the experimental intractability of performing a rotation about some axis by instead performing global rotations that apply to all qubits, as well as a single-qubit rotation that may be experimentally simpler. For example, some quantum operations may be implemented using laser pulses that can address specific target atoms, while other gates may be implemented using microwave fields, generated via one or more microwave sources, that uniformly address all or many qubits in a given device.
The next goal is to then minimize and/or reduce the total number of global operations, which can be computationally expensive and/or noisy. Rather than addressing only a single qubit between the two global operations, the methods disclosed herein find quantum operations that can be grouped together, such that if they are individually rotated in a certain manner, then the global operations will perform the desired net rotation on the grouped qubits. Such a method reduces the number of global operations that must be performed while achieving the same end result of the desired quantum operation.
An additional method to reduce the number of quantum operations for a given task may include using a quantum gate backlog. A quantum gate backlog can reduce the number of quantum operations by keeping track of the quantum rotations for one or more qubits. For example, the backlog may keep track of Rz gates that need to be applied to each qubit, and can be used to combine these gates and apply them later in the computation. For example, instead of performing two separate quantum rotations about the same axis (e.g., 30 degrees and 40 degrees), the quantum gate backlog keeps track of the rotations and combines them (e.g., 70 degrees), thus reducing the number of quantum rotations performed.
The following definitions are provided for describing some example implementations of the techniques disclosed herein.
A “directed graph” G=(V, E) consists of a set of vertices, V, and a set of edges, E, for which each edge e∈E is an ordered pair of vertices in V, which is to say e=(v, w) for some v, w∈V.
Given a directed graph G=(V, E), a “path” from vertex v∈V to vertex w∈V is a sequence of N edges, (e1, e2, . . . , eN) with each ej=(aj, bj)∈E, in which (1) the path starts at v, which is to say that a1=v, (2) the path ends at w, which is to say that bN=w, (3) consecutive edges are connected by a vertex, which is to say that bj=aj+1. The length of a path, N, may generally be any positive integer.
Given a directed graph G=(V, E), the vertex v∈V is a “predecessor” of vertex w∈V if and only if there exists a path from v to w. In this case, w is said to be a “successor” of v.
A “source” in a graph G=(V, E) is a vertex v∈V that has no predecessors. A “sink” in G is a vertex w∈V with no successors.
A “cycle” is a path that starts and ends at the same vertex. A “directed acyclic graph” is a directed graph that contains no cycles.
A “topological ordering” T of a directed acyclic graph G=(V, E) is a sequence of all vertices in V, which is to say T=(v1, v2, . . . , v|V|), in which vertex va precedes vertex vb in the sequence T if (va, vb)∈E. Here |V| is the number of vertices in V. Every directed acyclic graph has at least one topological ordering.
A “circuit” is a directed acyclic graph C=(V, E) that represents instructions by which a computer performs a specific computation. The computer in question may generally contain both classical and quantum elements. The vertices in V are in one-to-one correspondence with logical operations that the computer must perform, so we may unambiguously refer to any vertex v∈V as an “operation”. An edge (v, w)∈E corresponds to one or more classical or quantum bits that are addressed consecutively by operations v and w. For any circuit C=(V, E), we may say that x∈C to mean that either x∈V or x∈E.
A “quantum circuit” is a circuit comprising one or more quantum operations that address one or more quantum bits, and may further comprise any number of classical operations that address any number of classical bits. In some implementations, the quantum circuit can include quantum-classical hybrid operations which address both quantum and classical bits.
For any circuit C=(V, E) and vertex v∈V, we define “bits(v)” to be the set of bits (which may be classical or quantum) addressed by the operation associated with v. We then define “bits(C)” and “bits(V)” to be the set of all bits associated with operations in V, which is to say that bits(C)=bits(V)=∪v∈V bits(v).
Any ordered pair of circuits (C1, C2), with each Cj=(Vj, Ej), may be “concatenated” to construct a new circuit concat(C1, C2)=Cconcat=(Vconcat, Econcat). This concatenation is defined by:
A “quantum channel” is a mathematical object that uniquely represents the effect of a logical operation on a system. The system in question may generally contain both classical and quantum elements. Specifically, a quantum channel O representing a logical operation O is a map that takes any state ρinput of a system, and returns the state ρoutputO that is acquired by applying the logical operation O to the state ρinput, which is to say that
O(ρinput)=ρoutputO. The quantum channel of a circuit C=(V, E) can be acquired by composing the quantum channels of its operations in any topological order, which is to say that
C(ρ)=v
v
v
We say that circuits C1 and C2 are “equivalent” to mean that the quantum channel representing the action of C1 on bits(C1)∪bits(C2) is equal to the quantum channel representing the action of C2 on the same bits.
Here we define two sets of gates that play a role in some of the example compiler techniques described below.
Given an arbitrary quantum circuit, an existing compiler can be used to decompose the quantum circuit into an equivalent quantum circuit that contains only the following logical operations:
The compiling techniques described herein can be applied to any of a variety of types of quantum computing devices. In some of the examples described below, the quantum computing device is able to perform the following primitive logical operations:
We will refer to the set of all such operations as the “Cold Atom Gate Set” due to its current use in cold atom quantum computing devices, wherein “PartialCZ” gates and “Rz” gates may be implemented using laser pulses that can address specific target atoms, and “GlobalR” gates may be implemented using microwave fields that uniformly address all qubits in a given device. It is emphasized that, in general, the examples provided are hardware-agnostic and apply to systems other than cold atom quantum computing devices.
Given an arbitrary quantum circuit, an example compiler configured to perform the techniques described herein is able to construct an equivalent quantum circuit in which all unitary operations are in the Cold Atom Gate Set. On a high level, an example compiler method includes three stages:
Let C=(V, E) be a circuit. A “schedule” for C is a map S: V→ from the set of vertices V to the set of nonnegative integers N. Before describing an example method for constructing a schedule, we define a procedure that we call “sifting”.
At a high-level, sifting through a circuit collects together a set of operations (with a specified type) that can be applied simultaneously or consecutively (in any order) without changing the circuit's topology. Specifically, sifting through a circuit C=(V, E) is a procedure defined by a boolean indicator function ƒ: V→{0, 1}, yielding three subcircuits of C:
Without intending to be bound by theory, for some examples, let CorigCZ be an arbitrary circuit whose unitary operations are in the Standard CZ Gate Set, and let ƒSQG: Vorig→{0, 1} be an indicator function that identifies single-qubit gates: ƒSQG(v)=1 if and only if the operation v addresses exactly one qubit. Loosely speaking, we can construct a schedule S: Vorig→for CorigCZ by repeatedly sifting through CorigCZ. After each sifting step, every operation that passed through the sifter gets assigned a unique moment, while the operations that were caught by the sifter get assigned to the same moment.
More specifically, we first define Cblocked(0)=CorigCZ. We then inductively define Cpassed(j), Ccaught(j), Cblocked(j) for all positive integers j by defining Pj=(Cpassed(j), Ccaught(j), Cblocked(j)) to be the tripartition acquired by sifting through Ccaught(j-1). In other words, Pj is the tripartition acquired by sifting through CorigCZ a total of j times, each time setting aside everything that passed through or was caught by the sifter. We can “assign a moment” to a set of operations V⊂Vorig by picking the smallest moment m that has not yet been assigned, and defining S(v)=m for all v∈V. In this way, we iterate over all integers j from 1 to Jfinal, where Jfinal is the smallest positive integer k for which Cblocked(k) is empty. For each j, we:
After constructing a schedule S for a circuit C, we may for brevity refer to the moments in the image of S that contain at least one operation as the moments of C.
into the GHZ state |0000
+|1111
(up to normalization factors).
into |0000
+|1111
, expressed using a single Hadamard gate and three CNOT gates.
After scheduling a pre-compiled circuit CorigCZ with an indicator function (e.g., ƒSQG) we may iterate over all moments of CorigCZ, and associate each moment m with a circuit Cm whose unitary operations are in the Cold Atom Gate Set. We refer to the procedure of constructing an initial circuit Cm that is associated with the moment m as “decomposing the moment” m. After decomposing all moments of CorigCZ, we may use the associated circuits to construct a final circuit Cfinal that is equivalent to CorigCZ, and therefore also equivalent to Corig. Here, equivalent refers to the fact that the end result of two quantum circuits are the same, although the operations within each circuit may be different. We refer to the overall procedure of constructing the final circuit Cfinal from the scheduled circuit CorigCZ as “decomposing the circuit” CorigCZ.
If every operation v contained in a moment m addresses exactly one qubit, which is to say that ƒSQG(v)=1, then we call the moment m a “single-qubit gate moment”, or “SQGM”. Otherwise, we refer to m as a “multi-qubit gate moment”, or “MQGM”. Due to the method used for scheduling CorigCZ, every MQGM of CorigCZ contains only one operation. We therefore decompose a MQGM m by assigning it the circuit Cm=({vm}, { }), where vm is the only operation contained in m. In some implementations, in order to decompose the circuit CorigCZ, we will also need to decompose all SQGMs in CorigCZ. We describe two methods to decompose SQGMs and describe an example method to decompose CorigCZ.
The first method to decompose a SGQM relies on the Euler angle decomposition (which we refer to as the axial decomposition) of a U3 gate:
The gate Ry is defined identically to Rz, but with a Pauli-Y operator; and η is an arbitrary angle.
and ϕ=λ=η=0. Arrows track the orientation of vectors that initially point along the Y and Z axes.
A SGQM generally may generally contain several U3 gates that address different qubits, which is to say that the unitary operator uniquely associated with this moment can be written as ΠjU3(θj, ϕj, λj; j), where θj, ϕj, λj are angles associated with the U3 gate that addresses qubit j in the moment being decomposed, and the product over j is performed over all qubits addressed by the operations in this SQGM. The Euler angle decomposition of the SQGM is then determined by the identity
Specifically, the result of decomposing a SQGM m using the identity in Eq. (3) is an associated circuit Cm. The vertices of Cm consist of all operations on the right hand side of Eq. (3), and the edges of Cm consist of all ordered pairs of operations in Cm that address the same qubit consecutively. That is, for any pair of operations v1 and v2 in the circuit Cm, this circuit contains the edge (v1, v2) if and only if there exists a qubit j for which (i) both v1 and v2 address qubit j, (ii) v1 is to the right of v2 in Eq. (3), and (iii) there are no operations between v1 and v2 in Eq. (3) that address qubit j.
The angle η may be chosen arbitrarily, either when constructing the circuit Cm or later when decomposing the circuit CorigCZ. In particular, this angle may be chosen to achieve some auxiliary objective. For example, this angle may be chosen to (i) reduce the number of Rz gates with nonzero angles in Cfinal, or (ii) reduce the sum of the magnitudes of the angles of Rz gates in Cfinal.
Whereas the aforementioned SQGM decomposition method relies on the Euler angle decomposition of a U3 gate, here we describe a decomposition, which we refer to as a transverse decomposition, that relies on the identity
where Rv(ζ, ϑ; j)=e−iζV
Arrows track the orientation of vectors that initially point along the Y and Z axes.
One feature of the identity in Eq. (5) is that the total global pulse area is |θ|, which is to say the magnitudes of the first angles in the GlobalR gates on the right hand side of Eq. (5) sum to |θ|. Indeed, expanding the unitary operator associated with a SQGM in the form ΠjU3(θj, ϕj, λj; j) with all |θj|≤π, a global pulse area of at least maxj|θj| is necessary to decompose that SQGM into two GlobalR and many Rz gates. Defining θmax=±maxj|θj|(with an arbitrarily chosen sign), we can solve for the Rz gate angles necessary for all qubits to recycle the same two GlobalR gates to find that
where each σj∈{+1, −1} is an arbitrary sign, the angles
αj=γj+δj, βj=γj−δj, (7)
and
Here sign(x)=x/|x|∈{+1, −1} if x≠0 and 0 otherwise; κj=+∞ if θj=θmax; and arctan(x) is the inverse tangent of x. The identity in Eq. (6) can be used to decompose a SQGM using the same procedure as with identity Eq. (3). Similarly to before, the angle η, the sign of θmax, and the signs σj may be chosen arbitrarily, either when constructing the circuit Cm or later when decomposing the circuit CorigCZ. In particular, this angle may be chosen to achieve some auxiliary objective, such as minimizing the number of Rz gates in the final circuit Cfinal.
To decompose a circuit CorigCZ that has been scheduled, we can first decompose all of its moments, associating each moment m with a corresponding circuit Cm. This decomposition is unique for MGQMs, while for SQGMs we may use either of the methods from axial or transverse decomposition. Decomposing all moments of CorigCZ yields a sequence of circuits (C0, C1, C2, . . . ), using which we construct a new sequence of circuits (C0mod, C1mod, C2mod, . . . ) according to a method described below. We then define the final circuit Cfinal as the concatenation of all circuits in the new sequence:
C
final=conct(C0mod,C1mod,C2mod, . . . ) (10)
Throughout the construction of the sequence (C0mod, C1mod, C2mod, . . . ), we keep track of an Rz “gate backlog”, simply called the “backlog” for shorthand, which assigns an angle ξj to every qubit j addressed by the circuit CorigCZ. On a high level, the backlog keeps track of Rz gates that need to be applied to each qubit, and is used to combine these gates and apply them as late as possible. At the start of decomposition, the backlog assigns every qubit j the angle ξj=0. This backlog is mutable, which is to say that the angle ξj in the backlog may change throughout the construction of the sequence (C0mod, C1mod, C2mod, . . . ).
To construct the sequence (C0mod, C1mod, C2mod, . . . ), we iterate over every moment m in CorigCZ in increasing order. If m is a MGQM, we define Cmmod=Cm. Otherwise, we can construct Cmmod as follows:
Once the circuits Cmmod have been constructed for all moments m in the scheduled circuit CorigCZ, we can “clear out the backlog” by appending Rz gates to the circuits {Cmmod}. Specifically, we let mlast be the last moment in CorigCZ, and define Cm
The methods disclosed herein may apply to the case that an input circuit contains, in addition to unitary operations, any number of the following types of logical operations:
The methods disclosed herein can be applied to any situation in which the PartialCZ(α) gates in the Cold Atom Gate Set are replaced by any number of entangling gates that address two or more qubits. In this case, one step that can be modified in this example method for compiling circuits is that of constructing a modified circuit Cmmod associated with a MQGM m. Specifically, the circuit Cmmod associated with a MQGM m can now be constructed according to the following procedure:
The techniques described above can be implemented using software for execution on a computer system. For example, the software can define procedures in one or more computer programs that execute on one or more programmed or programmable computer systems (e.g., desktop, distributed, client/server computer systems) each including at least one processor, at least one data storage system (e.g., including volatile and non-volatile memory and/or storage elements), at least one input device (e.g., keyboard and mouse) or port, and at least one output device (e.g., monitor) or port. The software may form one or more modules of a larger program.
The software may be provided on a non-transitory medium such as a computer-readable storage medium (e.g., solid state memory or media, or magnetic or optical media) readable by a general or special purpose programmable computer system, or delivered over a communication medium (e.g., encoded in a propagated signal) such as network to a computer system where it is stored in a non-transitory medium and executed. Each such computer program can be used to configure and operate the computer system when the non-transitory medium is read by the computer system to perform the procedures of the software.
While the disclosure has been described in connection with certain embodiments, it is to be understood that the disclosure is not to be limited to the disclosed embodiments but, on the contrary, is intended to cover various modifications and equivalent arrangements included within the scope of the appended claims, which scope is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures as is permitted under the law.
This application claims priority to and the benefit of U.S. Patent Application Ser. No. 63/348,130, entitled “COMPILING QUANTUM COMPUTING PROGRAM SPECIFICATIONS BASED ON QUANTUM OPERATIONS,” filed on Jun. 2, 2022, incorporated by reference herein.
This invention was made with government support under Contract No. DE-SC0021526 by the U.S. Department of Energy. The government has certain rights in the invention.
Number | Date | Country | |
---|---|---|---|
63348130 | Jun 2022 | US |