Incremental generation of quantum circuits

A method includes detecting submission of a first quantum circuit for compilation, the first quantum circuit comprising a first set of quantum logic gates; generating a first gate index, the first gate index comprising an ordered table of a subset of the set of quantum logic gates, each quantum logic gate of the subset of quantum logic gates including a corresponding set of qubits acted on by the quantum logic gate; comparing the first gate index with a second gate index to determine a structural equality of the first quantum circuit and the second quantum circuit; and parameterizing, in response to determining a structural equality of the first quantum circuit and the second quantum circuit, a first set of parameters of a second set of quantum logic gates of the second quantum circuit with a second set of parameters of the first set of quantum logic gates.

TECHNICAL FIELD

The present invention relates generally to variational algorithms using quantum computing. More particularly, the present invention relates to a method for incremental generation of quantum circuits.

BACKGROUND

Hereinafter, a “Q” prefix in a word of phrase is indicative of a reference of that word or phrase in a quantum computing context unless expressly distinguished where used.

Molecules and subatomic particles follow the laws of quantum mechanics, a branch of physics that explores how the physical world works at the most fundamental levels. At this level, particles behave in strange ways, taking on more than one state at the same time, and interacting with other particles that are very far away. Quantum computing harnesses these quantum phenomena to process information.

The computers we use today are known as classical computers (also referred to herein as “conventional” computers or conventional nodes, or “CN”). A conventional computer uses a conventional processor fabricated using semiconductor materials and technology, a semiconductor memory, and a magnetic or solid-state storage device, in what is known as a Von Neumann architecture. Particularly, the processors in conventional computers are binary processors, i.e., operating on binary data represented in 1 and 0.

A quantum processor (q-processor) uses the odd nature of entangled qubit devices (compactly referred to herein as “qubit,” plural “qubits”) to perform computational tasks. In the particular realms where quantum mechanics operates, particles of matter can exist in multiple states—such as an “on” state, an “off” state, and both “on” and “off” states simultaneously. Where binary computing using semiconductor processors is limited to using just the on and off states (equivalent to 1 and 0 in binary code), a quantum processor harnesses these quantum states of matter to output signals that are usable in data computing.

Conventional computers encode information in bits. Each bit can take the value of 1 or 0. These 1s and 0s act as on/off switches that ultimately drive computer functions. Quantum computers, on the other hand, are based on qubits, which operate according to two key principles of quantum physics: superposition and entanglement. Superposition means that each qubit can represent both a 1 and a 0 at the same time. Entanglement means that qubits in a superposition can be correlated with each other in a non-classical way; that is, the state of one (whether it is a 1 or a 0 or both) can depend on the state of another, and that there is more information that can be ascertained about the two qubits when they are entangled than when they are treated individually.

Using these two principles, qubits operate as more sophisticated processors of information, enabling quantum computers to function in ways that allow them to solve difficult problems that are intractable using conventional computers. IBM has successfully constructed and demonstrated the operability of a quantum processor using superconducting qubits (IBM is a registered trademark of International Business Machines corporation in the United States and in other countries.)

Quantum algorithms apply quantum operations (quantum gates) on subsets of qubits. Quantum gates are analogous to instructions in a classical computing program. A quantum circuit is a representation of a quantum algorithm using quantum gates. The illustrative embodiments recognize that presently available quantum computing models require quantum algorithms to be specified as quantum circuits on idealized hardware, instead of an actual quantum computer. The illustrative embodiments further recognize that quantum algorithms require mapping into a representation that an actual quantum computer can execute, through a process known as quantum circuit compilation. The illustrative embodiments recognize that compilation often requires adding additional gates to move qubit states to locations where a desired gate acts upon the qubit state due to the physical constraints of the actual quantum computer.

The illustrative embodiments recognize that quantum processors can perform variational algorithms which conventional processors are incapable of performing. The illustrative embodiments further recognize that presently available quantum variational algorithms require quantum circuit compilation for each iteration A conventional processor performs an optimization algorithm that varies the parameters of the wavefunction. A quantum processor computes the corresponding total energy of the wavefunction.

The illustrative embodiments recognize that compilation of each quantum circuit represents a significant amount of the overall run time for the quantum algorithm. The illustrative embodiments further recognize that many quantum algorithms are composed of structurally identical quantum circuits. The illustrative embodiments further recognize that a quantum circuit compiler never changes a temporal order in which a given gate appears on a given set of qubits. For example, an uncompiled quantum circuit can comprise a first and second measure gate on a first qubit. After compilation, the compiled quantum circuit will comprise a first and second measure gate on the first qubit and executed in the same order as the uncompiled quantum circuit.

SUMMARY

The illustrative embodiments provide a method, system, and computer program product for incremental generation of quantum circuits. In an embodiment, a method includes detecting submission of a first quantum circuit for compilation, the first quantum circuit comprising a first set of quantum logic gates. In an embodiment, a method includes generating a first gate index for the first quantum circuit, the first gate index comprising an ordered table of a subset of the set of quantum logic gates, each quantum logic gate of the subset of quantum logic gates including a corresponding set of qubits acted on by the quantum logic gate.

In an embodiment, a method includes comparing the first gate index with a second gate index of a second quantum circuit to determine a structural equality of the first quantum circuit and the second quantum circuit. In an embodiment, a method includes parameterizing, in response to determining a structural equality of the first quantum circuit and the second quantum circuit, a first set of parameters of a second set of quantum logic gates of the second quantum circuit with a second set of parameters of the first set of quantum logic gates. In an embodiment, the second quantum circuit is a previously compiled quantum circuit.

In an embodiment, a method includes compiling, in response to determining a structural inequality of the first quantum circuit and the second quantum circuit, the first quantum circuit. In an embodiment, a structural inequality includes a number of a specific type of quantum logic gate of the first set of quantum logic gates differs from a number of the specific type of quantum logic gate of the second set of quantum logic gates.

In an embodiment, a method includes storing a set of previously compiled quantum circuits in a database. In an embodiment, a structural equality includes a number of each specific type of quantum logic gate of the first set of quantum logic gates equals a number of the same specific type of quantum logic gate of the second set of quantum logic gates.

In an embodiment, the method is embodied in a computer program product comprising one or more computer-readable storage devices and computer-readable program instructions which are stored on the one or more computer-readable tangible storage devices and executed by one or more processors.

An embodiment includes a computer usable program product. The computer usable program product includes a computer-readable storage device, and program instructions stored on the storage device.

An embodiment includes a computer system. The computer system includes a processor, a computer-readable memory, and a computer-readable storage device, and program instructions stored on the storage device for execution by the processor via the memory.

DETAILED DESCRIPTION

The illustrative embodiments used to describe the invention generally address and solve the above-described problems of quantum circuit compilation. The illustrative embodiments provide a method for incremental generation of quantum circuits.

An embodiment provides a method for incremental generation of quantum circuits. Another embodiment provides a quantum computer usable program product comprising a computer-readable storage device, and program instructions stored on the storage device, the stored program instructions comprising a method for incremental generation of quantum circuits. The instructions are executable using a conventional or quantum processor. Another embodiment provides a computer system comprising a conventional or quantum processor, a computer-readable memory, and a computer-readable storage device, and program instructions stored on the storage device for execution by the processor via the memory, the stored program instructions comprising a method for incremental generation of quantum circuits.

The illustrative embodiments recognize that hybrid quantum algorithms, such as variational algorithms, include a handoff between a classical computer generating inputs or modifications to a quantum circuit, running the circuit on a quantum computer, and using the output to serially generate a subsequent quantum circuit. The Variational Quantum Eigensolver (VQE) is one non-limiting example of a variational algorithm performed with quantum computers.

An embodiment detects a first quantum circuit submitted for compilation. The first quantum circuit is an uncompiled quantum circuit. An embodiment compares the first quantum circuit to a previously compiled quantum circuit. For example, an embodiment generates a first list of a first set of quantum gates of the first quantum circuit, each quantum gate acting on a corresponding set of qubits of the first quantum circuit. The embodiment also generates a second list of a second set of quantum gates of the previously compiled quantum circuit, each quantum gate acting on a corresponding set of qubits of the previously compiled quantum circuit.

The embodiment compares the first list to the second list to determine a structural similarity between the first circuit and the previously compiled circuit. In an embodiment, the first circuit and the previously compiled circuit are structurally equal when the number of gates of each type in the first list match the number of gates of each type in the second list. In another example, the embodiment can determine the number of gates of a first gate type in the first list differs from the number of gates of the first gate type in the second list. In response, the embodiment determines the first circuit and the previously compiled circuit fail to be structurally equal. The embodiment compiles, in response to determining the first circuit and the previously compiled circuit fail to be structurally equal, the first circuit.

The embodiment parameterizes, in response to determining the first quantum circuit and the previously compiled circuit are structurally equal, the previously compiled circuit with a set of parameters for the first quantum circuit.

Furthermore, simplified diagrams of the data processing environments are used in the figures and the illustrative embodiments. In an actual computing environment, additional structures or component that are not shown or described herein, or structures or components different from those shown but for a similar function as described herein may be present without departing the scope of the illustrative embodiments.

Furthermore, the illustrative embodiments are described with respect to specific actual or hypothetical components only as examples. The steps described by the various illustrative embodiments can be adapted using a variety of components that can be purposed or repurposed to provide a described function within a data processing environment, and such adaptations are contemplated within the scope of the illustrative embodiments.

The illustrative embodiments are described with respect to certain types of steps, applications, quantum logic gates, and data processing environments only as examples. Any specific manifestations of these and other similar artifacts are not intended to be limiting to the invention. Any suitable manifestation of these and other similar artifacts can be selected within the scope of the illustrative embodiments.

Clients or servers are only example roles of certain data processing systems connected to network102and are not intended to exclude other configurations or roles for these data processing systems. Server106couples to network102along with storage unit108. Server106is a conventional data processing system. Storage unit108includes database109. Database109stores a set of previously compiled quantum circuit representations for executing quantum computing processes thereon. Quantum processing system140couples to network102. Quantum processing system140is a quantum data processing system. Software applications may execute on any quantum data processing system in data processing environment100. Any software application described as executing in quantum processing system140inFIG. 1can be configured to execute in another quantum data processing system in a similar manner. Any data or information stored or produced in quantum processing system140inFIG. 1can be configured to be stored or produced in another quantum data processing system in a similar manner. A quantum data processing system, such as quantum processing system140, may contain data and may have software applications or software tools executing quantum computing processes thereon.

Clients110,112, and114are also coupled to network102. A conventional data processing system, such as server106, or client110,112, or114may contain data and may have software applications or software tools executing conventional computing processes thereon.

Device132is an example of a conventional computing device described herein. For example, device132can take the form of a smartphone, a tablet computer, a laptop computer, client110in a stationary or a portable form, a wearable computing device, or any other suitable device. Any software application described as executing in another conventional data processing system inFIG. 1can be configured to execute in device132in a similar manner. Any data or information stored or produced in another conventional data processing system inFIG. 1can be configured to be stored or produced in device132in a similar manner.

Server106, storage unit108, quantum processing system140, and clients110,112, and114, and device132may couple to network102using wired connections, wireless communication protocols, or other suitable data connectivity. Clients110,112, and114may be, for example, personal computers or network computers.

In the depicted example, server106may provide data, such as boot files, operating system images, and applications to clients110,112, and114. Clients110,112, and114may be clients to server106in this example. Clients110,112,114, or some combination thereof, may include their own data, boot files, operating system images, and applications. Data processing environment100may include additional servers, clients, and other devices that are not shown.

In the depicted example, memory144may provide data, such as boot files, operating system images, and applications to quantum processor142. Quantum processor142may include its own data, boot files, operating system images, and applications. Data processing environment100may include additional memories, quantum processors, and other devices that are not shown. Memory144includes application105that may be configured to implement one or more of the functions described herein for converging a variational algorithm solution space for quantum computing in accordance with one or more embodiments.

With reference toFIG. 3, this figure depicts a block diagram of an example configuration300for incremental generation of quantum circuits in accordance with an illustrative embodiment. The example embodiment includes an application302. In a particular embodiment, application302is an example of application105or application107ofFIG. 1.

Application302receives a quantum algorithm318. Quantum algorithm318comprises a set of instructions to be executed by a quantum computer. Application302includes a mapping generation component304. Mapping generation component304generates an index306for an uncompiled quantum circuit of the quantum algorithm318. In an embodiment, component304generates an index for an uncompiled quantum circuit for each iteration of the quantum algorithm. Index306includes a set of gate types308and a set of associated qubits310for each quantum gate in the uncompiled quantum circuit.

Component304generates a second index for a compiled quantum circuit stored in database312. Component304executes mapping command320to generate the second index322for a previously compiled quantum circuit. The second index322includes a set of gate types and a set of associated qubits for each quantum gate in the previously compiled quantum circuit. Component304executes additional mapping commands324to generate additional indices326for other previously compiled quantum circuits. Database312includes gate parameters314and qubit parameters316.

With reference toFIG. 4, this figure depicts a block diagram of an example configuration400for incremental generation of quantum circuits in accordance with an illustrative embodiment. The example embodiment includes an application402. In a particular embodiment, application402is an example of application105or application107ofFIG. 1.

Application402receives a quantum algorithm412. Quantum algorithm412comprises a set of instructions to be executed by a quantum computer. Application402includes a compiler component404and a comparison component410. Compiler component404includes a circuit transformation component406and a quantum circuit parameter analysis component408. Circuit transformation component406generates a quantum circuit from a subset of the set of instructions of the quantum algorithm412. In an embodiment, compiler component404compiles a first quantum circuit418. Application402stores the compiled quantum circuit428in the database414. Database414is an example of database109inFIG. 1.

Quantum circuit analysis component408generates an index for quantum circuits of the quantum algorithm. In an embodiment, component408generates an index for a subset of a set416of previously compiled quantum circuits.

Comparison component410determines a structural similarity between an uncompiled quantum circuit of the quantum algorithm412and a previously compiled quantum circuit stored in database414. In an embodiment, circuit comparison component426executes an index command422to generate an index424of a set of quantum gates and associated qubits for a subset of the set of previously compiled quantum circuits416. In an embodiment, component426compares a first index of an uncompiled quantum circuit with a second index of a previously compiled quantum circuit. For example, component426compares a number of a specific type of quantum gate in the first index to a number of the same type of quantum gate in the second index. In response to determining a structural equality of the uncompiled quantum circuit and the previously compiled quantum circuit, component420parameterizes the previously compiled quantum circuit with a set of parameters from the uncompiled quantum circuit. In response to determining structural inequality of the uncompiled quantum circuit and the previously compiled quantum circuit, component404compiles the uncompiled quantum circuit.

With reference toFIG. 5, this figure depicts a flowchart of an example method500for incremental generation of quantum circuits in accordance with an illustrative embodiment. Example method500may be performed by application402inFIG. 4.

In block502, application402compiles a first quantum circuit from a quantum algorithm. In block504, application402stores the compiled quantum circuit in a database. In block506, application402generates a gate index for an uncompiled second quantum circuit from the quantum algorithm. In an embodiment, application402detects the second quantum circuit is submitted for compilation. In an embodiment, application402generates a first gate index including a set of quantum gates of the previously compiled first quantum circuit, each quantum gate including a corresponding subset of a set of qubits acted on by the quantum gate. In an embodiment, application402generates a second gate index including a set of quantum gates of the uncompiled second quantum circuit, each quantum gate including a corresponding subset of a set of qubits acted on by the quantum gate.

In an embodiment, application402compares the first gate index and the second gate index to determine a structural similarity between the first quantum circuit and the second quantum circuit. In response to determining the first quantum circuit and the second quantum circuit are structurally dissimilar, application402compiles the second quantum circuit. In block508, in response to determining the first quantum circuit and the second quantum circuit are structurally equal, application402maps a first set of parameters for the second quantum circuit to the first quantum circuit.

Various embodiments of the present invention are described herein with reference to the related drawings. Alternative embodiments can be devised without departing from the scope of this invention. For example, additional variational algorithms for quantum computing may be included in of method500without departing from the scope of the present invention.