A method for optimizing the fusion of single-bit multi-quantum gates
Through the single-bit multi-quantum gate fusion optimization method, the quantum instruction string is optimized, which solves the decoherence problem caused by the long time span of the microwave pulse sequence in quantum computing, and improves the calculation accuracy and execution efficiency.
Patent Information
- Application Number
- CN202111093264.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-17
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2041-09-17
AI Technical Summary
In quantum computing, because the time span of the input microwave pulse sequence is too long, it causes qubit decoherence and energy relaxation, affecting the accuracy and execution time of superconducting quantum computing results.
The single-bit multi-quantum gate fusion optimization method is adopted, and the quantum instruction string is optimized through the quantum cloud platform, quantum programming framework and quantum universal gate, shortening the time span of microwave pulse input, reducing the complexity of quantum operations and improving calculation accuracy.
It shortens the execution time of quantum computers, improves the accuracy of quantum calculation results, and reduces the degree of decoherence of qubits.
Smart Images

Figure CN113962397B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of quantum computer technology, in particular to a method for single-bit multi-quantum gate fusion optimization. Background Art
[0002] A computer made with quantum bits as the basic unit is a quantum computer. Classical bits use the level of electricity to represent 1 and 0 respectively, thereby encoding information. In the quantum world, energy appears in pieces, a phenomenon we call quantization. When a particle in a special state is selected, its energy has only two states, low energy level (ground state) and high energy level (excited state). If the particle is a person and the different energy levels are steps, then standing at the bottom of the step means being in the ground state, and standing on the top of the step means being in the excited state. We encode the low energy level as 0 and the high energy level as 1, and this is the quantum bit.
[0003] In quantum computing, the long time span of the input microwave pulse sequence will cause quantum bit decoherence and energy relaxation, which will affect the results of superconducting quantum computing and lead to the uncertainty of superconducting quantum computing results, making the execution time of quantum computers longer and the accuracy of quantum computer execution results poor. Summary of the invention
[0004] The technical task of the present invention is to address the above shortcomings and provide a method for single-bit multi-quantum gate fusion optimization, which can shorten the execution time of the quantum computer and improve the accuracy of the execution results of the quantum computer.
[0005] The technical solution adopted by the present invention to solve its technical problem is:
[0006] A method for single-bit multi-quantum gate fusion optimization, including a quantum cloud platform, a quantum programming framework, a quantum computer, a quantum universal gate, and a quantum gate optimization module.
[0007] The user logs in to the quantum cloud platform and sets the single-bit multi-quantum gate fusion rules based on the quantum universal gate;
[0008] The user performs quantum instruction programming through the quantum programming framework to obtain a quantum instruction string; the quantum instruction string is fused and optimized according to the single-bit multi-quantum gate fusion rule to finally form a fused quantum instruction string;
[0009] Users can operate quantum computers by running the fused quantum instruction string, which can save quantum operation time, reduce quantum operation complexity, and improve computing efficiency.
[0010] Furthermore, the quantum gate optimization module, according to the single-bit multi-quantum gate fusion rule, replaces the single-bit multi-quantum gate instruction string with a quantum universal gate in advance to perform optimization;
[0011] According to the preset single-bit multi-quantum gate fusion rule, the rotation operation corresponding to the single-bit gate sequence is determined, and then according to each rotation operation corresponding to the single-bit gate sequence, the quantum bit initial state is rotated accordingly to obtain the quantum bit final state;
[0012] Determine the equivalent rotation axis and the equivalent rotation angle corresponding to the single-bit sequence according to the quantum bit initial state and the quantum bit final state;
[0013] According to the equivalent rotation axis and the equivalent rotation angle, the optimized pulse sequence corresponding to the single-bit gate sequence is determined.
[0014] Through this method, the time span of the microwave pulse input corresponding to the single-bit gate sequence can be shortened, so that the same quantum bit final state can be obtained under the premise of minimizing the decoherence of the quantum bit, thereby improving the accuracy of the calculation.
[0015] Preferably, the fusion rules for fusion optimization of adjacent quantum gates of the same bit are as follows:
[0016] 1) Set the properties of the quantum universal gate;
[0017] 2) The same bit single quantum gate is replaced by a quantum universal gate;
[0018] 3) The multi-bit quantum gate remains unchanged;
[0019] 4) The same bit is divided by multi-bit quantum gates, and all previous gates are replaced by quantum universal gates;
[0020] 5) The measuring gate remains unchanged;
[0021] 6) Optimized quantum universal gate angle, obtaining results by calling quantum computers;
[0022] 7) Obtain the angle of the quantum universal gate and pass the set of quantum gates to be optimized to the quantum computer.
[0023] Preferably, the quantum universal gate is a U gate, including U1, U2, and U3, and its structure is {"angle":"[1.59.2.22.3.33]","name":"u3","qubits":"[1]"}
[0024] Single-bit quantum gates include X, Y, Z, T, and S gates, and their structures are: {"name": "s","qubits": [0]};
[0025] The multi-bit quantum gates include CNOT, SWAP, etc.
[0026] Preferably, the fusion optimization process is as follows:
[0027] 1) Visually edit quantum instruction metadata, parse the quantum instruction JSON string to obtain optimizable quantum gate data, and encapsulate each quantum gate through a HashMap collection to form a List collection;
[0028] 2) Get the largest bit gate in the quantum instruction string to be optimized and initialize the List collection;
[0029] 3) Obtain the list of gate sets that can be optimized, and according to the quantum gate fusion rules, traverse the quantum gate set in a loop, and process the single-bit gate, two-bit gate, and three-bit gate respectively;
[0030] Use the multi-bit gate as the dividing line to perform optimization sequence segmentation, and the transmitted parameters are the value of the current multi-bit gate and the set of bit gates to be optimized previously;
[0031] 4) According to the optimization rules described in step 3), the optimization set is transferred to the quantum computing background to obtain the optimization angle;
[0032] 5) After optimization, the name is U, the number of bits is the corresponding number of bits, the angle is the new value, and it is re-added to the new quantum string combination;
[0033] 6) The scheduler calls the optimized quantum U quantum instruction string to perform calculations on the quantum computer;
[0034] 7) The front-end quantum programming framework displays the quantum gates before and after optimization.
[0035] Furthermore, each element in the list set is a set of single bits, that is, the definition:
[0036] static List <list>lists = new ArrayList<>();
[0037] public static List quantumListAnaly(List list,int qubiesize) {
[0038] for(int i=0;i <qubiesize;i++) {
[0039] lists.add(new ArrayList());
[0040] }
[0041] Quantum gates are arranged in columns, and the optimization rules must take into account the matrix operation rules of both columns and rows. By placing the values of attribute bits into the corresponding row bit sets, the problem of matrix operation is conveniently solved.
[0042] Furthermore, the processing for the two-bit gate is as follows:
[0043] Get the maximum and minimum values of the two-bit gate, and put the optimized objects formed based on the two-bit gate rule into the corresponding row gate set; the bits between the values of the gates between the two-bit gates are all optimizable sets; the bits not between them are not optimized temporarily, waiting for the next rule to be triggered;
[0044] The processing for the three-bit gate is analogous to the processing for the two-bit gate.
[0045] Furthermore, for the processing of the measurement gate: the measurement gate is always located at the end, and the condition for forming the optimized quantum instruction string is that all gates less than the maximum bit are included, that is, the set in the row attribute is no longer iterated, and is directly processed to form U-gate optimization.
[0046] The present invention also claims a system for single-bit multi-quantum gate fusion optimization, comprising a quantum cloud platform, a quantum programming framework, a quantum computer, a quantum universal logic gate, and a quantum gate optimization module, as well as at least one memory and at least one processor;
[0047] The at least one memory is used to store a machine-readable program;
[0048] The at least one processor is used to call the machine-readable program to execute the above-mentioned single-bit multi-quantum gate fusion optimization method.
[0049] The present invention also claims protection for a computer-readable medium having computer instructions stored thereon, which, when executed by a processor, causes the processor to execute the above-mentioned method for single-bit multi-quantum gate fusion optimization.
[0050] Compared with the prior art, the single-bit multi-quantum gate fusion optimization method of the present invention has the following beneficial effects:
[0051] By using the single-bit multi-quantum gate fusion optimization method, the quantum instruction string is sent to the quantum computer after being fused and optimized by the universal quantum gate U to solve the problem that the time span of the input microwave pulse sequence is too long, which will cause quantum bit decoherence and energy relaxation, thereby affecting the results of superconducting quantum computing and causing the uncertainty of superconducting quantum computing results, shortening the execution time of the quantum computer and improving the accuracy of the execution results of the quantum computer. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 This is a before-and-after comparison result of the single-bit multi-quantum gate fusion optimization method provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0053] The present invention will be further described below in conjunction with specific embodiments.
[0054] The embodiment of the present invention provides a method for single-bit multi-quantum gate fusion optimization, including a quantum cloud platform, a quantum programming framework, a quantum computer, a quantum universal gate, and a quantum gate optimization module.
[0055] The user logs in to the quantum cloud platform and sets the single-bit multi-quantum gate fusion rules based on the quantum universal gate;
[0056] The user performs quantum instruction programming through the quantum programming framework to obtain a quantum instruction string; the quantum instruction string is fused and optimized according to the single-bit multi-quantum gate fusion rule to finally form a fused quantum instruction string;
[0057] Users can operate quantum computers by running the fused quantum instruction string, which can save quantum operation time, reduce quantum operation complexity, and improve computing efficiency.
[0058] The quantum universal gate is a U gate, and all single-bit gates can be replaced by U gates. According to the single-bit multi-quantum gate fusion rule, the quantum universal gate U gate is used to replace the single-bit multi-quantum gate instruction string, and the single-bit multi-quantum gate instruction string is arranged and combined in advance to implement optimization.
[0059] According to the preset single-bit multi-quantum gate fusion rule, the rotation operation corresponding to the single-bit gate sequence is determined, and then according to each rotation operation corresponding to the single-bit gate sequence, the quantum bit initial state is rotated accordingly to obtain the quantum bit final state;
[0060] Determine the equivalent rotation axis and the equivalent rotation angle corresponding to the single-bit sequence according to the quantum bit initial state and the quantum bit final state;
[0061] According to the equivalent rotation axis and the equivalent rotation angle, the optimized pulse sequence corresponding to the single-bit gate sequence is determined.
[0062] Through this method, the time span of the microwave pulse input corresponding to the single-bit gate sequence can be shortened, so that the same quantum bit final state can be obtained under the premise of minimizing the decoherence of the quantum bit, thereby improving the accuracy of the calculation.
[0063] The fusion rules for fusion optimization of adjacent quantum gates of the same bit are as follows:
[0064] 1) Set the properties of the quantum universal gate U gate;
[0065] 2) The same bit single quantum gate is replaced by a quantum universal gate (single-bit quantum gates such as X, Y, Z, T, S, etc.);
[0066] 3) Multi-bit quantum gates CNOT, SWAP, etc. remain unchanged;
[0067] 4) The same bit is divided by multi-bit quantum gates, and all previous gates are replaced by U gates;
[0068] 5) The measuring gate remains unchanged;
[0069] 6) Single-bit gate
[0070] X, Y, Z, T, S gates, whose structure is: {"name": "s","qubits": [0]};
[0071] Single bit gate
[0072] U1, U2, U3, whose structure is {"angle":"[1.59.2.22.3.33]","name":"u3","qubits":"[1]"};
[0073] 7) Optimized U-gate angle, obtaining results by calling quantum computers;
[0074] 8) To obtain the U-gate angle, it is necessary to pass the set of quantum gates to be optimized to the quantum computer.
[0075] The process of quantum fusion optimization in this method is as follows:
[0076] 1) Visually edit quantum instruction metadata, parse the quantum instruction JSON string to obtain optimizable quantum gate data, and encapsulate each quantum gate through a HashMap collection to form a List collection;
[0077] HashMap can easily handle different data structures of different quantum gates. Single-bit gates and multi-bit gates have different structural properties. Some gates have built-in angles, while some gates must obtain angle values after background optimization. For example, some gates have angles and some do not, which can be handled uniformly.
[0078] 2) Get the largest bit gate in the quantum instruction string to be optimized and initialize the List collection;
[0079] Each element in the list collection is a collection of single bits, that is, the definition:
[0080] static List <list>lists = new ArrayList<>();
[0081] public static List quantumListAnaly(List list,int qubiesize) {
[0082] for(int i=0;i <qubiesize;i++) {
[0083] lists.add(new ArrayList());
[0084] }
[0085] Quantum gates are arranged in columns, and the optimization rules must take into account both column and row matrix operation rules. By placing the value of the attribute bit into the corresponding row bit set, the problem of matrix operation is conveniently solved.
[0086] 3) Obtain the list of gate sets that can be optimized, and according to the quantum gate fusion rules, traverse the quantum gate set in a loop, and process the single-bit gate, two-bit gate, and three-bit gate respectively;
[0087] Use the multi-bit gate as the dividing line to perform optimization sequence segmentation, and the transmitted parameters are the value of the current multi-bit gate and the set of bit gates to be optimized previously;
[0088] 4) Processing of two-bit gates, obtaining the maximum and minimum values of the two-bit gates, and placing the optimized objects formed based on the two-bit gate rules into the corresponding row gate sets;
[0089] For example, bits that are 0 are put into list[0], bits that are 1 are put into list[1]
[0090] for(int i=0;i <list.size();i++){
[0091] HashMap currentMap=(HashMap) list.get(i);
[0092] String qubitstemp= currenMap.get("qubits").toString().replace("[","").replace("]","").trim();
[0093] int qubitstempint=Integer.parseInt(qubitstemp);
[0094] lists.get(qubitstempint).add(currenMap);
[0095] }
[0096] The bits between the values of the gates based on the two-bit gates are all optimizable sets. If they are not between them, no optimization will be done for the time being, waiting for the next triggering of the rule.
[0097] 5) According to the optimization rules described in step 3), the optimization set is transferred to the quantum computing background to obtain the optimization angle;
[0098] 6) After optimization, the name is U, the number of bits is the corresponding number of bits, the angle is the new value, and it is re-added to the new quantum string combination;
[0099] 7) The processing of the three-bit gate is based on the processing of the two-bit gate, and the processing method is basically the same;
[0100] 8) Special treatment of the measurement gate. Since the measurement gate is always at the end, the condition for forming the optimized quantum instruction string is that the gate is less than the maximum bit gate.
[0101] / / Get the maximum number of bits defined
[0102] for(int i=0;i <list.size();i++){
[0103] HashMap currentMap=(HashMap) list.get(i);
[0104] String qubitstemp= currenMap.get("qubits").toString().replace("[","").replace("]","").trim();
[0105] int qubitstempint=Integer.parseInt(qubitstemp);
[0106] lists.get(qubitstempint).add(currenMap);
[0107] }
[0108] That is to say, up to this point, the combination of row attributes will not be iterated, and will be directly processed to form U-gate optimization;
[0109] 9) The scheduler calls the optimized quantum U quantum instruction string to perform calculations on the quantum computer;
[0110] 10) The front-end quantum programming framework displays the quantum gates before and after optimization.
[0111] Specific implementation examples:
[0112] Quantum cloud platform: 1;
[0113] Quantum computer: 1;
[0114] Quantum Programming Framework: 1;
[0115] The above method is used to optimize the fusion of single-bit multi-quantum gates.
[0116] String before merging:
[0117] {
[0118] "experiments": [{
[0119] "instructions": [{
[0120] "name": "h",
[0121] "qubits": [0]
[0122] }, {
[0123] "name": "s",
[0124] "qubits": [0]
[0125] }, {
[0126] "name": "sdg",
[0127] "qubits": [1]
[0128] }, {
[0129] "name": "tdg",
[0130] "qubits": [1]
[0131] }, {
[0132] "name": "x",
[0133] "qubits": [2]
[0134] }, {
[0135] "name": "x",
[0136] "qubits": [2]
[0137] }, {
[0138] "name": "cx",
[0139] "qubits": [0, 1]
[0140] }, {
[0141] "name": "y",
[0142] "qubits": [2]
[0143] }, {
[0144] "name": "s",
[0145] "qubits": [0]
[0146] }, {
[0147] "name": "h",
[0148] "qubits": [0]
[0149] }, {
[0150] "name": "h",
[0151] "qubits": [1]
[0152] }, {
[0153] "name": "x",
[0154] "qubits": [1]
[0155] }, {
[0156] "name": "tdg",
[0157] "qubits": [2]
[0158] }, {
[0159] "name": "t",
[0160] "qubits": [2]
[0161] }, {
[0162] "name": "swap",
[0163] "qubits": [0, 1]
[0164] }, {
[0165] "name": "sdg",
[0166] "qubits": [0]
[0167] }, {
[0168] "name": "x",
[0169] "qubits": [1]
[0170] }, {
[0171] "name": "x",
[0172] "qubits": [1]
[0173] }, {
[0174] "name": "cx",
[0175] "qubits": [0, 2]
[0176] }, {
[0177] "name": "x",
[0178] "qubits": [0]
[0179] }, {
[0180] "name": "y",
[0181] "qubits": [1]
[0182] }, {
[0183] "name": "x",
[0184] "qubits": [1]
[0185] }, {
[0186] "name": "z",
[0187] "qubits": [2]
[0188] }, {
[0189] "memory": [0],
[0190] "name": "measure",
[0191] "qubits": [0]
[0192] }],
[0193] "header": {
[0194] "creg_sizes": [
[0195] ["c", 3]
[0196] ],
[0197] "name": "circuit0",
[0198] "qubit_labels": [
[0199] ["q", 0],
[0200] ["q", 1],
[0201] ["q", 2]
[0202] ],
[0203] "qreg_sizes": ["q", 3],
[0204] "n_qubits": 3,
[0205] "memory_slots": 1,
[0206] "clbit_labels": [
[0207] ["c", 0] ]
[0209] },
[0210] "config": {
[0211] "n_qubits": 3,
[0212] "memory_slots": 1
[0213] }
[0214] }],
[0215] "schema_version": "v1.0",
[0216] "type": "QASM",
[0217] "qobj_id": "a799a5b1-339b-47f4-8ca2-a1c4330d2ebd",
[0218] "device_id": "5ae875670f020500393162ad",
[0219] "device_name": "Inspur Quantum Computer 01",
[0220] "config": {
[0221] "shots": "1024",
[0222] "n_qubits": 3,
[0223] "memory_slots": 1
[0224] },
[0225] "programming": "OPENQASM 2.0;\n\n\nqreg q[3];\ncreg c[3];\n\nh q[0];\nsdg q[1];\nx q[2];\ns q[0];\ntdg q[1];\nx q[2];\ncx q[0],q[1];\ny q[2];\ns q[0];\nh q[1];\ntdg q[2];\nh q[0];\nx q[1];\nt q[2];\nswap q[0],q[1];\nsdg q[0];\nx q[1];\nx q[1];\ncx q[0],q[2];\nx q[0];\ny q[1];\nz q[2];\nmeasure q[0];\nx q[1];\n"
[0226] }
[0227] The merged string is:
[0228] {
[0229] "schema_version": "v1.0",
[0230] "device_name": "Inspur Quantum Computer 01",
[0231] "qobj_id": "a799a5b1-339b-47f4-8ca2-a1c4330d2ebd",
[0232] "device_id": "5ae875670f020500393162ad",
[0233] "experiments": [{
[0234] "instructions": [{
[0235] "name": "u3",
[0236] "qubits": [0],
[0237] "angle": [1.570796, 3.141593, 1.570796]
[0238] }, {
[0239] "name": "u3",
[0240] "qubits": [1],
[0241] "angle": [0.0, -1.570796, -0.785398]
[0242] }, {
[0243] "name": "cx",
[0244] "qubits": [0, 1]
[0245] }, {
[0246] "name": "u3",
[0247] "qubits": [0],
[0248] "angle": [1.570796, -1.570796, 0.0]
[0249] }, {
[0250] "name": "u3",
[0251] "qubits": [1],
[0252] "angle": [1.570796, 0.0, 0.0]
[0253] }, {
[0254] "name": "swap",
[0255] "qubits": [0, 1]
[0256] }, {
[0257] "name": "u3",
[0258] "qubits": [0],
[0259] "angle": [0, 0, -1.570796]
[0260] }, {
[0261] "name": "u3",
[0262] "qubits": [1],
[0263] "angle": [0.0, 0.0, 0.0]
[0264] }, {
[0265] "name": "u3",
[0266] "qubits": [2],
[0267] "angle": [3.141593, 0.785398, 0.785398]
[0268] }, {
[0269] "name": "cx",
[0270] "qubits": [0, 2]
[0271] }, {
[0272] "name": "u3",
[0273] "qubits": [0],
[0274] "angle": [3.141593, 3.141593, 0]
[0275] }, {
[0276] "name": "u3",
[0277] "qubits": [1],
[0278] "angle": [0.0, 3.141593, 0.0]
[0279] }, {
[0280] "name": "u3",
[0281] "qubits": [2],
[0282] "angle": [0, 0, 3.141593]
[0283] }],
[0284] "header": {
[0285] "qubit_labels": [
[0286] ["q", 0],
[0287] ["q", 1],
[0288] ["q", 2]
[0289] ],
[0290] "name": "circuit0",
[0291] "n_qubits": 3,
[0292] "qreg_sizes": ["q", 3],
[0293] "memory_slots": 1,
[0294] "creg_sizes": [
[0295] ["c", 3]
[0296] ],
[0297] "clbit_labels": [
[0298] ["c", 0] ]
[0300] },
[0301] "config": {
[0302] "n_qubits": 3,
[0303] "memory_slots": 1
[0304] }
[0305] }],
[0306] "type": "QASM",
[0307] "config": {
[0308] "n_qubits": 3,
[0309] "shots": "1024",
[0310] "memory_slots": 1
[0311] },
[0312] "programming": "OPENQASM 2.0;\n\n\nqreg q[3];\ncreg c[3];\n\nh q[0];\nsdg q[1];\nx q[2];\ns q[0];\ntdg q[1];\nx q[2];\ncx q[0],q[1];\ny q[2];\ns q[0];\nh q[1];\ntdg q[2];\nh q[0];\nx q[1];\nt q[2];\nswap q[0],q[1];\nsdg q[0];\nx q[1];\nx q[1];\ncx q[0],q[2];\nx q[0];\ny q[1];\nz q[2];\nmeasure q[0];\nx q[1];\n"
[0313] }
[0314] Reference for comparison results before and after fusion optimization Figure 1 shown.
[0315] The embodiment of the present invention further provides a system for single-bit multi-quantum gate fusion optimization, comprising a quantum cloud platform, a quantum programming framework, a quantum computer, a quantum universal logic gate, and a quantum gate optimization module, as well as at least one memory and at least one processor;
[0316] The at least one memory is used to store a machine-readable program;
[0317] The at least one processor is used to call the machine-readable program to execute the method for single-bit multi-quantum gate fusion optimization described in the above embodiment.
[0318] The embodiment of the present invention further provides a computer-readable medium, on which computer instructions are stored, and when the computer instructions are executed by a processor, the processor executes the method for single-bit multi-quantum gate fusion optimization described in the above embodiment of the present invention. Specifically, a system or device equipped with a storage medium can be provided, on which software program codes for implementing the functions of any of the above embodiments are stored, and a computer (or CPU or MPU) of the system or device is enabled to read and execute the program code stored in the storage medium.
[0319] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute a part of the present invention.
[0320] The storage medium embodiments for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a non-volatile memory card, and a ROM. Alternatively, the program code can be downloaded from a server computer via a communication network.
[0321] In addition, it should be clear that the functions of any of the above embodiments can be implemented not only by executing the program code read by the computer, but also by enabling an operating system operating on the computer to complete part or all of the actual operations based on instructions from the program code.
[0322] In addition, it can be understood that the program code read from the storage medium is written to a memory provided in an expansion board inserted into the computer or written to a memory provided in an expansion unit connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or the expansion unit is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above-mentioned embodiments.
[0323] The present invention is shown and described in detail above through the accompanying drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above multiple embodiments, those skilled in the art can know that the code review methods in the above different embodiments can be combined to obtain more embodiments of the present invention, and these embodiments are also within the protection scope of the present invention.< / list> < / list>
Claims
1. A method for single-bit multi-quantum gate fusion optimization, characterized in that: Including quantum cloud platform, quantum programming framework, quantum computer, quantum universal gate, and quantum gate optimization module. The user logs in to the quantum cloud platform and sets the single-bit multi-quantum gate fusion rules based on the quantum universal gate; The user performs quantum instruction programming through the quantum programming framework to obtain a quantum instruction string; the quantum instruction string is fused and optimized according to the single-bit multi-quantum gate fusion rule to finally form a fused quantum instruction string; The user operates the quantum computer by running the fused quantum instruction string; The fusion rules for fusion optimization of adjacent quantum gates of the same bit are as follows: 1) Set the properties of the quantum universal gate; 2) The same bit single quantum gate is replaced by a quantum universal gate; 3) The multi-bit quantum gate remains unchanged; 4) The same bit is divided by multi-bit quantum gates, and all previous gates are replaced by quantum universal gates; 5) The measuring gate remains unchanged; 6) Optimized quantum universal gate angle, obtaining results by calling quantum computers; 7) Obtain the angle of the quantum universal gate and pass the set of quantum gates to be optimized to the quantum computer; The quantum universal gate is a U gate, including U1, U2, and U3, and its structure is {"angle":"[1.59.2.22.3.33]","name":"u3","qubits":"[1]"} Single-bit quantum gates include X, Y, Z, T, and S gates, and their structures are: {"name": "s","qubits": [0]}; The process of fusion optimization is as follows: 1) Visually edit quantum instruction metadata, parse the quantum instruction JSON string to obtain optimizable quantum gate data, and encapsulate each quantum gate through a HashMap collection to form a List collection; 2) Get the largest bit gate in the quantum instruction string to be optimized and initialize the List collection; 3) Obtain the list of gate sets that can be optimized, and according to the quantum gate fusion rules, traverse the quantum gate set in a loop, and process the single-bit gate, two-bit gate, and three-bit gate respectively; Use the multi-bit gate as the dividing line to perform optimization sequence segmentation, and the transmitted parameters are the value of the current multi-bit gate and the set of bit gates to be optimized previously; 4) According to the rules described in step 3), the optimization set is passed to the quantum computing background to obtain the optimization angle; 5) After optimization, the name is U, the number of bits is the corresponding number of bits, the angle is the new value, and it is re-added to the new quantum string combination; 6) The scheduler calls the optimized quantum U quantum instruction string to perform calculations on the quantum computer; 7) The front-end quantum programming framework displays the quantum gates before and after optimization.
2. A method for single-bit multi-quantum gate fusion optimization according to claim 1, characterized in that The quantum gate optimization module arranges and combines the single-bit multi-quantum gate instruction string in advance by replacing it with a quantum universal gate according to the single-bit multi-quantum gate fusion rule; According to the preset single-bit multi-quantum gate fusion rule, the rotation operation corresponding to the single-bit gate sequence is determined, and then according to each rotation operation corresponding to the single-bit gate sequence, the quantum bit initial state is rotated accordingly to obtain the quantum bit final state; Determine the equivalent rotation axis and the equivalent rotation angle corresponding to the single-bit gate sequence according to the quantum bit initial state and the quantum bit final state; According to the equivalent rotation axis and the equivalent rotation angle, the optimized pulse sequence corresponding to the single-bit gate sequence is determined.
3. The method for single-bit multi-quantum gate fusion optimization according to claim 1, characterized in that The processing for the two-bit gate is as follows: Get the maximum and minimum values of the two-bit gates, and put the optimized objects formed based on the two-bit gate rules into the corresponding row gate sets; the bits between the values of the gates between the two-bit gates are all optimizable sets; The processing for the three-bit gate is analogous to the processing for the two-bit gate.
4. A method for single-bit multi-quantum gate fusion optimization according to claim 3, characterized in that For the processing of the measurement gate: the measurement gate is located at the end, and the condition for forming the optimized quantum instruction string is that all gates less than the maximum bit are included, that is, the set in the row attribute is no longer iterated, and it is directly processed to form the U gate optimization.
5. A system for single-bit multi-quantum gate fusion optimization, characterized in that It includes a quantum cloud platform, a quantum programming framework, a quantum computer, a quantum universal logic gate, and a quantum gate optimization module, as well as at least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is configured to call the machine-readable program to execute the method according to any one of claims 1 to 4.
6. A computer-readable medium, characterized in that The computer readable medium stores computer instructions, and when the computer instructions are executed by a processor, the processor executes the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Decompose method for arbitrarily quantum bit gate
CN101118608A
A design method of a quantum comparator based on a quantum superposition state
CN108984849A
Optimization method and device for calculating single-bit gate sequence by superconducting quantum, and medium
CN111275196A
Quantum gate optimization method and device, equipment and storage medium
CN113158615A
Quantum circuit optimization method based on genetic algorithm
CN113222165A
