WO2024021819A1 - 量子电路优化方法、装置、电子设备、计算机可读存储介质及计算机程序产品 - Google Patents
量子电路优化方法、装置、电子设备、计算机可读存储介质及计算机程序产品 Download PDFInfo
- Publication number
- WO2024021819A1 WO2024021819A1 PCT/CN2023/096212 CN2023096212W WO2024021819A1 WO 2024021819 A1 WO2024021819 A1 WO 2024021819A1 CN 2023096212 W CN2023096212 W CN 2023096212W WO 2024021819 A1 WO2024021819 A1 WO 2024021819A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- qubit
- quantum
- unitary matrix
- quantum circuit
- node
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 64
- 238000005457 optimization Methods 0.000 title claims abstract description 61
- 238000004590 computer program Methods 0.000 title claims abstract description 17
- 238000003860 storage Methods 0.000 title claims abstract description 13
- 239000002096 quantum dot Substances 0.000 claims abstract description 340
- 239000011159 matrix material Substances 0.000 claims abstract description 258
- 238000000354 decomposition reaction Methods 0.000 claims abstract description 50
- 230000009466 transformation Effects 0.000 claims description 29
- 230000015654 memory Effects 0.000 claims description 25
- 238000006243 chemical reaction Methods 0.000 claims description 12
- 239000000284 extract Substances 0.000 claims description 10
- 238000012545 processing Methods 0.000 claims description 7
- 230000010354 integration Effects 0.000 claims description 6
- 230000000295 complement effect Effects 0.000 claims description 2
- 238000005516 engineering process Methods 0.000 abstract description 3
- 238000010586 diagram Methods 0.000 description 21
- 230000008569 process Effects 0.000 description 17
- 230000006870 function Effects 0.000 description 14
- 230000000694 effects Effects 0.000 description 8
- 238000002360 preparation method Methods 0.000 description 5
- 238000004422 calculation algorithm Methods 0.000 description 4
- 238000004891 communication Methods 0.000 description 4
- 230000008901 benefit Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 3
- 239000011449 brick Substances 0.000 description 2
- 230000002452 interceptive effect Effects 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 238000005259 measurement Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 238000000844 transformation Methods 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000006835 compression Effects 0.000 description 1
- 238000007906 compression Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 230000001186 cumulative effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011010 flushing procedure Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000001737 promoting effect Effects 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N10/00—Quantum computing, i.e. information processing based on quantum-mechanical phenomena
- G06N10/60—Quantum algorithms, e.g. based on quantum optimisation, quantum Fourier or Hadamard transforms
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F17/00—Digital computing or data processing equipment or methods, specially adapted for specific functions
- G06F17/10—Complex mathematical operations
- G06F17/16—Matrix or vector computation, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N10/00—Quantum computing, i.e. information processing based on quantum-mechanical phenomena
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N10/00—Quantum computing, i.e. information processing based on quantum-mechanical phenomena
- G06N10/20—Models of quantum computing, e.g. quantum circuits or universal quantum computers
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N10/00—Quantum computing, i.e. information processing based on quantum-mechanical phenomena
- G06N10/40—Physical realisations or architectures of quantum processors or components for manipulating qubits, e.g. qubit coupling or qubit control
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N5/00—Computing arrangements using knowledge-based models
- G06N5/01—Dynamic search techniques; Heuristics; Dynamic trees; Branch-and-bound
Definitions
- the present application relates to quantum computing technology, and in particular, to a quantum circuit optimization method, device, electronic equipment, computer-readable storage medium and computer program product.
- the number of quantum gates in a quantum circuit is related to the running time of the quantum algorithm.
- the quantum circuit can also be optimized to further reduce the running time of the quantum algorithm.
- quantum circuits in superconducting quantum devices have various constraints, such as no restrictions, path restrictions, tree restrictions, and connected graph restrictions. Therefore, for the circuit implementation of arbitrary unitary matrices, if it is based on existing circuit restrictions, The promotion of quantum circuits will make the optimization effect of quantum circuits poor.
- Embodiments of the present application provide a quantum circuit optimization method, device, electronic equipment, computer-readable storage medium, and computer program product, which can improve the optimization effect of quantum circuits.
- Embodiments of the present application provide a quantum circuit optimization method, which is applied to electronic devices.
- the method includes:
- each of the qubit uniform control gates into a second number of qubit diagonal unitary matrices and a third number of single qubit gates;
- Embodiments of the present application provide a quantum circuit optimization device, including:
- a matrix decomposition module configured to convert the quantum circuit to be optimized into a unitary matrix to be processed, and iteratively decompose the unitary matrix to be processed to obtain a first number of qubit uniform control gates;
- control gate decomposition module configured to decompose each qubit uniform control gate into a second number of qubit diagonal unitary matrices and a third number of single qubit gates
- a circuit implementation module configured to determine a matching quantum circuit corresponding to each of the qubit diagonal unitary matrices under the constraints of a connected graph
- an integration module configured to integrate a second number of the matching quantum circuits and a third number of the single qubit gates to obtain a target quantum circuit with uniform control gates for each qubit; described
- the target quantum circuits are connected to obtain the optimized quantum circuit corresponding to the quantum circuit to be optimized.
- Embodiments of the present application provide a quantum computer device.
- the quantum computing device includes an optimized quantum circuit.
- the optimized quantum circuit is implemented by the quantum circuit optimization method provided by the embodiment of the present application.
- An embodiment of the present application provides an electronic device, including:
- Memory used to store executable instructions
- the processor is configured to implement the quantum circuit optimization method provided by the embodiment of the present application when executing executable instructions stored in the memory.
- Embodiments of the present application provide a computer-readable storage medium that stores executable instructions for causing the processor to implement the quantum circuit optimization method provided by the embodiments of the present application.
- Embodiments of the present application provide a computer program product, which includes a computer program or instructions.
- the computer program or instructions are executed by a processor, the quantum circuit optimization method provided by the embodiments of the present application is implemented.
- the electronic device first iteratively decomposes the unitary matrix to be processed obtained by converting the quantum circuit to be optimized, and then decomposes the qubit uniform control gate obtained by decomposition, and obtains the qubit diagonal unitary matrix and
- the electronic device first iteratively decomposes the unitary matrix to be processed obtained by converting the quantum circuit to be optimized, and then decomposes the qubit uniform control gate obtained by decomposition, and obtains the qubit diagonal unitary matrix and
- the quantum circuit implementation process of the qubit diagonal unitary matrix is relatively complex.
- the optimized quantum circuit is obtained by integrating the matching quantum circuit and the single qubit gate, thereby obtaining the optimal quantum circuit under the constraints of the connected graph, that is, the optimized quantum circuit with faster computing speed, which also improves the effect of quantum circuit optimization. , improving quantum computing efficiency by optimizing quantum circuits.
- Figure 1 is a schematic diagram of graph constraints
- Figure 2 is a schematic architectural diagram of the quantum circuit optimization system provided by the embodiment of the present application.
- FIG 3 is a schematic structural diagram of the server in Figure 2 provided by an embodiment of the present application.
- Figure 4 is a schematic flow chart of the quantum circuit optimization method provided by the embodiment of the present application.
- Figure 5 is a schematic diagram of an n-qubit uniform control gate provided by an embodiment of the present application.
- Figure 6 is a schematic diagram of decomposing a qubit uniform control gate provided by an embodiment of the present application.
- Figure 7 is a schematic diagram of a connected graph provided by an embodiment of the present application.
- Figure 8 is a schematic diagram of the decomposition results of the unitary matrix to be processed provided by the embodiment of the present application.
- Figure 9 is another schematic flow chart of the quantum circuit optimization method provided by the embodiment of the present application.
- Figure 10 is another schematic flow chart of the quantum circuit optimization method provided by the embodiment of the present application.
- Figure 11 is a schematic diagram of a matching quantum circuit provided by an embodiment of the present application.
- Figure 12 is a schematic diagram of numbering qubits provided by the embodiment of the present application.
- Figure 13 is a schematic diagram of the circuit implementation of the controlled reverse gate (CNOT) gate under path restrictions provided by the embodiment of the present application.
- CNOT controlled reverse gate
- first ⁇ second ⁇ third are only used to distinguish similar objects and do not represent a specific ordering of objects. It is understandable that “first ⁇ second ⁇ third” is used in Where appropriate, the specific order or sequence may be interchanged so that the embodiments of the application described herein can be implemented in an order other than that illustrated or described herein.
- Quantum Computation is a computing method that uses the superposition and entanglement of quantum states to quickly complete computing tasks.
- Quantum Circuit a description model of quantum computing, including qubits and quantum operations on qubits.
- a quantum circuit includes a series of quantum gates and a measurement sequence. The quantum gates are used to complete calculations, and the measurement sequence is used to measure the calculation results.
- Qubit is the carrying form of quantum information.
- the unit of quantum information is a qubit, which is similar to a classical bit but adds the quantum properties of physical atoms.
- Quantum Gate is a basic quantum circuit that operates a small number of qubits. Quantum gates are the basis of quantum circuits, just like the relationship between logic gates and digital circuits. Quantum gates operate on one or two qubits. Quantum gates that operate on one qubit are single-qubit gates. Quantum gates that operate on two qubits are double-qubit gates. Below, some quantum gates and their definitions are shown through Table 1 below.
- Unitary Matrix also known as unitary matrix, is used to represent quantum gates. That is, any quantum gate can be expressed as a unitary matrix.
- the unitary matrix is used to represent the Hermitian conjugate matrix equal to the inverse matrix.
- the Hermitian conjugate is the transpose, so the real orthogonal representation is that the transposed matrix is equal to the inverse matrix.
- Quantum computing can help solve some problems that are difficult for classical computers to solve due to its ability to quickly complete computing tasks. For example, for large number decomposition problems, the use of quantum computing can improve computing efficiency exponentially.
- the quantum circuit can also be optimized to further reduce the running time of the quantum algorithm.
- Figure 1 is a schematic diagram of a graph restriction.
- the graph constraints in Figure 1 include path constraints 1-1, tree constraints 1-2, and brick wall shape constraints 1-3.
- the nodes in Figure 1 represent qubits, and the edges represent the connection relationships of qubits.
- the limitation of the graph is that a two-qubit gate can only be applied to two connected qubits.
- CNOT gate can be applied to 0 and 1, 0 and 4 are not connected, CNOT gate cannot be applied to 0 and 4; 1 and 3 in tree restriction 1-2 are connected, 1 and 3 can be applied with CNOT gate, 2 and 6 are not connected, 2 and 6 cannot be applied with CNOT gate; brick wall shape limit 1-3 in 4 and 15 are connected, 4 and 15 can be applied with CNOT gate, 15 and 16 are not connected, 15 and 16 CNOT gate cannot be applied.
- Embodiments of the present application provide a quantum circuit optimization method, device, electronic equipment, computer-readable storage medium and computer program product, which can improve the effect of quantum circuit optimization.
- the following describes an exemplary application of the electronic device for quantum circuit optimization provided by the embodiment of the present application.
- the electronic device provided by the embodiment of the present application can be implemented as various types of terminals or as a server. Below, an exemplary application when the electronic device is implemented as a server will be described.
- Figure 2 is a schematic architectural diagram of a quantum circuit optimization system provided by an embodiment of the present application.
- the terminal 400 and the quantum computing device 500 are connected to the server through the network 300.
- the network 300 can be a wide area network or a local area network, or a combination of the two.
- the terminal 400 is used to generate a quantum circuit to be optimized based on the problem to be solved, and send the quantum circuit to be optimized to the server 200 .
- the server 200 is used to convert the quantum circuit to be optimized into a unitary matrix to be processed, and iteratively decompose the unitary matrix to be processed to obtain a first number of qubit uniform control gates; decompose each qubit uniform control gate into a second number qubit diagonal unitary matrix and the third number of single qubit gates; under the constraints of the connected graph, determine the matching quantum circuit corresponding to each qubit diagonal unitary matrix; based on the second number of matching quantum circuits and the third number Three quantities of single qubit gates are integrated to obtain the target quantum circuit that controls the gate uniformly for each qubit; based on the first number of target quantum circuits, the optimized quantum circuit corresponding to the quantum circuit to be optimized is connected to obtain the process of quantum circuit optimization.
- the server 200 is also used to apply the optimized quantum circuit to the quantum computing device 500 (for example, transmit the optimized quantum circuit to a quantum chip manufacturing instrument, manufacture a quantum chip corresponding to the optimized quantum circuit, and obtain a quantum computing device based on the quantum chip configuration), to Improve the computing efficiency of the quantum computing device 500 by optimizing the quantum circuit.
- the optimized quantum circuit for example, transmit the optimized quantum circuit to a quantum chip manufacturing instrument, manufacture a quantum chip corresponding to the optimized quantum circuit, and obtain a quantum computing device based on the quantum chip configuration
- the server 200 may be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or may provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, Cloud servers for basic cloud computing services such as network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN, Content Delivery Network), and big data and artificial intelligence platforms.
- the terminal 400 can be a smart phone, a tablet computer, a notebook computer, a desktop computer, etc., but is not limited thereto.
- FIG. 3 is a schematic structural diagram of the server (an implementation of an electronic device) in Figure 2 provided by an embodiment of the present application.
- the server 200 shown in Figure 3 includes: at least one processor 210, a memory 250, at least one Network interface 220.
- the various components in server 200 are coupled together by bus system 240 .
- bus system 240 is used to implement connection communication between these components.
- the bus system 240 also includes a power bus, a control bus and a status signal bus.
- the various buses are labeled bus system 240 in FIG. 3 .
- the processor 210 may be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware Components, etc., wherein the general processor can be a microprocessor or any conventional processor, etc.
- DSP Digital Signal Processor
- Memory 250 may be removable, non-removable, or a combination thereof.
- Exemplary hardware devices include solid state memory, hard disk drives, optical disk drives, etc.
- Memory 250 optionally includes one or more storage devices physically located remotely from processor 210 .
- Memory 250 includes volatile memory or non-volatile memory, and may include both volatile and non-volatile memory.
- Non-volatile memory can be read-only memory (ROM, Read Only Memory), and volatile memory can be random access memory (RAM, Random Access Memory).
- RAM Random Access Memory
- the memory 250 described in the embodiments of this application is intended to include any suitable type of memory.
- the memory 250 is capable of storing data to support various operations, examples of which include programs, modules, and data structures, or subsets or supersets thereof, as exemplarily described below.
- the operating system 251 includes system programs used to process various basic system services and perform hardware-related tasks, such as the framework layer, core library layer, driver layer, etc., which are used to implement various basic services and process hardware-based tasks;
- Network communication module 252 for reaching other electronic devices via one or more (wired or wireless) network interfaces 220.
- Example network interfaces 220 include: Bluetooth, Wireless Compliance Certification (Wi-Fi), and Universal Serial Bus (USB, Universal Serial Bus), etc.;
- the quantum circuit optimization device provided by the embodiments of the present application can be implemented in software.
- Figure 3 shows the quantum circuit optimization device 255 stored in the memory 250, which can be software in the form of programs, plug-ins, etc., It includes the following software modules: matrix decomposition module 2551, control gate decomposition module 2552, circuit implementation module 2553 and connection integration module 2554. These modules are logical, so they can be arbitrarily combined or further split according to the functions implemented. The functions of each module are explained below.
- the quantum circuit optimization device provided by the embodiments of the present application can be implemented in hardware.
- the quantum circuit optimization device provided by the embodiments of the present application can be a processor in the form of a hardware decoding processor, which Programmed to execute the quantum circuit optimization method provided by the embodiments of the present application, for example, a processor in the form of a hardware decoding processor can use one or more Application Specific Integrated Circuits (ASIC, Application Specific Integrated Circuit), DSP, programmable logic Device (PLD, Programmable Logic Device), Complex Programmable Logic Device (CPLD, Complex Programmable Logic Device), Field Programmable Gate Array (FPGA, Field-Programmable Gate Array) or other electronic components.
- ASIC Application Specific Integrated Circuit
- DSP digital signal processor
- PLD programmable logic Device
- CPLD Complex Programmable Logic Device
- FPGA Field-Programmable Gate Array
- a terminal or server can implement the quantum circuit optimization method provided by the embodiments of this application by running a computer program.
- a computer program can be a native program or software module in the operating system; it can be a native (Native) application (APP, Application), which needs to be installed in the operating system to run. It can be a running program, such as a circuit optimization APP; it can also be a small program, that is, a program that only needs to be downloaded to the browser environment to run; it can also be a small program that can be embedded in any APP.
- the computer program described above can be any form of application, module or plug-in.
- Embodiments of the present application provide a quantum computing device.
- the quantum computing device includes an optimized quantum circuit.
- the optimized quantum circuit is implemented by the quantum circuit optimization method provided by the embodiment of the present application.
- ⁇ > is composed of qubits in the set S. If S ⁇ q ⁇ , then
- Figure 4 is a schematic flow chart of a quantum circuit optimization method provided by an embodiment of the present application, which will be described in conjunction with the steps shown in Figure 4.
- the embodiments of this application are implemented under the limitation of connected graphs and in the scenario of optimizing the quantum circuit to be optimized.
- optimizing the quantum circuit to be optimized the same functions as the quantum circuit to be optimized can be achieved, but with fewer quantum gates. (that is, require less computational time) optimized quantum circuits.
- Each quantum circuit has a corresponding unitary matrix.
- the electronic device first performs unitary matrix conversion on the quantum circuit to be processed, and the resulting unitary matrix is the unitary matrix to be processed. Since the structure of the quantum circuit to be optimized is relatively complex, it is difficult to optimize the quantum circuit to be optimized without changing the function and being restricted by the connected graph. However, the implementation process of the unitary matrix quantum circuit is relatively simple. Therefore, in the embodiments of the present application, , is the problem of converting the size of an optimized quantum circuit into a quantum circuit implementation of an arbitrary unitary matrix.
- the number of qubits acted upon by the quantum circuit to be optimized can be set according to the actual situation, for example, set to n (n is a positive integer).
- the application of the quantum circuit to be optimized on n qubits is taken as an example to illustrate the optimization process of the quantum circuit to be optimized.
- the unitary matrix to be processed is the n-qubit unitary matrix. Therefore, the optimization problem of the quantum circuit to be optimized is to realize the n-qubit unitary matrix under the constraints of the connected graph. The corresponding quantum circuit.
- the number of qubits corresponding to the qubit uniform control gate obtained from the iterative decomposition of the unitary matrix to be processed is the same as the number of qubits corresponding to the unitary matrix to be processed, that is, when the unitary matrix to be processed is When processing a unitary matrix that is an n-qubit unitary matrix, the electronic device will perform n iterative decomposition of the n-qubit unitary matrix.
- Each iterative decomposition will result in one or more n-qubit uniform control gates (UCG, n-qubit Uniformly Controlled Gate), and the qubit unitary matrix that needs to continue to be decomposed, the electronic device continues to decompose the obtained qubit unitary matrix, and so on, until n times of iterative decomposition are completed, the first number of n-qubit uniformly controlled gates.
- UCG n-qubit Uniformly Controlled Gate
- FIG. 5 is a schematic diagram of an n-qubit uniform control gate provided by an embodiment of the present application.
- the set S ⁇ s 1 , s 2 ,..., s n-1 ⁇ represents the number of the control bit qubit, and t represents Target qubit number,
- n-qubit uniform control gate Contains a series of single qubit gates When a single qubit gate When is the revolving door R z ( ⁇ ), then is the n-qubit diagonal unitary matrix, denoted as
- the iterative decomposition of the unitary matrix to be processed in step S101 can be implemented through the following process: let i be a positive integer that increases sequentially, and 1 ⁇ i ⁇ n, n is the number of qubits, and iterate i Perform the following processing: perform matrix decomposition on the initial unitary matrix of the i-th iteration to obtain the decomposition result of the i-th iteration, in which the initial unitary matrix of the first iteration is the unitary matrix to be processed; from the decomposition result of the i-th iteration Extract the qubit uniform control gate of the i-th iteration and the generating unitary matrix of the i-th iteration; determine the generating unitary matrix of the i-th iteration as the initial unitary matrix of the i+1 iteration; The obtained 2 n-1 qubit uniform control gates are determined as the first number of qubit uniform control gates.
- i is a positive integer that increases sequentially, and 1 ⁇ i ⁇ n, and n is the number of qubits.
- the i-th bit in the qubit uniform control gate of the i-th iteration is the target bit, and the remaining n-1 bits are all control bits.
- the qubits corresponding to the generating unitary matrix of the i-th iteration will be larger than the initial ones of the i-th iteration.
- the number of qubits corresponding to the unitary matrix is reduced by one.
- the electronic device can cosine- sine decomposition (i.e. matrix decomposition), the decomposition result is obtained in the following form:
- V n-1,1 , V n-1,2 , V′ n-1,1 , V′ n-1,2 are (n-1)-qubit unitary matrices. Since V n-1,1 , V n-1,2 , V′ n-1,1 , V′ n-1,2 are (n-1)-qubit unitary matrices, we can continue to perform cosine-sine decomposition ( That is, matrix decomposition), the following form is obtained:
- L n-2,1 (i), L n-2,2 (i), L′ n-2,1 (i), L′ n-2,1 (i), R n -2,1 (i), R n-2,2 (i), R′ n-2,1 (i), R′ n-2,1 (i) is the (n-2) qubit unitary matrix ( Generating unitary matrix of the second iteration), C n-2 (i), S n-2 (i), C′ n-2 (i), is a diagonal matrix, and the diagonal elements are respectively and Therefore, the matrix U can be expanded into the following form:
- the second matrix (i.e. ) and the 6th matrix (i.e. ) is an n-qubit uniform control gate whose target bit is the second qubit.
- the remaining matrix (i.e., the generating unitary matrix of the second iteration) is the diagonal matrix that needs to continue cosine-sine decomposition (i.e., the initial unitary matrix of the third iteration).
- ⁇ (i) is calculated from the scale function, which is defined as: ( means not divisible,
- Figure 8 is a schematic diagram of the decomposition result of the unitary matrix to be processed provided by the embodiment of the present application.
- the unitary matrix to be processed corresponds to 3 qubits (denoted as 1, 2 and 3), that is, the unitary matrix to be processed is 3-qubits.
- Bit unitary matrix electronic equipment decomposes the 3-qubit unitary matrix, and can obtain seven 3-qubit uniform control gates, namely (The target bit is the 3rd qubit, the control bit is the 1st qubit and the 2nd qubit), (The target bit is the 2nd qubit, the control bit is the 1st qubit and the 3rd qubit), (The target bit is the 1st qubit, the control bit is the 2nd qubit and the 3rd qubit), and
- each qubit uniform control gate into a second number of qubit diagonal unitary matrices and a third number of single qubit gates.
- any diagonal matrix (a matrix with all elements outside the main diagonal being 0) in the qubit uniform control gate can be decomposed into a rotation gate R z ( ⁇ ), a Hadmard gate H, a phase gate S and an inverse phase gate
- the electronic device realizes the decomposition of qubit uniform control gates by decomposing each diagonal matrix to obtain qubit diagonal unitary matrices and single qubit gates.
- the implementation problem of the unitary matrix to be processed is further transformed into the circuit implementation problem of the diagonal unitary matrix of qubits (the diagonal unitary matrix is easier to deal with than the unitary matrix). accomplish).
- Each diagonal element of any n-qubit uniform control gate is a diagonal matrix, as shown in formula (1):
- V n represents an n-qubit uniform control gate
- U k represents a diagonal matrix, where k ⁇ [2 n-1 ].
- R z represents the revolving door
- S represents the phase gate
- H represents the Hadmard gate. Represents an inverse phase gate.
- any n-qubit uniform control gate can be decomposed into the form shown in formula (3):
- a 1 , A 2 , A 4 and A 6 are all diagonal unitary matrices of n-qubits, Hadmard gate H, phase gate S and inverse phase gate Both are single qubit gates.
- a 1 and A 2 can be combined into a diagonal unitary matrix of n-qubits. Therefore, the electronic device can decompose the gate uniformly for any n-qubit to obtain 3 (second number) n-qubit diagonal Unitary matrices (i.e. A 1 ⁇ A 2 , A 4 and A 6 ) and 4 (third number) single qubit gates (i.e. Hadmard gate H and phase gate S in A 3 , Hadmard gate H and inverse phase gate ).
- FIG. 6 is a schematic diagram of decomposing a qubit uniform control gate provided by an embodiment of the present application.
- the n-qubit uniform control gate can be obtained Control the target quantum circuit of the gate, and then obtain the quantum circuit of the unitary matrix to be processed under the constraints of the connected graph.
- the electronic device needs to implement a circuit of a diagonal unitary matrix of qubits under the constraints of a connected graph, and the resulting circuit is recorded as a matched quantum circuit.
- the electronic device determines the numbering information for n qubits based on the connected graph, determines the qubit pair based on the numbering information, and recurses through the double qubit gate applied to the qubit pair. Realizing the matching quantum circuit of the diagonal unitary matrix of qubits.
- any two nodes included in the connected graph are connected, that is, there are edges connecting any two nodes.
- the nodes in the connected graph correspond to qubits one-to-one, that is, the nodes in the connected graph represent quantum bits. bits.
- the limitation of the connected graph means that the two-qubit gate in the quantum circuit is only allowed to act on two qubits connected by edges in the connected graph.
- the set of nodes, E represents the set of edges in the connected graph.
- the nodes of the connected graph G represent the qubits in the quantum circuit. Then under the constraints of the connected graph G, the qubit pairs (q 1 , q 2 ), (q 2 , q 3 ), (q 2 , q 4 ), ( q 4 , q 5 ) are connected by an edge. Therefore, a two-qubit gate (such as a CNOT gate) is only allowed to act on the qubit pair (q 1 , q 2 ), (q 2 , q 3 ), (q 2 , q 4 ), (q 4 , q 5 ) on.
- a two-qubit gate such as a CNOT gate
- the numbering information obtained based on the connected graph has an advantage, that is, the distance between the qubit with the numbering information k ⁇ [n] ([n] is a set of numbering information of n qubits) and the qubit with the numbering information n is not It will exceed n-k. In this way, it can limit the circuit size of the two-qubit gate when the circuit is implemented under path restriction, thus limiting the size of the matching quantum circuit.
- Figure 9 is another schematic flow chart of the quantum circuit optimization method provided by the embodiment of the present application.
- the control bits and target bits of different n-qubit uniform control gates may be different
- the target of the n-qubit diagonal unitary matrix decomposed from different n-qubit uniform control gates is Bits and control bits may be different.
- step S1031 can be implemented through the following solution two: extract the target tree from the connected graph; number each node in the target tree to obtain the node number corresponding to each node; The node number is determined as the number information of the qubit corresponding to each node.
- the target tree is any spanning tree in the connected graph, and each qubit corresponds to a node in the target tree.
- G′ represents a spanning tree, and at the same time, all edges in the edge set E(G′) can connect all nodes without forming a loop.
- each node in the target tree is numbered to obtain the node number corresponding to each node.
- This can be achieved through the following steps: generate an initialization number for each node in the target tree; when the node number When the n-k+2th node does not have a child node or a child node with an initialization number, query the target node that meets the query conditions from the node numbered node, and add the leftmost child node of the target node
- the node code is determined to be the n-k+1th node; when the node coded as the n-k+2th node has a child node, and the number of the child node is the initialization number, the child node numbered as the initialization number will be The node code of the leftmost child node is determined to be the n-k+1th.
- the query condition is the node with the largest number and the existence of a child node with the initialization number, 3 ⁇ k ⁇ n
- the node with node code n is the root node of the target tree (that is, the nth node is the root node of the target tree )
- the node with node code n-1 is the leftmost node of the root node (that is, the n-1th node is the leftmost node of the root node). That is to say, the electronic device will first access the root node of the spanning tree, number the root node as n, and then access the leftmost child node of the root node, and number the node as n-1.
- node n-k+2 3 ⁇ k ⁇ n
- node n-k+2 has no leaf node or no leaf node numbered 0 (0 is the initialization number)
- find the node collection ⁇ n-k+2,n-k+ 3,...,n ⁇ (that is, the node with the node number) is the node with the largest number and a child node numbered 0.
- FIG. 12 is a schematic diagram of numbering qubits provided by the embodiment of the present application.
- Node 3 has a child node numbered 0, and The node number of this child node is determined to be 2.
- node 2 Since node 2 has no child nodes, return to node 3, and node 3 has no remaining child nodes numbered 0. Continue to return to node 5, and then access the leftmost child node among the remaining child nodes numbered 0 of node 5. Its node number is determined to be 1. From this, the numbering information of the 5 qubits is obtained, and the numbering information indicates the access sequence of the 5 qubits.
- n qubits can be marked as [n].
- One advantage of this numbering method is that the distance between the node with numbering information k ⁇ [n] and the node with numbering information n will not exceed n-k, and ⁇ k,k+1,k+2,...,n ⁇
- the generated subgraph is a connected graph.
- the reference diagonal unitary matrix Based on the numbering information of n qubits, extract the reference diagonal unitary matrix from the qubit diagonal unitary matrix.
- the target bits of the reference diagonal unitary matrix are the qubits whose encoding information is n
- the control bits are the qubits whose encoding information is the first n-1.
- FIG 10 is another schematic flow chart of the quantum circuit optimization method provided by the embodiment of the present application.
- the specific implementation process of S1033 may include: S1033a-S1033e, as follows:
- the electronic device will construct 2 n-1 qubit sequences of length n-1:
- generating multiple qubit sequences for the reference diagonal unitary matrix can be achieved by the following processing: determining the qubit to be flipped in the jth qubit sequence, and flipping the elements on the qubit to be flipped, The j+1th qubit sequence is obtained; when the value of iteration j is 2 n-1 , the 2 n-1 qubit sequence is determined as multiple qubit sequences of the reference diagonal unitary matrix.
- the first qubit sequence is arranged using n-1 second elements.
- the first qubit sequence is composed of It is composed of n-1 zeros arranged.
- the qubit to be flipped is obtained by subtracting the scale function values of n and j.
- the qubit sequence c 1 0 n-1
- the qubit sequence c j is obtained by flipping the n- ⁇ (j-1)th bit from c j-1 .
- the first element can be 1 and the second element can be 0.
- the electronic device expands each qubit sequence of length n-1 into 2 qubit sequences of length n.
- the plurality of qubit sequences are 00, 01, 10, and 11 respectively
- the plurality of first qubit sequences can be 001, 011, 101, 111
- the plurality of second qubit sequences can be 000, 010, 100 ,110.
- the electronic device determines to implement the transformation Quantum circuit, where c refers to the collective name of multiple qubit sequences, c1 is the collective name of the first qubit sequence obtained by adding 1 to the tail of each qubit sequence, ⁇ c1 is the first qubit sequence composed of set of real numbers.
- S1033c can be implemented through the following processing: based on the numbering information of n qubits, determine the matching CNOT gate of the j-th first qubit sequence; based on the j+1-th first qubit sequence, construct the application in the Matching R quantum gates after matching CNOT gates of j first qubit sequences; when j reaches 2 n-1 -1, 2 n-1 -1 matching CNOT gates and matching R quantum gates are alternately connected to get Candidate subcircuit; determine the supplementary R quantum gate and the supplementary CNOT gate, and connect the supplementary R quantum gate and the supplementary CNOT gate to obtain the supplementary subcircuit; based on the candidate subcircuit and the supplementary subcircuit, determine the first quantum circuit.
- j is a positive integer that increases sequentially, and 1 ⁇ j ⁇ 2 n-1 -1, 2 n-1 is the number of the first qubit sequence.
- the target bit matching the CNOT gate is a qubit with number information n
- the control bit is a qubit with number information n- ⁇ (j)
- the electronic device is equipped with a qubit with number information n and number information n-
- a CNOT gate is applied to the qubit of ⁇ (j) ( ⁇ (j) is calculated from the definition of the scale function above), and the CNOT gate is used to process the first qubit sequence.
- the numbering information corresponding to the control bit of the matching CNOT gate of the j-th first qubit sequence is calculated from n and j
- the target bit is the qubit with numbering information n.
- the supplementary R quantum gate is determined by the first qubit sequence
- the control bit of the supplementary CNOT gate is the qubit with number information 1
- the target bit of the supplementary CNOT gate is the qubit with number information n.
- formula (2) is the formula of the first quantum circuit:
- ⁇ c1 is the set of real numbers composed of the first qubit sequence, Indicates matching CNOT gate, represents matching R quantum gate, Represents the supplementary CNOT gate, represents the complementary R quantum gate.
- Formula (2) can be realized by the following process:
- step S1033d can be implemented through the following solution 1: determine the diagonal unitary matrix to be implemented corresponding to the reference diagonal unitary matrix, where the diagonal unitary matrix to be implemented corresponds to n-1 qubits; through the transformation circuit, Decompose the unitary matrix to be realized to obtain a permuted diagonal unitary matrix, in which the transformation circuit is used to replace the quantum state in the first qubit set corresponding to the unitary matrix to be realized to the quantum state in the second qubit set; according to The numbering information of n qubits determines the permutation quantum circuit corresponding to the permutation diagonal unitary matrix; the connection result of the transformation circuit, the permutation quantum circuit, and the inverse transformation circuit corresponding to the transformation circuit is determined as the second quantum circuit; where, the inverse transformation The circuit is used to replace the quantum state in the second set of qubits with the quantum state in the first set of qubits (for example, the inverse transformation circuit converts the qubits to the initial position, that is, the original quantum state).
- the quantum circuit is a second quantum circuit, where c0 is the second qubit sequence obtained by adding 0 to the end of the bit sequence, and ⁇ c0 is the set of real numbers composed of the second qubit sequence.
- the graph generated by the qubit set [n-1] (i.e., the first qubit set) is not necessarily a connected graph, but the graph generated by the qubit set [n]- ⁇ 1 ⁇ (i.e., the second qubit set) is connected graph, therefore, in order to achieve In the embodiment of this application, you can first determine a qubit set [n-1] that can realize the diagonal unitary matrix.
- a switching circuit that replaces the quantum state in the qubit set [n]- ⁇ 1 ⁇ , that is, the interactive circuit is used to replace the quantum state in the first qubit set corresponding to the diagonal unitary matrix to be implemented to the second qubit set.
- the quantum state in x 2 >,...,x n-1 > at this time, the quantum state of the qubit numbered n is x n >, and the qubit set [n]- ⁇ 1 ⁇ is numbered 2, 3,...,n
- the replacement process of replacing the quantum states in the qubit set [n-1] to the qubit set is: replacing the quantum states of these qubits numbered 2, 3,..., n, Replace them with x 1 >, x 2 >,..., x n-1 > respectively.
- the quantum state of the qubit numbered n is x n-1 >.
- the diagonal unitary matrix can be permuted based on the numbering information of n qubits. Decompose and connect the quantum circuits corresponding to the finally decomposed quantum gates to obtain the replacement quantum circuit. For example, As the new reference diagonal unitary matrix to perform steps S1033a-S1033e, we get replacement quantum circuit, that is, through step S1033 for Construct a qubit sequence and add 0 and 1 to the end of the qubit sequence through step S1033b.
- the first qubit sequence and the second qubit sequence are then determined in a manner similar to the process of S1033c.
- the corresponding first quantum circuit is determined according to the method of step S1033d.
- the second quantum circuit is determined according to step S1033e permutation quantum circuits. Confirming After the quantum circuit (replacement quantum circuit), on the basis of the replacement quantum circuit, the transformation circuit and the corresponding inverse transformation circuit of the transformation circuit are connected to obtain the second quantum circuit.
- the electronic device first applies the first quantum circuit to n qubits, and then applies the second quantum circuit to n qubits.
- the resulting overall circuit is the reference quantum circuit. It can also be said that the electronic device connects the first quantum circuit and the second quantum circuit to obtain a reference quantum circuit.
- FIG. 11 is a schematic diagram of a reference quantum circuit provided by an embodiment of the present application.
- the first quantum circuit and the second quantum circuit are applied to the qubits whose number information is 1, 2,..., n-1, n respectively.
- the second quantum circuit includes a conversion circuit P, a permutation quantum circuit and an inverse conversion. circuit
- the remaining diagonal unitary matrix is the diagonal unitary matrix other than the reference diagonal unitary matrix among the qubit diagonal unitary matrices.
- step S104 can be implemented in the following manner: connecting the matching quantum circuit and the single qubit gate in sequence to obtain a target quantum circuit with uniform control gates for each qubit, where the sequence The qubit diagonal unitary matrix obtained by decomposing the qubit uniform control gate and the decomposition sequence of the single qubit gate are shown in Figure 6.
- the electronic device will obtain multiple target quantum circuits that correspond one-to-one to multiple qubit uniform control gates.
- H, H, and S are known quantum circuits.
- the order of H, R 2 , H, S, R 3 that is, the decomposition order of qubit uniform control gate into qubit diagonal unitary matrix and single qubit gate, connects the known quantum circuit (that is, single qubit Door H, H, S) and matching quantum circuits (i.e. matching quantum circuits corresponding to R 1 , R 2 and R 3 respectively), to obtain an n-qubit uniform control gate Target quantum circuits.
- the electronic device After the electronic device obtains the first number of target quantum circuits based on the above step S104, it connects the first number of target quantum circuits according to the iterative decomposition sequence of the qubit uniform control gate to obtain the optimized quantum circuit (i.e., to be optimized).
- the optimized quantum circuit corresponding to the quantum circuit where the iterative decomposition order is the order of the qubit uniform control gates obtained by iteratively decomposing the unitary matrix to be processed. It can be seen from the above that the computing time required to optimize a quantum circuit is less than the computing time of the quantum circuit to be optimized.
- the embodiments of this application are implemented under the constraints of connected graphs and in the scenario of optimizing the quantum circuit to be optimized.
- the quantum Optimized quantum circuits with fewer gates (that is, less computation time required).
- Each quantum circuit has a corresponding unitary matrix.
- the electronic device first performs unitary matrix conversion on the quantum circuit to be processed, and the resulting unitary matrix is the unitary matrix to be processed. Since the structure of the quantum circuit to be optimized is relatively complex, it is difficult to optimize the quantum circuit to be optimized without changing the function and being restricted by the connected graph. However, the implementation process of the unitary matrix quantum circuit is relatively simple.
- the embodiments of this application first Iteratively decompose the unitary matrix to be processed obtained from the conversion of the quantum circuit to be optimized, and then decompose the qubit uniform control gate obtained from the decomposition to obtain the qubit diagonal unitary matrix and single qubit gate to achieve recursive decomposition of the quantum circuit.
- the optimization problem is converted into a quantum circuit implementation problem of the qubit diagonal unitary matrix, and under the constraints of the connected graph, the matching quantum circuit is determined for the qubit diagonal unitary matrix.
- the optimized quantum circuit is obtained based on the integration of the matching quantum circuit and the single qubit gate.
- the obtained optimized quantum circuit when applied to a quantum computing device, it will speed up the computing speed of the quantum computing device, thereby improving the computing efficiency of the quantum computing device.
- Figure 13 is a schematic diagram of the circuit implementation of the CNOT gate under path restrictions provided by the embodiment of the present application. Referring to Figure 13, it can be seen that in the path i-(i+1)-...-( Under the restriction of j-1)-j, Can be implemented by a CNOT circuit with O(ji) depth and size.
- the quantum optimization method provided by the embodiments of the present application can obtain an asymptotically optimal quantum circuit, that is, an optimized quantum circuit with faster operation speed, and when the optimized quantum circuit is applied to a quantum computing device, it can make The computing speed of quantum computing equipment is accelerated and the computing efficiency of quantum computing equipment is improved.
- the embodiment of the present application uses an O(2 n ) circuit with a size of 2 n to realize an arbitrary n-qubit uniform control gate under the constraints of the connected graph, the quantum state preparation circuit can be decomposed into n circuits with sizes 1, 2, respectively. ..., n qubits uniformly control the gate. Therefore, the embodiment of the present application can realize a quantum state preparation circuit with a circuit size of O(2 n ) under the limitation of connected graph, so that the size of the quantum state preparation circuit under the limitation of connected graph is also optimal.
- the quantum circuit optimization device 255 provided by the embodiment of the present application is implemented as a software module.
- the software module is stored in the quantum circuit optimization device 255 of the memory 250 Can include:
- the matrix decomposition module 2551 is configured to convert the quantum circuit to be optimized into a unitary matrix to be processed, and iteratively decompose the unitary matrix to be processed to obtain a first number of qubit uniform control gates;
- the control gate decomposition module 2552 is configured as Each of the qubit uniform control gates is decomposed into a second number of qubit diagonal unitary matrices and a third number of single qubit gates;
- the circuit implementation module 2553 is configured to determine the relationship between each qubit and each qubit under the constraints of the connected graph.
- Matching quantum circuits corresponding to the diagonal unitary matrices of qubits connect the integration module 2554, configured to integrate the second number of the matching quantum circuits and the third number of the single qubit gates to obtain each of the matching quantum circuits.
- the target quantum circuit of the qubit uniform control gate connect a first number of the target quantum circuits to obtain an optimized quantum circuit.
- the matrix decomposition module 2551 is also configured to perform the following processing for the i-th iteration:
- the initial unitary matrix of the i-th iteration is the unitary matrix to be processed, i is a positive integer that increases sequentially, and 1 ⁇ i ⁇ n, n is the number of qubits; extract the qubit uniform control gate of the i-th iteration and the generating unitary matrix of the i-th iteration from the decomposition result of the i-th iteration; convert the i-th iteration
- the generated unitary matrix is determined as the initial unitary matrix of the i+1th iteration; the 2 ⁇ (n-1) qubit uniform control gates obtained by n iterations are determined as the first number of the qubit uniform control gates Door.
- the circuit implementation module 2553 is also configured to determine the numbering information corresponding to the n qubits under the constraints of the connected graph; based on the numbering information of the n qubits, from Extract a reference diagonal unitary matrix from the qubit diagonal unitary matrix, wherein the target bit of the reference diagonal unitary matrix is a qubit whose coded information is n, and the control bit is a qubit whose coded information is the first n-1 ; Based on the numbering information of the n qubits, determine the reference quantum circuit corresponding to the reference diagonal unitary matrix; convert the reference quantum circuit through a controlled back-gate CNOT gate to obtain the remaining diagonal unitary matrix corresponding A conversion quantum circuit, wherein the remaining diagonal unitary matrix is the diagonal unitary matrix other than the reference diagonal unitary matrix in the qubit diagonal unitary matrix; the reference diagonal unitary matrix corresponding to The reference quantum circuit and the conversion quantum circuit corresponding to the remaining diagonal unitary matrix are determined to be the matching quantum circuits of the qubit diagonal unitary matrix.
- the circuit implementation module 2553 is also configured to generate multiple qubit sequences for the reference diagonal unitary matrix; add a first element to the tail of each qubit sequence to obtain multiple A first qubit sequence, and adding a second element to the end of each qubit sequence to obtain multiple second qubit sequences; determining the reference diagonal unitary based on the numbering information of the n qubits
- the first quantum circuit corresponding to the matrix wherein the first quantum circuit is used to load the phases corresponding to a plurality of the first qubit sequences into the standard basis; based on the number information of the n qubits, determine the The second quantum circuit corresponding to the reference diagonal unitary matrix, the second quantum circuit is used to load the phases corresponding to a plurality of the second qubit sequence into the standard basis; based on the first quantum circuit and The second quantum circuit determines the reference quantum circuit corresponding to the reference diagonal unitary matrix.
- the circuit implementation module 2553 is also configured to determine the matching CNOT gate of the jth first qubit sequence based on the numbering information of the n qubits, where j is a sequentially increasing positive integer. , and 1 ⁇ j ⁇ 2 n-1 -1; based on the j+1 first qubit sequence, construct a matching R quantum gate applied after the matching CNOT gate of the jth first qubit sequence ; When j reaches 2 n-1 -1, alternately connect 2 n-1 -1 matching CNOT gates and matching R quantum gates to obtain candidate subcircuits; determine the supplementary R quantum gate and supplementary CNOT gate, and compare all The supplementary R quantum gate and the supplementary CNOT gate are connected to obtain a supplementary subcircuit; based on the candidate subcircuit and the supplementary subcircuit, the first quantum circuit is determined.
- the supplementary R quantum gate is determined based on the first qubit sequence, the control bit of the supplementary CNOT gate is a qubit with number information 1, and the target bit of the supplementary CNOT gate is the number information is the n qubit; the number information corresponding to the control bit of the matching CNOT gate of the jth first qubit sequence is calculated by n and j, and the target of the matching CNOT gate of the jth first qubit sequence A bit is a qubit of numbered information n.
- the circuit implementation module 2553 also determines the diagonal unitary matrix to be implemented corresponding to the reference diagonal unitary matrix, wherein the diagonal unitary matrix to be implemented corresponds to n-1 qubits; by A conversion circuit that replaces the quantum state in the first set of qubits corresponding to the unitary matrix to be realized with the quantum state in the second set of qubits, and determines the replaced unitary matrix to be realized as a permuted diagonal unitary matrix; determine the permutation quantum circuit corresponding to the permutation diagonal unitary matrix according to the number information of the n qubits; combine the transformation circuit, the permutation quantum circuit and the inverse transformation circuit corresponding to the transformation circuit The connection result is determined as the second quantum circuit, wherein the inverse transformation circuit is used to replace the quantum state in the second qubit set with the quantum state in the first qubit set.
- the circuit implementation module 2553 is also configured to determine the qubit to be flipped in the jth qubit sequence, and flip the elements on the qubit to be flipped to obtain the j+1th qubit.
- Bit sequence among them, 2 ⁇ j ⁇ 2 n-1 , the first qubit sequence is obtained by arranging n-1 second elements; when the value of iteration j reaches 2 n-1 , 2 n-1
- a qubit sequence is determined as a plurality of the qubit sequences of the reference diagonal unitary matrix.
- the circuit implementation module 2553 is also configured to extract a target tree from the connected graph, wherein, the target tree is any spanning tree in the connected graph, and each qubit corresponds to a node in the target tree; each node in the target tree is numbered to obtain each The node number corresponding to the node; the node number corresponding to each node is determined as the number information of the qubit corresponding to each node.
- the circuit implementation module 2553 is also configured to generate an initialization number for each node in the target tree; when the node numbered n-k+2 does not have a child node or is numbered When initializing the numbered child nodes, query the target node that meets the query conditions from the node numbered nodes, and determine the node code of the leftmost child node of the target node as n-k+1; where, the query The condition is that the node with the largest number and the child node with the initialization number exists; 3 ⁇ k ⁇ n, the node coded as n is the root node of the target tree, and the node coded as n-1 is the leftmost node of the root node; when the node coded as n-k+2 has a child node, and the number of the child node is the initialization number, the child node numbered as the initialization number The node code of the leftmost child node in is determined to be n-k+1.
- Embodiments of the present application provide a computer program product or computer program.
- the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium.
- the processor of the electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device executes the quantum circuit optimization method described above in the embodiment of the present application.
- Embodiments of the present application provide a computer-readable storage medium storing executable instructions.
- the executable instructions are stored therein.
- the executable instructions When executed by a processor, they will cause the processor to perform the quantum circuit optimization provided by the embodiments of the present application.
- Method for example, the quantum circuit optimization method shown in Figure 4.
- the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; it may also include one or any combination of the above memories.
- Various equipment may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; it may also include one or any combination of the above memories.
- Various equipment may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; it may also include one or any combination of the above memories.
- executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language, including compiled or interpreted languages, or declarative or procedural languages, and their May be deployed in any form, including deployed as a stand-alone program or deployed as a module, component, subroutine, or other unit suitable for use in a computing environment.
- executable instructions may be deployed to execute on one electronic device, or on multiple electronic devices located at one location, or on multiple electronic devices distributed across multiple locations and interconnected by a communications network. execute on.
- the electronic device first iteratively decomposes the unitary matrix to be processed obtained by converting the quantum circuit to be optimized, and then decomposes the decomposed qubit uniform control gate to obtain the qubit diagonal unitary matrix.
- Matrix and single qubit gates to recursively convert the quantum circuit optimization problem into the quantum circuit implementation problem of the qubit diagonal unitary matrix, and determine the matching quantum circuit for the qubit diagonal unitary matrix under the constraints of the connected graph,
- an optimized quantum circuit is obtained based on the integration of matching quantum circuits and single qubit gates, thereby obtaining the optimal quantum circuit under the constraints of the connected graph, that is, an optimized quantum circuit with faster computing speed, which also improves the effect of quantum circuit optimization.
- the optimized quantum circuit when applied to quantum computing equipment, it can speed up the computing speed of quantum computing equipment, that is, improve the computing efficiency of quantum computing equipment; it can realize a quantum state with a circuit size of O(2 n ) under the limitation of connected graphs.
- the circuit is prepared so that the size of the quantum state preparation circuit is also optimal under the constraints of the connected graph.
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Mathematical Physics (AREA)
- Data Mining & Analysis (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Computational Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Computing Systems (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- Condensed Matter Physics & Semiconductors (AREA)
- Databases & Information Systems (AREA)
- Algebra (AREA)
- Computational Linguistics (AREA)
- Superconductor Devices And Manufacturing Methods Thereof (AREA)
Abstract
Description
Claims (15)
- 一种量子电路优化方法,应用于电子设备,所述方法包括:将待优化量子电路转换为待处理酉矩阵,并对所述待处理酉矩阵进行迭代分解,得到第一数量的量子比特均匀控制门;将每个所述量子比特均匀控制门,分解为第二数量的量子比特对角酉矩阵和第三数量的单量子比特门;在连通图的限制下,确定与每个所述量子比特对角酉矩阵对应的匹配量子电路;对第二数量的所述匹配量子电路和第三数量的所述单量子比特门进行整合,得到每个所述量子比特均匀控制门的目标量子电路;对第一数量的所述目标量子电路进行连接,得到优化后的量子电路。
- 根据权利要求1所述的方法,其中,所述对所述待处理酉矩阵进行迭代分解,得到第一数量的量子比特均匀控制门,包括:令i为依次递增的正整数,且1≤i≤n,n是量子比特的数量,迭代i执行以下处理:对第i次迭代的初始酉矩阵进行矩阵分解,得到第i次迭代的分解结果,其中,第1次迭代的初始酉矩阵为所述待处理酉矩阵;从第i次迭代的分解结果中提取第i次迭代的量子比特均匀控制门,以及第i次迭代的生成酉矩阵;将所述第i次迭代的生成酉矩阵,确定为第i+1次迭代的初始酉矩阵;将n次迭代得到的2n-1个量子比特均匀控制门,确定为第一数量的所述量子比特均匀控制门。
- 根据权利要求1或2所述的方法,其中,所述量子比特对角酉矩阵对应n个量子比特;所述在连通图的限制下,确定与每个所述量子比特对角酉矩阵对应的匹配量子电路,包括:在所述连通图的限制下,确定所述n个量子比特分别对应的编号信息;依据所述n个量子比特的编号信息,从所述量子比特对角酉矩阵中提取基准对角酉矩阵,其中,所述基准对角酉矩阵的目标位是编码信息为n的量子比特,控制位是编码信息为前n-1的量子比特;依据所述n个量子比特的编号信息,确定所述基准对角酉矩阵对应的基准量子电路;通过受控反闸CNOT门,对所述基准量子电路进行转换,得到剩余对角酉矩阵对应的转换量子电路,其中,所述剩余对角酉矩阵是所述量子比特对角酉矩阵中除去所述基准对角酉矩阵之外的对角酉矩阵;将所述基准对角酉矩阵对应的基准量子电路、以及所述剩余对角酉矩阵对应的转换量子电路,确定为所述量子比特对角酉矩阵的所述匹配量子电路。
- 根据权利要求3所述的方法,其中,所述依据所述n个量子比特的编号信息,确定所述基准对角酉矩阵对应的基准量子电路,包括:针对所述基准对角酉矩阵生成多个量子比特序列;在每个所述量子比特序列的尾部分别增加第一元素,得到多个第一量子比特序列,并在每个所述量子比特序列的尾部分别增加第二元素,得到多个第二量子比特序列;依据所述n个量子比特的编号信息,确定所述基准对角酉矩阵对应的第一量子电路,其中,所述第一量子电路用于将多个所述第一量子比特序列对应的相位加载到标准基中;依据所述n个量子比特的编号信息,确定所述基准对角酉矩阵对应的第二量子电路,所述第二量子电路用于将多个所述第二量子比特序列对应的相位加载到所述标准基中;基于所述第一量子电路和所述第二量子电路,确定所述基准对角酉矩阵对应的所述基准量子电路。
- 根据权利要求4所述的方法,其中,所述依照所述n个量子比特的编号信息,确定所述基准对角酉矩阵对应的第一量子电路,包括:依据所述n个量子比特的编号信息,确定第j个所述第一量子比特序列的匹配CNOT门,j为依次递增的正整数,且1≤j≤2n-1-1;基于第j+1个所述第一量子比特序列,构造应用在第j个所述第一量子比特序列的匹配CNOT门之后的匹配R量子门;当j达到2n-1-1时,对2n-1-1个匹配CNOT门和匹配R量子门进行交替连接,得到候选子电路;确定补充R量子门和补充CNOT门,并对所述补充R量子门和所述补充CNOT门进行连接,得到补充子电路;基于所述候选子电路以及所述补充子电路,确定所述第一量子电路。
- 根据权利要求5所述的方法,其中,所述补充R量子门基于第1个量子比特序列确定得到,所述补充CNOT门的控制位是编号信息为1的量子比特,所述补充CNOT门的目标位是编号信息为n的量子比特;第j个所述第一量子比特序列的匹配CNOT门的控制位对应的编号信息由n与j计算得到,第j个所述第一量子比特序列的匹配CNOT门的目标位是编号信息为n的量子比特。
- 根据权利要求4所述的方法,其中,所述依据所述n个量子比特的编号信息,确定所述基准对角酉矩阵对应的第二量子电路,包括:确定所述基准对角酉矩阵对应的待实现对角酉矩阵,其中,所述待实现对角酉矩阵对应n-1个量子比特;通过变换电路,对所述待实现酉矩阵进行分解,得到置换对角酉矩阵,其中,所述变换电路用于将所述待实现酉矩阵对应的第一量子比特集合中的量子态,置换到第二量子比特集合中的量子态;依据所述n个量子比特的所述编号信息,确定所述置换对角酉矩阵对应的置换量子电路;将所述变换电路、所述置换量子电路以及所述变换电路对应的逆变换电路的连接结果,确定为所述第二量子电路,其中,所述逆变换电路用于将第二量子比特集合中的量子态,置换到所述第一量子比特集合中的量子态。
- 根据权利要求4所述的方法,其中,所述针对所述基准对角酉矩阵生成多个量子比特序列,包括:确定第j个量子比特序列的待翻转量子比特,并将所述待翻转量子比特上的元素进行翻转,得到第j+1个量子比特序列,其中,2≤j≤2n-1,第1个量子比特序列是通过n-1个第二元素排列得到;当迭代j的取值达到2n-1时,将2n-1个量子比特序列确定为所述基准对角酉矩阵的多个所述量子比特序列。
- 根据权利要求3所述的方法,其中,所述在所述连通图的限制下,确定所述n个量子比特分别对应的编号信息,包括:从所述连通图中抽取目标树,其中,所述目标树是所述连通图中的任意一个生成树,每个量子比特对应所述目标树中的一个节点;对所述目标树中的每个节点进行编号,得到所述每个节点所对应的节点编号;将所述每个节点所对应的节点编号,确定为每个节点所对应的量子比特的编号信息。
- 根据权利要求9所述的方法,其中,所述对所述目标树中的每个节点进行编号,得到所述每个节点所对应的节点编号,包括:针对所述目标树中的每个节点生成初始化编号;当所述节点编号为n-k+2的节点不存在子节点或者编号为初始化编号的子节点时,从已节点编号的节点中查询符合查询条件的目标节点,并将所述目标节点最左侧的子节点的节点编码确定为n-k+1;其中,所述查询条件为编号最大、且存在编号为初始化编号的子节点的节点;3≤k≤n,所述节点编码为n的节点是所述目标树的根节点,所述节点编码为n-1的节点是所述根节点最左侧的节点;当所述节点编码为n-k+2的节点存在子节点、且所述子节点的编号为初始化编号时,将所述编号为初始化编号的子节点中最左侧的子节点的节点编码,确定为n-k+1。
- 一种量子电路优化装置,所述装置包括:矩阵分解模块,配置为将待优化量子电路转换为待处理酉矩阵,并对所述待处理酉矩阵进行迭代分解,得到第一数量的量子比特均匀控制门;控制门分解模块,配置为将每个所述量子比特均匀控制门,分解为第二数量的量子比特对角酉矩阵和第三数量的单量子比特门;电路实现模块,配置为在连通图的限制下,确定与每个所述量子比特对角酉矩阵对应的匹配量子电路;连接整合模块,配置为对第二数量的所述匹配量子电路和第三数量的所述单量子比特门进行整合,得到每个所述量子比特均匀控制门的目标量子电路;对第一数量的所述目标量子电路进行连接,得到优化后的量子电路。
- 一种量子计算设备,所述量子计算设备包括优化量子电路,所述优化量子电路通过权利要求1至10任一项所述的量子电路优化方法实现。
- 一种电子设备,所述电子设备包括:存储器,用于存储可执行指令;处理器,用于执行所述存储器中存储的可执行指令时,实现权利要求1至10任一项所述的量子电路优化方法。
- 一种计算机可读存储介质,存储有可执行指令,所述可执行指令被处理器执行时实现权利要求1至10任一项所述的量子电路优化方法。
- 一种计算机程序产品,包括计算机程序或指令,所述计算机程序或指令被处理器执行时实现权利要求1至10任一项所述的量子电路优化方法。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
EP23845033.2A EP4401012A1 (en) | 2022-07-26 | 2023-05-25 | Quantum circuit optimization method and apparatus, and electronic device, computer-readable storage medium and computer program product |
US18/610,133 US20240281694A1 (en) | 2022-07-26 | 2024-03-19 | Quantum circuit optimization method and apparatus, electronic device, computer-readable storage medium, and computer program product |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210885994.4 | 2022-07-26 | ||
CN202210885994.4A CN117494821A (zh) | 2022-07-26 | 2022-07-26 | 量子电路优化方法、装置、设备、存储介质及程序产品 |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US18/610,133 Continuation US20240281694A1 (en) | 2022-07-26 | 2024-03-19 | Quantum circuit optimization method and apparatus, electronic device, computer-readable storage medium, and computer program product |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2024021819A1 true WO2024021819A1 (zh) | 2024-02-01 |
Family
ID=89673157
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2023/096212 WO2024021819A1 (zh) | 2022-07-26 | 2023-05-25 | 量子电路优化方法、装置、电子设备、计算机可读存储介质及计算机程序产品 |
Country Status (4)
Country | Link |
---|---|
US (1) | US20240281694A1 (zh) |
EP (1) | EP4401012A1 (zh) |
CN (1) | CN117494821A (zh) |
WO (1) | WO2024021819A1 (zh) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111563599A (zh) * | 2020-04-30 | 2020-08-21 | 合肥本源量子计算科技有限责任公司 | 一种量子线路的分解方法、装置、存储介质及电子装置 |
CN111738448A (zh) * | 2020-06-23 | 2020-10-02 | 北京百度网讯科技有限公司 | 量子线路模拟方法、装置、设备及存储介质 |
CN113592094A (zh) * | 2021-08-04 | 2021-11-02 | 腾讯科技(深圳)有限公司 | 量子态制备电路生成方法、超导量子芯片 |
CN113592093A (zh) * | 2021-08-02 | 2021-11-02 | 腾讯科技(深圳)有限公司 | 量子态制备电路生成方法、装置、量子操作芯片及设备 |
-
2022
- 2022-07-26 CN CN202210885994.4A patent/CN117494821A/zh active Pending
-
2023
- 2023-05-25 EP EP23845033.2A patent/EP4401012A1/en active Pending
- 2023-05-25 WO PCT/CN2023/096212 patent/WO2024021819A1/zh active Application Filing
-
2024
- 2024-03-19 US US18/610,133 patent/US20240281694A1/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111563599A (zh) * | 2020-04-30 | 2020-08-21 | 合肥本源量子计算科技有限责任公司 | 一种量子线路的分解方法、装置、存储介质及电子装置 |
CN111738448A (zh) * | 2020-06-23 | 2020-10-02 | 北京百度网讯科技有限公司 | 量子线路模拟方法、装置、设备及存储介质 |
CN113592093A (zh) * | 2021-08-02 | 2021-11-02 | 腾讯科技(深圳)有限公司 | 量子态制备电路生成方法、装置、量子操作芯片及设备 |
CN113592094A (zh) * | 2021-08-04 | 2021-11-02 | 腾讯科技(深圳)有限公司 | 量子态制备电路生成方法、超导量子芯片 |
Also Published As
Publication number | Publication date |
---|---|
EP4401012A1 (en) | 2024-07-17 |
CN117494821A (zh) | 2024-02-02 |
US20240281694A1 (en) | 2024-08-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113159239B (zh) | 一种量子图卷积神经网络处理图数据的方法 | |
WO2020151129A1 (zh) | 量子机器学习框架构建方法、装置、量子计算机及计算机存储介质 | |
WO2023010694A1 (zh) | 量子态制备电路生成方法、装置、芯片、设备及程序产品 | |
Amy et al. | A meet-in-the-middle algorithm for fast synthesis of depth-optimal quantum circuits | |
CN114072817B (zh) | 量子电路的优化方法和系统 | |
WO2014015203A1 (en) | Method and system for decomposing single-qubit quantum circuits into a discrete basis | |
WO2023010684A1 (zh) | 量子态制备电路生成方法、超导量子芯片 | |
CN113614752A (zh) | 量子算法的验证和估计运行时间 | |
WO2023093857A1 (zh) | 基于量子线路求解非线性方程组的方法、装置和存储介质 | |
CN114037082A (zh) | 量子计算任务处理方法、系统及计算机设备 | |
Sarkar et al. | An algorithm for DNA read alignment on quantum accelerators | |
Brennen et al. | Efficient circuits for exact-universal computations with qudits | |
CN114550849A (zh) | 基于量子图神经网络解决化学分子性质预测的方法 | |
WO2024021819A1 (zh) | 量子电路优化方法、装置、电子设备、计算机可读存储介质及计算机程序产品 | |
WO2023221680A1 (zh) | 量子态制备电路生成及量子态制备方法、装置和量子芯片 | |
WO2022143789A1 (zh) | 量子预处理方法、装置、存储介质及电子装置 | |
Meyer et al. | Quantum cellular automata without particles | |
El-Mesady et al. | [Retracted] Decompositions of Circulant‐Balanced Complete Multipartite Graphs Based on a Novel Labelling Approach | |
CN114638368B (zh) | 一种用于qram架构的量子线路的构建方法及装置 | |
CN115114569A (zh) | 一种基于量子线路的非线性偏微分方程求解方法及装置 | |
WO2023207486A1 (zh) | 量子态制备电路的生成方法、装置、量子芯片和电子设备 | |
WO2023231543A1 (zh) | 量子态制备电路生成方法、量子态制备方法以及量子设备 | |
WO2022110705A1 (zh) | Qram架构的量子线路的构建方法和装置、以及量子地址数据的解析方法和装置 | |
Serrano et al. | Quantum RAM for existing Quantum Machine Learning methods | |
Cheikh | A Comparative Study of Large Automata Distributed Processing |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 23845033 Country of ref document: EP Kind code of ref document: A1 |
|
WWE | Wipo information: entry into national phase |
Ref document number: 2023845033 Country of ref document: EP |
|
ENP | Entry into the national phase |
Ref document number: 2023845033 Country of ref document: EP Effective date: 20240412 |
|
ENP | Entry into the national phase |
Ref document number: 2024524590 Country of ref document: JP Kind code of ref document: A |