The present application claims priority to European Patent Application EP 22305532.8, filed Apr. 13, 2022, the contents of which are incorporated by reference herein in its entirety.
The invention relates to a method for compiling a program to be executed using a quantum computer, in view of calculating an observable value or sampling a bit string.
Optimizing the execution of a calculation which is performed using a quantum computer is an issue when compiling quantum circuits for noisy intermediate scale quantum architectures, also referred to as NISQ architectures. Indeed, these architectures do not have any error correction schemes and are thus subject to errors. The errors mostly come from the imperfection of the implementation of entangling gates, so that reducing the number of the entangling gates that are involved in the calculation is required. As commonly known, entangling gates are unitary operators that cannot be written as tensor products of local unitary operators. Other compilation issues may be reducing a calculation time, reducing separating distances between Josephson junctions that are used within a grid of such junctions in the quantum computer chipset, etc.
Several compilation methods already exist, that optimize the number of entangling gates by exploiting the fact that Clifford operators do not need to be implemented in a quantum processor, but rather can be classically emulated instead, i.e. the Clifford operators can be implemented using a non-quantum computer. For example, one such compilation method is disclosed in publication “Qubit routing via lazy synthesis” by Simon Martiel and Timothée Goubault de Brugière, Nov. 9, 2021, available at arxiv.org/abs/2012.09663.
Generally, these compilation methods address the objective of using a quantum processor to calculate an observable value of the form <0|U†HU|0>, where H denotes an observable, U is a quantum circuit and |0> is a qubit base state. The observable H may be described in the Pauli base. The compilation methods mentioned before implement algorithms that transform the quantum circuit U into a new quantum circuit U′ such that U equals the product of U′ by a Clifford operator C: U=CU′. Then, the observable value <0|U†HU|0> to be calculated becomes <0|U′†(C†HC)U′|0>, where C†HC operates as a new observable to be sampled with the state quantum U′|0>. The calculation of the new observable C†HC does not need to be carried out inside the quantum processor, and U′|0> just corresponds to a change in the measurement base with respect to U|0>. In the whole present description, the exponent character † appended just after an operator denotes the complex conjugate transposition of this operator, in a usual way for the Man of quantum computing. It is assumed that the Clifford group in well-known, composed of so-called Clifford operators. In the particular case of a Clifford operator C, C† is equal to the reverse operator of C. The above replacement of the quantum circuit U with U′ using U=CU′ may be called final Clifford stripping, since the Clifford operator is to be applied last when the product CU′ is applied sequentially to a n-qubit, where n is the number of qubits that are combined through tensor product.
It is also known that applying the same Clifford stripping algorithm to the complex conjugate transposition of the quantum circuit U, namely U†, leads to U†=CU′, or U=U′†C† corresponding then to an initial Clifford stripping since C† operates first in the product. Then the observable value to calculate can be written in the following way: <0|U†HU|0>=(<0|C)U′HU′†(C†|0>). The quantum state C†|0> as appearing in this latter writing is known as a stabilizer state. By definition, a stabilizer quantum state |ψ> over n qubits is a quantum state such that there exists a subgroup S of the Pauli group over n qubits that contains 2n Pauli operators and such that P|ψ>=|ψ> for any Pauli operator P that belongs to subgroup S. Such stabilizer states are very structured and can be efficiently synthetized. In particular a stabilizer state can be produced using at most n2/(log n) entangling gates, where n is again the number of qubits in the system and log denotes the natural logarithm function. Heuristics are known for synthetizing such stabilizer state, starting from a description of the Clifford operator C. All the computational base states are stabilizer states, and all states achieved by starting from |0 . . . 0> and applying only Clifford operators are also stabilizer states.
Based on this situation, one object of the present invention consists in providing a new compilation method which is more efficient than those already existing, for performing a quantum computer-implemented calculation. In particular, the invention method aims at reducing in a greater extent the number of entangling gates that are involved in the quantum calculation.
For meeting at least this object or others, a first aspect of the present invention proposes a computer-implemented method for compiling a program to be executed using a quantum computer in view of calculating a value of an observable for a final quantum state, when this final quantum state results from a target quantum circuit operating with an initial quantum state. The invention method comprises iterating the following step sequence /i/ to /vii/ after setting an initial matrix and a final matrix both to an identity matrix, and after initializing a stripped quantum circuit with the target quantum circuit:
The invention method further comprises selecting that one of the iterations of steps /i/ to /vii/ that has produced a minimum value for the performance cost, and then, using the updated initial matrix, updated stripped quantum circuit and updated final matrix as resulting from the selected iteration, performing the additional following steps:
Thanks to the invention method, the quantum computer is optimized for participating in calculating the observable value when provided with the completed circuit as resulting from step /2/.
The compiling method of the invention, including steps /i/ to /vii/, /1/ and /2/, is intended to be executed using a classical computer, i.e. non-quantum computer.
Thanks to each initial matrix being a Clifford operator, step /1/ is made easier by the fact that the complex conjugate transposition of the updated initial matrix applied to the initial quantum state is a stabilizer state.
Steps /2/ may be executed through circuit concatenation.
Step /i/ performs a final Clifford stripping of the quantum circuit, and step /ii/ performs an initial Clifford stripping of the first intermediate quantum circuit as resulting from the prior final Clifford stripping. Hence, the invention method combines both final Clifford stripping and initial Clifford stripping in each iteration of the step sequence. Thanks to this combination, it is more efficient in reducing the performance cost. Thus, the number of iterations of the sequence of steps /i/ to /vii/ may be low. Typically, this iteration number may be between 2 and 50, and even between 5 and 20.
In particular, the invention method may be used for reducing efficiently the number of entangling gates in the quantum computer to be used. A rate of errors in the execution of the program by the quantum computer can thus be reduced, providing improved reliability to the program result.
For such implementations of the invention where the observable value is to be calculated, in step /vi/ for each iteration of the sequence of steps /i/ to /vii/, the performance cost may be assessed as a sum of a first implementation cost relating to the updated stripped quantum circuit and a second implementation cost relating to the complex conjugate transposition of the updated initial matrix. These first and second implementation costs may increase with the number of entangling gates that are involved for implementing the updated stripped quantum circuit and the complex conjugate transposition of the initial matrix, respectively. Possibly, they may also increase with other parameters such as separating distances existing between junctions that are used within a grid of Josephson junctions in the quantum computer, a calculation time, an error rate of the program, etc. In particular, each implementation cost may equal the number of entangling gates of the corresponding quantum circuit.
For performing the calculation of the observable value, the method may further comprise:
Step /4/ may be executed using a classical computer, i.e. non-quantum computer, and step /5/ may be computed by the quantum computer or both the classical and quantum computers in combination.
Thanks to the reduction of the performance cost as allowed by the repetitions of the sequence of steps /i/ to /ii/, the reliability of the result obtained for the observable value is improved.
Instead of calculating an observable value, the invention method may be applied to sampling a bit string out of the final quantum state. The sequence of steps /i/ to /vii/ is the same as before, but the sampling of the bit string involves the complex conjugate transposition of the updated final matrix in addition to the updated stripped quantum circuit and the complex conjugate transposition of the updated initial matrix. Therefore, the performance cost is to be assessed in step /vi/ of each iteration of the sequence of steps /i/ to /vii/ also taking into account the complex conjugate transposition of the updated final matrix as resulting from step /iii/ of this iteration.
The invention advantages mentioned above for the case of observable value calculation apply identically to the present case of bit string sampling. In particular, the iteration number of the sequence of steps /i/ to /vii/ may again be between 2 and 50, advantageously between 5 and 20.
For bit strip sampling, the invention method also comprises the following additional steps /1′/ and /2′/ further to steps /1/ and /2/, using the updated final matrix and the updated initial matrix as resulting from the selected iteration:
In this way, the quantum computer is optimized for participating in sampling the bit string when provided with the completed circuit as resulting from step /2′/.
Steps /1′/ and /2′/ are also to be executed by the classical computer.
For such application of the invention to bit string sampling, the performance cost assessed in step /vi/ of each iteration of the sequence of steps /i/ to /vii/ may be the sum of the first and second implementation costs plus a third one relating to the complex conjugate transposition of the updated final matrix. In a similar way to the first and second implementation costs, the third one may also increase with the number of entangling gates that are involved for implementing the complex conjugate transposition of the final matrix, and possibly also increase with the separating distances existing between Josephson junctions used in the quantum computer, the calculation time, the error rate of the program, etc. In particular, the third implementation cost, namely that related to implementing the complex conjugate transposition of the final matrix, may equal the number of entangling gates in the corresponding quantum circuit.
For performing bit string sampling, the method may further comprise, using the updated final matrix, the updated initial matrix and the updated stripped circuit as resulting from the selected iteration of steps /i/ to /vii/:
Step /4′/ may be executed using the classical computer, i.e. non-quantum computer, and step /5′/ may be executed by the quantum computer or both the classical and quantum computers in combination.
Preferably, for allowing sampling all the qubits from one and same n-qubit, a diagonalizing Clifford operator may be implemented in the following manner:
For such implementation, the diagonalizing Clifford operator is selected so that the completed sixth product is a diagonal operator. The diagonalizing Clifford operator may be generated by the classical computer and executed on the quantum computer.
Possibly, step /5′/ may comprise the following substeps, using the updated final matrix, the updated initial matrix and the updated stripped circuit as resulting from the selected iteration of steps /i/ to /vii/:
Substeps /5′-1/ and /5′-2/ can be executed by the classical computer, i.e. the quantum operation of the completed sixth product is emulated classically.
Generally for the invention, the observable value or the sampled bit string may be useful in an application pertaining to at least one field selected among chemistry including quantum chemistry, biochemistry, medicines, physics including quantum physics, biophysics, combinatorial optimization, applications based on artificial intelligence, etc.
In particular, the observable may be one among an energy of a molecule, an evaluation of a combinatorial cost function on a superposition of solutions, etc.
A second aspect of the invention proposes a computer program product that comprises instructions for executing the method of the first invention aspect, when this computer program product is implemented by a computer. This computer may be a classical one, i.e. non-quantum, for executing at least the steps /i/ to /vii/, /1/, /2/, /1′/, /2′/, and /4/ or /4′/. When the program is executed by the quantum computer, it comprises at least step /3/ or /3′/.
In the present description, the quantum base state |0> is taken by convention as an initial quantum state to be used for the invention, but it may be replaced by the quantum base state |1>or any other quantum state which is preferably a stabilizer state. The quantum states considered herein are n-qubits except indicated otherwise, where n is the number of qubits used for the quantum calculation through tensor product, also commonly called number of particles in the system.
Also generally in the present description, quantum computer denotes an actual quantum computer but may also denote an emulated quantum computer which is implemented on a classical, i.e. non-quantum, computer.
The invention is first described with reference to
For connexion with the general part of the present description, the following notations are used in the pseudo-code of
The successive lines of the pseudo-code of Algorithm 1 as displayed in
At this stage, the program for calculating the observable value has been compiled in an optimized manner for reducing the number of entangling gates.
After each iteration of the sequence of lines 6 to 11, the observable value <0|U†HU|0> with U being initially the target quantum circuit, equals to (<0|CI)U†(CF†HCF)U(CI†|0>) with CF, U and CI now as recovered upon executing line 13. All CI- and CF matrices involved in the successive iterations are Clifford operators too.
Then a quantum computer is provided with the circuit combination produced upon executing line 14. The quantum computer thus obtained suits for calculating the observable value while implementing minimum number of entangling gates.
Thereafter, for performing the calculation of the observable value for the initial quantum state |0>, one uses the quantum computer with the initial quantum state |0> (step /3/ of the general part of the present description). It returns then UCI†|0>, UCI† called fifth product.
A non-quantum computer is used in addition to compute the operator CF†HCF, called sixth product (step /4/ of the general part of the present description).
Finally, combining the results delivered by the quantum computer for UCI†|0> and by the non-quantum computer for CF†HCF provides the result of the energy sampling.
Such implementation that includes compilation and calculation is illustrated in
In a known manner, the final quantum state U|0> is comprised of n qubits which are combined through tensor product and thus form a n-qubit. Characterization of this n-qubit produces a bit string of n bits. The issue may also be sampling the bit string, and appropriate compilation for this is provided by the algorithm displayed in
After each iteration of the sequence of lines 6 to 11, the sampling of the bit string is to be performed out of the quantum state CF(CF†ZiCF)CF†UCI†|0>, where Zi denotes the sampling operator acting on qubit i only, also commonly noted σz(i), where σz is the 2×2 Z-Pauli matrix and integer i is comprised between 1 and n, both limits 1 and n included. Thus, sampling the final quantum state U|0> with sampling operator Zi is equivalent to sampling the quantum state CF†UCI†|0> with operator CF†ZiCF using CF, U and CI as recovered upon executing algorithm line 13.
However, for allowing sampling of each of the n qubits out of the n-qubit, it is necessary to replace the operators CF†ZiCF with i varying from 1 to n by other operators that are all diagonal. This is obtained by using a diagonalizing Clifford operator Cdiag such that the operators to be used are now Cdiag(CF†ZiCF)Cdiag† which are diagonal. Such diagonal operators are then to be used with the modified quantum state CdiagCF†UCI†|0>. The diagonalizing Clifford operator Cdiag exists because all the operators considered commute and thus can be diagonalized in one and same base. The Man skilled in the art knows how to select the diagonalizing Clifford operator Cdiag. In particular, theory provides that this diagonalizing Clifford operator Cdiag can be obtained by applying the second algorithm B to the final matrix CF†. Indeed, one can show that any synthesis procedure constructing a circuit that prepares a stabilizer state can be used to co-diagonalize a family of Pauli operators.
As a result, sampling each operator Zi on the final state U|0> with U being the target quantum circuit is equivalent to sampling the operator Di=Cdiag(CF†ZiCF)Cdiag† on the quantum state CdiagCF†UCI†|0>, Di being a diagonal Pauli operator. In this statement, equivalency means that the statistics that result separately from both sampling operations are the same. In this way, <0|U†ZiU|0>=<0|CIU†CFCdiag†DiCdiagCF†UCI†|0>.
As shown in
However, practically it may be difficult reading simultaneously all the sampled values out of the same quantum state DiCdiagCF†UCI†|0> for i from 1 to n. Instead, the Di-operators may be emulated by the classical computer 10 from the bit string sampled out of the quantum state CdiagCF†UCI†|0>. In this way, correlations between the sampled values of the bit string are restored. Such emulation may be performed in the following way:
Such invention implementation for bit string sampling is shown in
The diagram of
The vertical axis indicates the numbers of entangling gates, and the horizontal axis indicates the number n of qubits which are combined through tensor product. It is clear that algorithm 1 leads to further reduction in the number of entangling gates in each case.
Number | Date | Country | Kind |
---|---|---|---|
22305532.8 | Apr 2022 | EP | regional |