Quantum circuit weight reduction program, information processing device, and quantum circuit weight reduction method
The quantum circuit lightweighting method addresses noise-induced errors in VQE by reducing the number of CNOT gates, enhancing the accuracy of quantum chemical calculations for drug discovery and material development.
Patent Information
- Application Number
- PCT/JP2024/009240
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-14
- Filing Date
- 2024-03-11
- Publication Date
- 2024-10-17
AI Technical Summary
Quantum chemical calculations using VQE are prone to errors due to noise, particularly in NISQ devices, where the high error rate of CNOT gates increases with the number of CNOT gates in the quantum circuit, affecting the accuracy of medium-scale quantum devices.
A quantum circuit lightweighting method that identifies and deletes Rz gates and their associated CNOT gates from the quantum circuit, reducing the number of CNOT gates and thereby minimizing errors caused by noise, while maintaining the accuracy of quantum chemical calculations.
The method reduces errors in VQE due to noise, enabling highly accurate quantum chemical calculations by decreasing the number of CNOT gates, which contributes to improved precision in drug discovery and new material development.
Smart Images

Figure JP2024009240_17102024_PF_FP_ABST
Abstract
Description
Quantum circuit lightweighting program, information processing device, and quantum circuit lightweighting method
[0001] The present invention relates to a quantum circuit weight reduction program, an information processing device, and a quantum circuit weight reduction method.
[0002] Quantum chemical calculation is a method for calculating the energy of a molecule to analyze its structure and properties from its electronic state. One quantum chemical calculation algorithm is the Variational Quantum Eigensolver (VQE). VQE is also one of the candidate variational algorithms that can be run on intermediate-scale quantum devices without error correction (sometimes called Noisy Intermediate-Scale Quantum (NISQ)).
[0003] In VQE, a trial wave function representing the electronic state of a molecule is expressed using a quantum circuit having the rotation angle of a rotation gate as a parameter. Such a quantum circuit or trial wave function is sometimes called an ansatz. The energy of the molecule is then calculated using such a quantum circuit. Parameter optimization using classical processing and energy calculation processing using a quantum circuit are repeated to minimize this energy. The accuracy and computational complexity of VQE depend heavily on the type of ansatz. One ansatz that allows for highly accurate calculations is the UCCSD (Unitary Coupled Cluster Singles and Doubles) ansatz.
[0004] Conventionally, quantum circuit optimization techniques have been proposed that reduce quantum resources by merging Pauli terms, re-embedding quantum resources, or merge sorting (see, for example, Patent Document 1).
[0005] International Publication No. 2020 / 118285
[0006] In NISQ, noise-induced errors can increase the error of VQE. Because the error rate of CNOT gates is particularly high among quantum gates, the increase in error due to noise increases as the number of CNOT gates in a quantum circuit increases.
[0007] In one aspect, the present invention aims to reduce errors in VQE due to errors caused by noise.
[0008] In one embodiment, a quantum circuit lightweighting program is provided that causes a computer to execute processing to acquire first quantum circuit information and the number of Rz gates for each angle parameter, the first quantum circuit representing a first quantum circuit used in VQE, the first quantum circuit including a plurality of Rz gates and a plurality of CNOT gates associated with each of the plurality of Rz gates; identify an Rz gate to be deleted from the plurality of Rz gates included in the first quantum circuit based on the first quantum circuit information and the number of Rz gates; generate second quantum circuit information representing a second quantum circuit in which the identified Rz gate and the CNOT gate associated with the identified Rz gate have been deleted from the first quantum circuit; and output the second quantum circuit information.
[0009] In one embodiment, an information processing device is provided. In another embodiment, a quantum circuit lightweighting method is provided.
[0010] In one aspect, the error in VQE due to noise-induced error can be reduced.
[0011] 1 is a diagram for explaining an information processing apparatus according to a first embodiment. It is a diagram showing an example of a first quantum circuit. It is a diagram showing the relationship between the number of CNOT gates and the error for a simulation without noise and a simulation with noise. It is a diagram showing an example of a second quantum circuit. It is a block diagram showing an example of hardware of an information processing apparatus according to a second embodiment. It is a block diagram showing an example of the functions of the information processing apparatus. It is a diagram showing an example of a connection of physical quantum bits and an example of a quantum circuit before and after transpiling. It is a flowchart showing an example of a processing procedure of a quantum circuit lightweighting method. It is a flowchart showing an example of a procedure for identifying an Rz / CNOT group. It is a flowchart showing an example of a procedure for identifying an Rz gate to be deleted. It is a flowchart showing an example of a procedure for adding a CNOT gate to a deletion list. It is a diagram showing an example of the correlation between rz_per_param, the error, and the number of CNOT gates. It is a diagram showing an example of the effect of the quantum circuit lightweighting method according to the second embodiment.
[0012] DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. First Embodiment Fig. 1 is a diagram for explaining an information processing apparatus according to a first embodiment.
[0013] 2 is a diagram illustrating an example of a first quantum circuit. The information processing device 10 according to the first embodiment reduces the VQE error due to noise-induced errors by reducing the weight of the quantum circuit through processing described below. The information processing device 10 may be a client device or a server device. The information processing device 10 may also be referred to as a computer.
[0014] The information processing device 10 has a storage unit 11 and a processing unit 12. The storage unit 11 may be a volatile semiconductor memory such as a random access memory (RAM), or a non-volatile storage such as a hard disk drive (HDD) or flash memory. The processing unit 12 is a processor such as a central processing unit (CPU), a graphics processing unit (GPU), or a digital signal processor (DSP). However, the processing unit 12 may also include an electronic circuit such as an application specific integrated circuit (ASIC) or a field programmable gate array (FPGA). The processor executes a program stored in a memory such as a RAM (which may be the storage unit 11). A set of processors may be called a multiprocessor or simply a "processor."
[0015] The storage unit 11 stores first quantum circuit information representing the first quantum circuit 13a used in VQE. The storage unit 11 may store second quantum circuit information representing the second quantum circuit. The second quantum circuit is a lightweight version of the first quantum circuit 13a obtained by processing described below. The storage unit 11 may store the number of Rz gates for each angle parameter described below.
[0016] A part of the first quantum circuit 13a is shown in Fig. 1. The whole of the first quantum circuit 13a is shown in Fig. 2. The example of the first quantum circuit 13a shown in Figs. 1 and 2 has four quantum bits q 0 ~q 3 Hydrogen (H 2 ) molecule. In FIG. 2, the qubit q 0 ~q 3 The quantum operations performed by various quantum gates on are shown in four rows from the top left to the bottom right. The right end of each row is connected to the left end of the next row.
[0017] In the first quantum circuit 13a, 3 " is a rotation operation based on three angular parameters θ, φ, and λ for a quantum state on the Bloch sphere. 3 These are gates. "S" is an S gate that rotates a quantum state on the Bloch sphere by φ = π / 2. "S" with a superscript dagger is an S dagger gate that rotates a quantum state on the Bloch sphere by φ = -π / 2. "H" is a Hadamard gate that rotates a quantum state on the Bloch sphere by 180° around an axis tilted 45° between the Z and X axes. "Rz" is an Rz gate that rotates a quantum state on the Bloch sphere by θ around the Z axis. "+" is a CNOT gate that inverts the value of the target qubit if the control qubit is |1>. The CNOT gate generates quantum entanglement between two qubits.
[0018] 1 and 2, the angle parameters of the Rz gates are represented by parameters P0, P1, and P2. In the example of Fig. 2, there are two Rz gates that perform rotation operations using parameter P0, two Rz gates that perform rotation operations using parameter P1, and eight Rz gates that perform rotation operations using parameter P2.
[0019] As shown in Figures 1 and 2, Rz gates are associated with a group of CNOT gates. Two CNOT gates are associated with each of the two Rz gates of parameter P0, and two CNOT gates are associated with each of the two Rz gates of parameter P1. Six CNOT gates are associated with each of the eight Rz gates of parameter P2.
[0020] The processing unit 12 acquires first quantum circuit information representing the first quantum circuit 13 a and the Rz gate number for each angle parameter. The processing unit 12 acquires the first quantum circuit information and the Rz gate number for each angle parameter, for example, from the storage unit 11. The processing unit 12 may acquire the first quantum circuit information or the Rz gate number for each angle parameter input from outside the information processing device 10.
[0021] The number of Rz gates for each angle parameter is an input value specified by the user, and is denoted as "rz_per_param" in FIG.
[0022] In an ideal simulation calculation without noise, the more Rz gates there are for each angular parameter, the smaller the error, since the more fine-tuning of the angular parameter is possible. However, in an actual quantum device with noise, when the number of Rz gates is large, the error tends to increase due to noise. This is because when the number of Rz gates is large, the number of CNOT gates associated with the Rz gates also increases. As mentioned above, the error rate of CNOT gates is particularly high, so the increase in error due to noise increases the more CNOT gates there are in a quantum circuit.
[0023] 3 shows the relationship between the number of CNOT gates and the error for a noise-free simulation and a noise-containing simulation. The noise-containing simulation uses a noise model based on a quantum device with limited connections between physical quantum bits. A quantum circuit for such a quantum device may have a larger number of CNOT gates than the quantum circuit before transpiling (e.g., the first quantum circuit 13a) when transpiled (see FIG. 7 described below). For this reason, the number of CNOT gates in the noise-containing model is greater than that in the noise-free model.
[0024] In the example of FIG. 3, the ansatz of LiH (lithium hydride) is used. The basis set used is STO-3G. dist = 1.0 indicates that the interatomic distance between the lithium atom and the hydrogen atom is 1.0 Å. The error is the difference between the ground state energy of LiH obtained by the Full Configuration Interaction method and the ground state energy of LiH obtained by VQE.
[0025] In the example of FIG. 3, four types of ansats are used: UCCSD, PUCCD (Parallel Unitary Coupled Cluster Doubles), SUCCD (Symmetric Unitary Coupled Cluster Doubles), and CHC (Compact Heuristic for Chemistry).
[0026] In quantum chemistry calculations, it is preferable to keep the error within chemical precision. Keeping the error within chemical precision corresponds to keeping the error smaller than 1.6 mHartree. In a noise-free simulation, when a UCCSD ansatz with a larger number of CNOT gates than other ansatz is used, the error is kept within chemical precision. However, in a noise-containing simulation, the error increases more significantly with the number of CNOT gates used. In the example of Figure 3, the UCCSD ansatz with the highest precision in the noise-free simulation has the largest error compared to the other ansatz.
[0027] As described above, the number of CNOT gates that cause such an increase in error increases as the number of Rz gates increases. Therefore, in the information processing device 10 shown in Figure 1, the processing unit 12 reduces the number of Rz gates as follows, thereby reducing the number of CNOT gates associated with the Rz gates and reducing VQE errors due to errors caused by noise.
[0028] The processing unit 12 identifies Rz gates to be deleted from the first quantum circuit 13 a based on the acquired first quantum circuit information and rz_per_param. For example, if rz_per_param=1 for all of the parameters P0 to P2, the processing unit 12 identifies all but one Rz gate for each of the parameters P0 to P2 as Rz gates to be deleted.
[0029] Then, the processing unit 12 generates second quantum circuit information representing the second quantum circuit 13b obtained by deleting the identified Rz gate and the CNOT gate associated with the identified RZ gate from the first quantum circuit 13a.
[0030] Fig. 4 is a diagram showing an example of a second quantum circuit. Note that a part of the second quantum circuit 13b is also shown in Fig. 1. The examples of Fig. 1 and Fig. 4 show examples of deleting Rz gates and CNOT gates when all but one Rz gate is identified as a deletion target for each of the parameters P0 to P2 of the first quantum circuit 13a shown in Fig. 2.
[0031] When there are multiple Rz gates with a certain angle parameter, the processing unit 12, for example, in the first quantum circuit 13a, 0 ~q 3 The earlier an Rz gate acts on the calculation result, the more priority it is given to the deletion target. This is because the later an Rz gate acts, the more important it is to the calculation result. However, the processing unit 12 may specify the Rz gate to be deleted with priority according to another rule.
[0032] 1 and 4, the second quantum circuit 13b, which has been lightened by the above method, has one Rz gate for each of the parameters P0 to P2. The number of CNOT gates is 10 in the second quantum circuit 13b, compared to 56 in the first quantum circuit 13a.
[0033] Thereafter, the processing unit 12 outputs second quantum circuit information representing the second quantum circuit 13 b. The processing unit 12 may store the second quantum circuit information in a non-volatile storage, display it on a display device, or transmit it to another information processing device.
[0034] As described above, the processing unit 12 of the information processing device 10 acquires first quantum circuit information representing a first quantum circuit 13a used for VQE, the first quantum circuit 13a including a plurality of Rz gates and a plurality of CNOT gates associated with each of the Rz gates. The processing unit 12 also acquires the number of Rz gates for each angle parameter. Furthermore, the processing unit 12 identifies Rz gates to be deleted from the first quantum circuit 13a based on the first quantum circuit information and the number of Rz gates. The processing unit 12 then generates second quantum circuit information representing a second quantum circuit 13b obtained by deleting the identified Rz gates and the CNOT gates associated with the identified Rz gates from the first quantum circuit 13a, and outputs the second quantum circuit information.
[0035] This process results in a second quantum circuit with a reduced number of CNOT gates, which reduces noise-induced errors when the second quantum circuit is implemented in an actual quantum device such as NISQ and VQE is performed, enabling highly accurate quantum chemical calculations that will contribute to drug discovery and new material development.
[0036] Second Embodiment Next, a second embodiment will be described. Fig. 5 is a block diagram showing an example of hardware of an information processing apparatus according to the second embodiment.
[0037] The information processing device 20 may be a client device or a server device. The information processing device 20 may also be called a computer. The information processing device 20 has a CPU 21, a RAM 22, an HDD 23, a GPU 24, an input interface 25, a medium reader 26, and a communication interface 27, all connected via a bus. The CPU 21 corresponds to the processing unit 12 in the first embodiment. The RAM 22 or the HDD 23 corresponds to the storage unit 11 in the first embodiment.
[0038] The CPU 21 is a processor that executes program instructions. The CPU 21 loads the program and data stored in the HDD 23 into the RAM 22 and executes the program. The information processing device 20 may have multiple processors.
[0039] The RAM 22 is a volatile semiconductor memory that temporarily stores programs executed by the CPU 21 and data used in calculations by the CPU 21. The information processing device 20 may include a type of volatile memory other than RAM.
[0040] The HDD 23 is a non-volatile storage that stores software programs such as an operating system (OS), middleware, and application software, as well as data. The information processing device 20 may also have other types of non-volatile storage, such as a flash memory or an SSD (Solid State Drive).
[0041] The GPU 24 performs image processing in cooperation with the CPU 21 and outputs an image to a display device 24a connected to the information processing device 20. The display device 24a is, for example, a CRT (Cathode Ray Tube) display, a liquid crystal display, an organic EL (Electro Luminescence) display, or a projector. Other types of output devices, such as a printer, may also be connected to the information processing device 20.
[0042] The GPU 24 may also be used as a general purpose computing on graphics processing unit (GPGPU). The GPU 24 may execute a program in response to an instruction from the CPU 21. The information processing device 20 may have a volatile semiconductor memory other than the RAM 22 as a GPU memory.
[0043] The input interface 25 receives an input signal from an input device 25a connected to the information processing device 20. The input device 25a is, for example, a mouse, a touch panel, or a keyboard. A plurality of input devices may be connected to the information processing device 20.
[0044] The medium reader 26 is a reading device that reads programs and data recorded on a recording medium 26a. The recording medium 26a is, for example, a magnetic disk, an optical disk, or a semiconductor memory. Magnetic disks include flexible disks (FDs) and HDDs. Optical disks include compact discs (CDs) and digital versatile discs (DVDs). The medium reader 26 copies the programs and data read from the recording medium 26a to other recording media such as the RAM 22 or the HDD 23. The read programs may be executed by the CPU 21.
[0045] The recording medium 26a may be a portable recording medium. The recording medium 26a may be used to distribute programs and data. The recording medium 26a and the HDD 23 may also be called computer-readable recording media.
[0046] The communication interface 27 communicates with other information processing devices via a network 27 a. The communication interface 27 may be a wired communication interface connected to a wired communication device such as a switch or a router, or may be a wireless communication interface connected to a wireless communication device such as a base station or an access point.
[0047] Next, the functions of the information processing device 20 will be described. Fig. 6 is a block diagram showing an example of the functions of the information processing device. The information processing device 20 has an input unit 31, a first quantum circuit information storage unit 32, a deletion target Rz / CNOT gate identification unit 33, a group list storage unit 34, a swap number list storage unit 35, an Rz retention list storage unit 36, an Rz deletion list storage unit 37, and a deletion list storage unit 38. Furthermore, the information processing device 20 has an Rz / CNOT gate deletion unit 39, a second quantum circuit information storage unit 40, and an output unit 41.
[0048] Each of the storage units is implemented using, for example, the RAM 22 or the HDD 23. The input unit 31, the deletion target Rz / CNOT gate specifying unit 33, the Rz / CNOT gate deletion unit 39, and the output unit 41 are implemented using, for example, the CPU 21 and a program.
[0049] The input unit 31 receives input data such as first quantum circuit information representing a first quantum circuit to be weighted down and the aforementioned rz_per_param. As shown in FIGS. 1 and 2 , the first quantum circuit includes a plurality of Rz gates and a plurality of CNOT gates associated with each of the Rz gates, and is used in VQE. The input unit 31 may also receive physical quantum bit connection information, which will be described later, as input data. The first quantum circuit information, rz_per_param, or physical quantum bit connection information may be input via, for example, a recording medium 26a or a network 27a. The rz_per_param or physical quantum bit connection information may be input by a user operating the input device 25a. The information processing device 10 may generate the first quantum circuit information.
[0050] The first quantum circuit information storage unit 32 stores first quantum circuit information. The Rz / CNOT gate to be deleted identification unit 33 identifies an Rz gate and a CNOT gate to be deleted from the first quantum circuit.
[0051] The group list storage unit 34 stores a list of groups (hereinafter referred to as a group list) consisting of each Rz gate included in the first quantum circuit and its associated CNOT gate group. The group list can be expressed, for example, as {Rz-ID: [CNOT-ID, ...], ...}. Rz-ID is the ID of the Rz gate, and CNOT-ID is the ID of multiple CNOT gates associated with that Rz gate. These IDs are obtained from the first quantum circuit information.
[0052] The swap number list storage unit 35 stores the physical quantum bit connection information and a list of the number of swap gates associated with each Rz gate obtained from the first quantum circuit information (hereinafter referred to as the swap number list). The swap number list can be expressed, for example, as {Rz-ID: number of swap gates, ...}. Swap gates will be described later.
[0053] The Rz retention list storage unit 36 stores a list of the number of Rz gates retained determined for each angle parameter (hereinafter referred to as the Rz retention list). The Rz retention list can be expressed as {parameter ID: counter value, ...}. The parameter ID is the ID of the angle parameter. The counter value is the value of a counter that counts the number of Rz gates retained.
[0054] The Rz deletion list storage unit 37 stores a list of Rz gates to be deleted (hereinafter referred to as the Rz deletion list). The Rz deletion list can be represented by the IDs of the Rz gates to be deleted.
[0055] The deletion list storage unit 38 stores a list of Rz gates and CNOT gates to be deleted (hereinafter referred to as a deletion list). The deletion list can be represented by the IDs of the Rz gates and CNOT gates to be deleted.
[0056] The Rz / CNOT gate deletion unit 39 generates second quantum circuit information representing a second quantum circuit obtained by deleting the Rz gate and the CNOT gate from the first quantum circuit according to the deletion list. The second quantum circuit information storage unit 40 stores the generated second quantum circuit information.
[0057] The output unit 41 outputs the second quantum circuit information. For example, the output unit 41 may output the second quantum circuit information to the display device 24 a for display. The output unit 41 may also transmit the second quantum circuit information to another information processing device via the network 27 a.
[0058] 7 is a diagram showing an example of a connection of physical qubits and an example of a quantum circuit before and after transpiling. In the example of FIG. 7, an example of a connection of physical qubits in a four-qubit quantum device (four-qubit device) is shown. Qubit q 0 is the quantum bit q 1 and the quantum bit q 1 is further divided into qubits q 2 is connected to the qubit q 2 is further divided into qubits q 3 In other words, there is a direct coupling between the nearest qubits, creating a quantum connection.
[0059] 7 shows an example of a four-qubit quantum circuit 50 before transpiling, including an Rz gate and a CNOT gate. The two CNOT gates associated with the Rz gate on the left transpile the qubit q 0 , q 1 The quantum device with the above connection example generates quantum entanglement between qubit q 0 , q 1 are quantum connected, so the qubit q 0 , q 1 A CNOT gate can be implemented to generate quantum entanglement between
[0060] However, in quantum circuit 50, the two CNOT gates associated with the Rz gate on the right side are 0 , q 3 The quantum device with the above connection example generates quantum entanglement between qubit q 0 , q 3 is not quantum connected, so as it is, the qubit q 0 , q 3Therefore, quantum circuit 50 is converted (called transpiling) into a quantum circuit that corresponds to the connection state of the physical qubits as described above.
[0061] In the quantum circuit 51 after the conversion, the Rz gate on the right side has a quantum bit q 0 , q 1 The Rz gate on the right is accompanied by two CNOT gates that generate quantum entanglement between the qubit q 2 , q 3 Swap gates 51a and 51b that swap quantum states between the quantum bit q 1 , q 2 Each of the swap gates 51a to 51d is composed of three CNOT gates.
[0062] 7, when the Rz gate on the left side is deleted, two CNOT gates associated with that Rz gate can be deleted. On the other hand, when the Rz gate on the right side is deleted, two CNOT gates associated with that Rz gate can be deleted in the quantum circuit 50. However, when considering the quantum circuit 51 after transformation, when the Rz gate on the right side is deleted, 2 + 3 × 4 = 14 CNOT gates can be deleted.
[0063] For this reason, the information processing device 20 may preferentially identify Rz gates, which will have a larger number of associated swap gates after transpiling, as targets for deletion based on the physical quantum bit connection information that represents the connection state of the physical quantum bits of the quantum device described above.
[0064] Next, a processing procedure of the quantum circuit lightweighting method by the information processing device 20 will be described. Fig. 8 is a flowchart showing an example of the processing procedure of the quantum circuit lightweighting method. (Step S10) When the quantum circuit lightweighting process starts, the deletion target Rz / CNOT gate identification unit 33 of the information processing device 20 acquires input data (first quantum circuit information, rz_per_param). When physical quantum bit connection information is input, the deletion target Rz / CNOT gate identification unit 33 also acquires the physical quantum bit connection information as input data.
[0065] (Step S11) The deletion target Rz / CNOT gate identification unit 33 initializes the deletion list stored in the deletion list storage unit 38 to empty. (Step S12) The deletion target Rz / CNOT gate identification unit 33 identifies groups consisting of Rz gates and associated CNOT gate groups and records them in a group list. If there is physical quantum bit connection information, the deletion target Rz / CNOT gate identification unit 33 records the number of swap gates for each group in a swap number list. A specific example of the processing in step S12 will be described later.
[0066] (Step S13) The deletion target Rz / CNOT gate specifying unit 33 specifies an Rz gate to be deleted and adds it to the deletion list. A specific example of the process of step S13 will be described later.
[0067] (Step S14) The deletion target Rz / CNOT gate specifying unit 33 adds the CNOT gate in the same group as the deletion target Rz gate to the deletion list. A specific example of the process in step S14 will be described later.
[0068] (Step S15) The Rz / CNOT gate deletion unit 39 deletes the Rz gate and the CNOT gate in the deletion list from the first quantum circuit. (Step S16) The output unit 41 outputs second quantum circuit information representing the second quantum circuit obtained by deleting the Rz gate and the CNOT gate from the first quantum circuit. This completes the processing of the information processing device 20.
[0069] Fig. 9 is a flowchart showing an example of a procedure for identifying an Rz / CNOT group. Fig. 9 shows an example of the processing procedure of step S12 shown in Fig. 8. (Step S20) The deletion target Rz / CNOT gate identifying unit 33 initializes the group list and the swap number list to empty.
[0070] (Step S21) The deletion target Rz / CNOT gate identification unit 33 acquires an Rz-ID list and a CNOT-ID list. The Rz-ID list is a list of IDs (Rz-ID) of Rz gates included in the first quantum circuit. The CNOT-ID list is a list of IDs (CNOT-ID) of CNOT gates included in the first quantum circuit. The Rz-ID list and the CNOT-ID list are included in the first quantum circuit information.
[0071] (Step S22) The deletion target Rz / CNOT gate specifying unit 33 determines whether the Rz-ID list is empty. If the deletion target Rz / CNOT gate specifying unit 33 determines that the Rz-ID list is not empty, it performs the process of step S23, and if it determines that the Rz-ID list is empty, it performs the process of step S27.
[0072] (Step S23) The deletion target Rz / CNOT gate identification unit 33 extracts the first ID (Rz-ID) from the Rz-ID list. (Step S24) The deletion target Rz / CNOT gate identification unit 33 extracts the ID (CNOT-ID) of a CNOT gate or a CNOT gate group adjacent to the Rz gate of the extracted Rz-ID from the CNOT-ID list based on the first quantum circuit information. Then, the deletion target Rz / CNOT gate identification unit 33 adds the extracted Rz-ID and CNOT-ID to the group list as an ID group belonging to one group.
[0073] (Step S25) The deletion target Rz / CNOT gate specifying unit 33 determines whether or not there is physical quantum bit connection information. If the deletion target Rz / CNOT gate specifying unit 33 determines that there is physical quantum bit connection information, it performs the process of step S26, and if it determines that there is no physical quantum bit connection information, it returns to the process of step S22.
[0074] (Step S26) The deletion target Rz / CNOT gate identification unit 33 records the Rz-ID and the number of swap gates extracted in the processing of step S23 in the swap list. The number of swap gates is calculated based on the physical quantum bit connection information and the CNOT gate or CNOT gate group added to the group list in the processing of step S24.
[0075] For example, the quantum bit q shown in FIG. 0 ~q 3 If the first quantum circuit before weight reduction is quantum circuit 50 as shown in FIG. 7, the CNOT gate associated with the Rz gate on the right side is connected to the quantum bit q 0 ,q 3 If the distance between adjacent quantum bits is 1, then quantum bit q 0 ,q 3 The distance between them is 3. The value obtained by subtracting 1 from this distance is the number of swap gates that will be generated for that CNOT gate after transpiling.
[0076] After the process of step S26, the process of step S22 is performed again. (Step S27) The deletion target Rz / CNOT gate identification unit 33 determines whether or not there is physical quantum bit connection information. If the deletion target Rz / CNOT gate identification unit 33 determines that there is physical quantum bit connection information, it performs the process of step S28, and if it determines that there is no physical quantum bit connection information, it performs the process of step S30.
[0077] (Step S28) The deletion target Rz / CNOT gate identification unit 33 sorts the swap number list in ascending order by the number of swap gates. Therefore, the Rz-ID of an Rz gate with a smaller number of associated swap gates after transpiling is closer to the top of the swap number list.
[0078] (Step S29) The deletion target Rz / CNOT gate identification unit 33 copies the Rz-IDs of the sorted swap number list as an Rz-ID list. (Step S30) The deletion target Rz / CNOT gate identification unit 33 sorts the group list in descending order by Rz-ID. Note that the earlier an Rz gate acts on a quantum bit in the first quantum circuit, the smaller the Rz-ID assigned to that gate. Therefore, the later the Rz-ID of an Rz gate that acts on a quantum bit, the closer it is to the beginning of the group list.
[0079] (Step S31) The deletion target Rz / CNOT gate specifying unit 33 copies the Rz-IDs of the sorted group list as an Rz-ID list. After the processing of step S29 or step S31, the Rz / CNOT group specifying processing (the processing of step S12 in FIG. 8) ends.
[0080] By the above process, the Rz-ID of an Rz gate with fewer swap gates after transpiling is closer to the beginning of the Rz list. Alternatively, the Rz-ID of an Rz gate that acts on a quantum bit later is closer to the beginning of the Rz list.
[0081] Fig. 10 is a flowchart showing an example of a procedure for identifying an Rz gate to be deleted. Fig. 10 shows an example of the processing procedure of step S13 shown in Fig. 8. (Step S40) The deletion target Rz / CNOT gate identifying unit 33 initializes the Rz holding list to empty.
[0082] (Step S41) The deletion target Rz / CNOT gate specifying unit 33 determines whether the Rz-ID list obtained in the process of the above-mentioned step S29 or step S31 is empty. If the deletion target Rz / CNOT gate specifying unit 33 determines that the Rz-ID list is not empty, it performs the process of step S42, and if it determines that the Rz-ID list is empty, it ends the process of specifying the Rz gate to be deleted.
[0083] (Step S42) The deletion target Rz / CNOT gate identifying unit 33 extracts the first ID (Rz-ID) from the Rz list. (Step S43) The deletion target Rz / CNOT gate identifying unit 33 acquires the ID (parameter ID) of the angle parameter associated with the Rz gate with the first ID from the first quantum circuit information. When the first quantum circuit 13a shown in FIG. 1 is used, first, the parameter ID of the parameter P0 associated with the Rz gate on the left side is acquired.
[0084] (Step S44) The deletion target Rz / CNOT gate specifying unit 33 determines whether the acquired parameter ID is in the Rz holding list. If the deletion target Rz / CNOT gate specifying unit 33 determines that the acquired parameter ID is not in the Rz holding list, it performs the process of step S45. If the deletion target Rz / CNOT gate specifying unit 33 determines that the acquired parameter ID is in the Rz holding list, it performs the process of step S47.
[0085] (Step S45) The deletion target Rz / CNOT gate specifying unit 33 registers the acquired parameter ID in the Rz holding list. (Step S46) The deletion target Rz / CNOT gate specifying unit 33 sets the value of the counter that counts the number of held Rz gates linked to the angle parameter of the acquired parameter ID to 1, and returns to the processing of step S41.
[0086] (Step S47) The deletion target Rz / CNOT gate identifying unit 33 determines whether the counter value of the Rz gate linked to the angle parameter of the acquired parameter ID is smaller than rz_per_param. If the deletion target Rz / CNOT gate identifying unit 33 determines that the counter value is smaller than rz_per_param, it performs the process of step S48. If the deletion target Rz / CNOT gate identifying unit 33 determines that the counter value is equal to or greater than rz_per_param, it performs the process of step S49.
[0087] (Step S48) The deletion target Rz / CNOT gate specifying unit 33 increments the counter value by 1. As a result, the number of retained Rz gates is increased by 1. (Step S49) The deletion target Rz / CNOT gate specifying unit 33 adds the Rz-ID extracted in the processing of step S42 to the deletion list.
[0088] After the processes of steps S48 and S49, the process of step S41 is performed again. By the above processes, the Rz-IDs of Rz gates whose number is calculated by subtracting the product of rz_per_param and the number of parameters in the first quantum circuit 13a from the total number of Rz gates are added to the deletion list.
[0089] In the process of step S42, Rz-IDs are extracted from the top of the Rz-ID list, so the Rz-IDs at the end of the Rz-ID list are more likely to be added to the deletion list. As mentioned above, the Rz-ID of an Rz gate with fewer swap gates associated with it after transpiling is closer to the top of the Rz list. Alternatively, the Rz-ID of an Rz gate that acts on a quantum bit later is closer to the top of the Rz list.
[0090] Therefore, the Rz-ID of an Rz gate with a larger number of associated swap gates after transpiling is more likely to be added to the deletion list. In other words, the Rz gate with a larger number of associated swap gates after transpiling is prioritized as a deletion target.
[0091] Furthermore, the earlier an Rz gate acts on a quantum bit, the more likely it is to be added to the deletion list. In other words, the earlier an Rz gate acts on a quantum bit, the more likely it is to be deleted.
[0092] 11 is a flowchart showing an example of a procedure for adding a CNOT gate to the deletion list. Fig. 11 shows an example of the processing procedure of step S14 shown in Fig. 8. (Step S50) The deletion target Rz / CNOT gate specifying unit 33 copies the deletion list as an Rz deletion list.
[0093] (Step S51) The deletion target Rz / CNOT gate specifying unit 33 determines whether the Rz deletion list is empty. If the deletion target Rz / CNOT gate specifying unit 33 determines that the Rz deletion list is not empty, it performs the process of step S52. If the deletion target Rz / CNOT gate specifying unit 33 determines that the Rz deletion list is empty, it ends the process of adding the CNOT gate to the deletion list.
[0094] (Step S52) The deletion target Rz / CNOT gate specifying unit 33 extracts the first ID (Rz-ID) from the Rz deletion list. (Step S53) The deletion target Rz / CNOT gate specifying unit 33 acquires the CNOT-ID corresponding to the extracted Rz-ID from the group list and adds it to the deletion list.
[0095] After the process of step S53, the processes from step S51 are repeated. Note that the order of the processes shown in Figures 9 to 11 is not limited to the above example, and can be changed as appropriate.
[0096] As described above, the Rz / CNOT gate to be deleted identification unit 33 of the information processing device 20 acquires first quantum circuit information representing a first quantum circuit used in VQE, including multiple Rz gates and multiple CNOT gates associated with each of the multiple Rz gates. The Rz / CNOT gate to be deleted identification unit 33 also acquires the number of Rz gates for each angle parameter, rz_per_param. The Rz / CNOT gate to be deleted identification unit 33 then identifies Rz gates to be deleted from the first quantum circuit based on the first quantum circuit information and rz_per_param, for example, by processing such as that shown in FIG. 10 . The Rz / CNOT gate deletion unit 39 then generates second quantum circuit information representing a second quantum circuit resulting from the deletion of the identified Rz gates and the CNOT gates associated with the identified Rz gates from the first quantum circuit, and the output unit 41 outputs the second quantum circuit information.
[0097] This process results in a second quantum circuit with a reduced number of CNOT gates, so when the second quantum circuit is implemented in an actual quantum device such as NISQ and VQE is performed, errors due to noise can be reduced.
[0098] Furthermore, the Rz / CNOT gate to be deleted identification unit 33 of the information processing device 20 acquires physical quantum bit connection information that indicates the connection state of the physical quantum bits of the quantum device. Based on the physical quantum bit connection information, the Rz / CNOT gate to be deleted identification unit 33 calculates, for each of multiple Rz gates, the number of swap gates that will be obtained from multiple CNOT gates when transpiling is performed. The Rz / CNOT gate to be deleted identification unit 33 then prioritizes Rz gates with a large calculated number of swap gates as Rz gates to be deleted. Because a swap gate is composed of three CNOT gates, by targeting Rz gates with a large number of swap gates as deletion targets, more CNOT gates can be deleted, thereby further reducing errors due to noise.
[0099] Furthermore, the Rz / CNOT gate to be deleted identification unit 33 of the information processing device 20 preferentially identifies an Rz gate that acts on a quantum bit earlier in the first quantum circuit as an Rz gate to be deleted, thereby leaving behind an Rz gate that acts later and is considered to be more important to the calculation result.
[0100] Note that rz_per_param may be the same value for multiple angle parameters or may have different values. rz_per_param is user adjustable based on the correlation between the number of CNOT gates and the error.
[0101] 12 is a diagram showing an example of the correlation between rz_per_param, error, and the number of CNOT gates. The diagram shows an example of the correlation between rz_per_param, error, and the number of CNOT gates for a simulation with noise and a simulation without noise. The horizontal axis represents rz_per_param, and the vertical axis represents the number of CNOT gates and error.
[0102] In the example of Figure 12, an ansatz by UCCSD for a molecule (Hchain4) in which four hydrogen atoms are arranged in a chain is used. The basis set used is STO-3G. dist = 1.0 indicates that the interatomic distance between each hydrogen atom is 1.0 Å. The error is the difference between the ground state energy of Hchain4 obtained by the Full Configuration Interaction method and the ground state energy of Hchain4 obtained by VQE.
[0103] 12, in the case of a noise-free simulation, the error is smaller as the degree of weight reduction of the first quantum circuit is weaker (rz_per_param is larger). In contrast, in the case of a noise-containing simulation, the error is smaller as the degree of weight reduction is stronger. This is because more CNOT gates with a high error rate due to noise can be deleted.
[0104] As shown in FIG. 12, in the case of the noise-free simulation, even in the case where the degree of weight reduction is greatest (when rz_per_param=1), the error falls within the chemical precision.
[0105] Based on this relationship, the information processing device 20 can adjust rz_per_param to obtain the required accuracy. Figure 13 is a diagram showing an example of the effect of the quantum circuit weight reduction method of the second embodiment. Figure 13 compares the error and the number of CNOT gates of a quantum circuit (first quantum circuit) before weight reduction with those of a quantum circuit after weight reduction for a noise-free simulation and a noise-containing simulation. As in Figure 3, LiH's ansatz is used.
[0106] The quantum circuit after weight reduction is obtained by transpiling the second quantum circuit obtained by the above-mentioned method. Two types of quantum circuits after weight reduction are listed: one without physical qubit connection information and one with physical qubit connection information. Also, Fig. 13(A) is an example using UCSD ansatz, and Fig. 13(B) is an example using PUCCSD (Parallel Unitary Coupled Cluster Singles and Doubles).
[0107] 13A and 13B, the quantum circuit after weight reduction has a significantly reduced number of CNOT gates compared to the quantum circuit before weight reduction (first quantum circuit). This reduces the increase in error due to noise. In addition, the deterioration of accuracy due to weight reduction in the absence of noise is also suppressed.
[0108] It should be noted that a quantum circuit optimization method for removing redundant quantum gates from a quantum circuit or merging multiple quantum gates can be combined with the quantum circuit weight reduction method described above. In this case, the quantum circuit optimization method can be applied to the weight-reduced quantum circuit (second quantum circuit). Applying the quantum circuit optimization method to the second quantum circuit can be expected to remove more quantum gates than applying the quantum circuit optimization method to the first quantum circuit, resulting in an even lighter circuit after transpiling.
[0109] As mentioned above, the above processing contents can be realized by having the information processing device 20 execute a program (for example, a quantum circuit lightweighting program). The program can be recorded on a computer-readable recording medium (for example, the recording medium 26a). Examples of recording media that can be used include magnetic disks, optical disks, magneto-optical disks, and semiconductor memories. Magnetic disks include floppy disks and HDDs. Optical disks include CDs, CD-R (Recordable) / RW (Rewritable), DVDs, and DVD-R / RWs. The program may be recorded on a portable recording medium and distributed. In this case, the program may be copied from the portable recording medium to another recording medium (for example, the HDD 23) and executed.
[0110] The above has described one aspect of the quantum circuit lightweighting program, information processing device, and quantum circuit lightweighting method of the present invention based on the embodiment, but these are merely examples and are not limited to the above description.
[0111] 10 Information processing device 11 Storage unit 12 Processing unit 13a First quantum circuit 13b Second quantum circuit
Claims
1. A quantum circuit lightweighting program that causes a computer to execute the following processes: acquiring first quantum circuit information and the number of Rz gates for each angle parameter, the first quantum circuit including a plurality of Rz gates and a plurality of CNOT gates associated with each of the plurality of Rz gates, and representing a first quantum circuit used in VQE; identifying an Rz gate to be deleted from the plurality of Rz gates included in the first quantum circuit based on the first quantum circuit information and the number of Rz gates; generating second quantum circuit information that represents a second quantum circuit in which the identified Rz gate and the CNOT gate associated with the identified Rz gate are deleted from the first quantum circuit; and outputting the second quantum circuit information.
2. The quantum circuit lightweight program of claim 1, further comprising: acquiring physical quantum bit connection information representing a connection state of physical quantum bits of a quantum device; calculating, for each of the plurality of Rz gates, the number of swap gates obtained from the plurality of CNOT gates when the first quantum circuit is converted into a third quantum circuit corresponding to the connection state based on the physical quantum bit connection information; and preferentially identifying an Rz gate having a large number of calculated swap gates as the Rz gate to be deleted.
3. The quantum circuit lightweight program according to claim 1, wherein, in the first quantum circuit, for Rz gates having the same angle parameter, the Rz gate that acts on the quantum bit first is preferentially identified as the Rz gate to be deleted.
4. An information processing device having: a memory unit that stores first quantum circuit information representing a first quantum circuit used in VQE, the first quantum circuit including a plurality of Rz gates and a plurality of CNOT gates associated with each of the plurality of Rz gates; and a processing unit that acquires the first quantum circuit information and the number of Rz gates for each angle parameter, identifies an Rz gate to be deleted from the plurality of Rz gates included in the first quantum circuit based on the first quantum circuit information and the number of Rz gates, generates second quantum circuit information representing a second quantum circuit obtained by deleting the identified Rz gate and the CNOT gate associated with the identified Rz gate from the first quantum circuit, and outputs the second quantum circuit information.
5. A quantum circuit lightweighting method in which a computer executes the following processes: acquiring first quantum circuit information and the number of Rz gates for each angle parameter, the first quantum circuit including a plurality of Rz gates and a plurality of CNOT gates associated with each of the plurality of Rz gates, and representing a first quantum circuit used in VQE; identifying an Rz gate to be deleted from the plurality of Rz gates included in the first quantum circuit based on the first quantum circuit information and the number of Rz gates; generating second quantum circuit information representing a second quantum circuit in which the identified Rz gate and the CNOT gate associated with the identified Rz gate are deleted from the first quantum circuit; and outputting the second quantum circuit information.
6. The quantum circuit lightweight method according to claim 5, further comprising: acquiring physical quantum bit connection information representing a connection state of physical quantum bits of a quantum device; calculating, for each of the plurality of Rz gates, the number of swap gates obtained from the plurality of CNOT gates when the first quantum circuit is converted into a third quantum circuit corresponding to the connection state based on the physical quantum bit connection information; and preferentially identifying an Rz gate having a large number of calculated swap gates as the Rz gate to be deleted.
7. The quantum circuit lightweighting method according to claim 5, wherein, in the first quantum circuit, for Rz gates having the same angular parameter, an Rz gate that acts on a quantum bit first is preferentially identified as an Rz gate to be deleted.
Citation Information
Patent Citations
Quantum circuit processing method, device and apparatus
CN111461334A
Automatic optimization of large-scale quantum circuits with continuous parameters
JP2021503116A
System and method for partial compilation of variational algorithms for quantum computers
JP2022547989A
