Automated Synthesizing of Quantum Programs
In a general aspect, a quantum program is automatically synthesized. In some implementations, artificial intelligence systems are used to generate a quantum program to run on a quantum computer. In some aspects, quantum processor output data are generated by a quantum resource executing an initial version of a quantum program, and quantum state information is computed from the quantum processor output data. Neural network input data, which include the quantum state information and a representation of a problem to be solved by the quantum program, are provided to a neural network. Neural network output data are generated by the neural network processing the neural network input data. A quantum logic gate is selected based on the neural network output data. An updated version of the quantum program that includes the selected quantum logic gate is generated.
1 . A method comprising:
obtaining quantum state information computed from quantum processor output data generated by a quantum resource executing an initial version of a quantum program;
providing neural network input data to a neural network, the neural network input data comprising the quantum state information and a representation of a problem to be solved by the quantum program;
obtaining neural network output data generated by the neural network processing the neural network input data;
selecting a quantum logic gate based on the neural network output data; and
generating an updated version of the quantum program that includes the selected quantum logic gate.
2 . The method of claim 1 , wherein the neural network input data comprise a state and a reward based on the quantum processor output data.
3 . The method of claim 2 , wherein the state comprises the quantum state information and the representation of the problem to be solved by the quantum program.
4 . The method of claim 3 , wherein the state comprises:
a binary array containing qubit measurements from the quantum resource executing multiple shots of the initial version of the quantum program; and
an array containing weights of a graph representation of the problem.
5 . The method of claim 3 , comprising encoding the problem.
6 . The method of claim 3 , wherein the problem to be solved comprises a combinatorial optimization problem or finding a ground state of a molecule.
7 . (canceled)
8 . The method of claim 3 , wherein the reward comprises a Hamiltonian expectation value based on the problem to be solved.
9 . The method of claim 1 , wherein the neural network output data comprise a set of values associated with a set of quantum logic gates, and the value associated with each quantum logic gate represents a prediction of a degree to which the quantum logic gate improves the quantum program.
10 . The method of claim 9 , wherein selecting the quantum logic gate comprises:
identifying a maximum value in the set of values; and
identifying the quantum logic gate associated with the maximum value.
11 . The method of claim 9 , wherein the set of quantum logic gates comprises an action space comprising:
a set of discrete-angle single-qubit rotation gates for each of a plurality of qubits; and
a set of two-qubit entangling gates for each distinct pair of qubits in the plurality of qubits.
12 . The method of claim 1 , wherein the initial version comprises a quantum logic circuit comprising a series of quantum logic gates, and generating the updated version comprises appending the selected quantum logic gate to the end of the series.
13 . The method of claim 12 , wherein appending the selected quantum logic gate to the series improves the quantum program according to a reward defined by the problem to be solved by the quantum program.
14 . (canceled)
15 . The method of claim 1 , comprising:
obtaining additional quantum processor output data generated by the quantum resource executing the updated version of a quantum program; and
selecting a value of a variable parameter of the quantum logic gate based on the additional quantum processor output data;
wherein the quantum logic gate comprises a parametric gate.
16 . (canceled)
17 . The method of claim 1 , comprising modifying the neural network based on reward data computed from the quantum processor output data.
18 . The method of claim 17 , wherein the reward data comprises a cost function based on a Hamiltonian.
19 . The method of claim 17 , wherein the neural network is modified according to a deep reinforcement learning process.
20 . The method of claim 1 , comprising executing an iterative process, where each iteration of the iterative process includes:
compiling an initial version of the quantum program for the iteration;
generating quantum processor output data for the iteration by executing the quantum program compiled for the iteration;
computing quantum state information for the iteration based on the quantum processor output data for the iteration;
operating the neural network to produce neural network output data for the iteration based on the quantum state information for the iteration;
selecting a quantum logic gate for the iteration based on the neural network output data for the iteration; and
generating an updated version of the quantum program that includes the selected quantum logic gate for the iteration.
21 - 22 . (canceled)
23 . The method of claim 1 , wherein the quantum resource comprises a quantum processor unit, multiple quantum processor units configured to operate in parallel, a quantum virtual machine, or multiple quantum virtual machines configured to operate in parallel.
24 - 27 . (canceled)
28 . The method of claim 1 , wherein the quantum processor output data are generated by the quantum resource executing multiple shots of the initial version of the quantum program, the quantum state information comprises a plurality of bitstrings, and each bitstring represents a measurement of qubit states generated by a respective one of the multiple shots.
29 . (canceled)
30 . A method comprising:
computing a reward from quantum processor output data generated by a quantum resource executing an initial version of a quantum program, wherein the reward is computed according to a problem to be solved by a policy;
modifying the policy based on the reward;
obtaining policy output data generated by the modified policy processing the reward and a representation of the problem to be solved;
selecting a quantum logic gate based on the policy output data; and
generating an updated version of the quantum program that includes the selected quantum logic gate.
31 . The method of claim 30 , further comprising initializing the policy based on a classical solution to the problem.
32 . (canceled)
33 . The method of claim 30 , wherein the problem to be solved comprises a combinatorial optimization problem, a MAXCUT problem instance, a MAXQP problem instance or a QUBO problem instance.
34 . (canceled)
35 . The method of claim 30 , wherein the policy comprises a neural network comprising a plurality of layers and a plurality of trainable weights, and modifying the policy comprises modifying the trainable weights of the neural network.
36 . The method of claim 35 , comprising:
initializing the trainable weights; and
generating the initial version of a quantum program based on the neural network comprising the initialized trainable weights.
37 . The method of claim 36 , comprising initializing the trainable weights to random values or initializing the trainable weights based on a one-step reward associated with a set of actions and observations.
38 - 39 . (canceled)
40 . The method of claim 20 , wherein a Hamiltonian of the representation of the problem admits a diagonal form with respect to a computational basis of the representation of the problem, and the method comprises, after generating an updated version of the quantum program:
determining angles of rotation gates present in the updated version of the quantum program; and
terminating the iterative process if any angles of X rotation gates deviate from π by more than π/2 radians.