CN117634619A - Method and device for decomposing any quantum logic gate, storage medium and electronic device - Google Patents

Method and device for decomposing any quantum logic gate, storage medium and electronic device Download PDF

Info

Publication number
CN117634619A
CN117634619A CN202210989693.6A CN202210989693A CN117634619A CN 117634619 A CN117634619 A CN 117634619A CN 202210989693 A CN202210989693 A CN 202210989693A CN 117634619 A CN117634619 A CN 117634619A
Authority
CN
China
Prior art keywords
quantum
gate
matrix
unitary matrix
type
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210989693.6A
Other languages
Chinese (zh)
Inventor
窦猛汉
汪文涛
邹天锐
方圆
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Benyuan Quantum Computing Technology Hefei Co ltd
Original Assignee
Benyuan Quantum Computing Technology Hefei Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Benyuan Quantum Computing Technology Hefei Co ltd filed Critical Benyuan Quantum Computing Technology Hefei Co ltd
Priority to CN202210989693.6A priority Critical patent/CN117634619A/en
Publication of CN117634619A publication Critical patent/CN117634619A/en
Pending legal-status Critical Current

Links

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a decomposition method and a device of any quantum logic gate, a storage medium and an electronic device, wherein the method comprises the following steps: when the order number of the target unitary matrix is larger than a preset value, the target unitary matrix is processed to be represented by the product of the first type block diagonal matrix and the unitary matrix corresponding to the rotary quantum gate; processing the first type of block diagonal matrix into a second type of block diagonal matrix and a unitary matrix product representation corresponding to the rotary quantum gate; taking diagonal blocks of the second class of block diagonal matrix as a new target unitary matrix, and returning to the step of executing the target unitary matrix; processing the unitary matrix corresponding to the rotary quantum gate into a single-quantum bit rotary gate and a single-bit controlled gate of a specific type; and processing the target unitary matrix with the order equal to the preset value into a single-quantum bit revolving gate. By using the embodiment of the invention, the depth of the quantum circuit can be reduced, the simulation efficiency of the quantum circuit can be improved, and the fidelity of the decomposed quantum circuit executed on the quantum chip can be ensured.

Description

Method and device for decomposing any quantum logic gate, storage medium and electronic device
Technical Field
The invention belongs to the technical field of quantum computing, and particularly relates to a method and a device for decomposing any quantum logic gate, a storage medium and an electronic device.
Background
The quantum computing simulation is a simulation computation which simulates and follows the law of quantum mechanics by means of numerical computation and computer science, and is taken as a simulation program, and the high-speed computing capability of a computer is utilized to characterize the space-time evolution of the quantum state according to the basic law of quantum bits of the quantum mechanics.
Currently, algorithms for quantum computing are typically represented by quantum circuits, which include a qubit and quantum logic gates acting on the qubit, and typically a continuous quantum circuit may contain hundreds or even thousands of quantum logic gates.
Unitary matrix decomposition is a widely used method for mapping quantum algorithms to any set of quantum logic gates. This decomposition allows the conversion of a larger unitary matrix into a basic quantum logic gate combination, which is the key to executing and validating quantum algorithms on existing quantum computers or real quantum chips. However, the more the number of qubits operated by the quantum logic gate in the quantum algorithm, the more complex the calculation process, thus resulting in lower simulation efficiency of the quantum circuit and failure to simulate on a real quantum chip, which is a problem to be solved urgently.
Disclosure of Invention
The invention aims to provide a decomposition method, a decomposition device, a storage medium and an electronic device of any quantum logic gate, which can reduce the depth of a quantum circuit and improve the simulation efficiency of the quantum circuit by reducing the number of quantum bits operated by the quantum logic gate, thereby ensuring the fidelity of the decomposed quantum circuit on a quantum chip.
An embodiment of the present application provides a method for decomposing any quantum logic gate, including:
when the order number of a target unitary matrix corresponding to any quantum logic gate is larger than a preset value, processing the target unitary matrix into a product representation of a first type of block diagonal matrix and a unitary matrix corresponding to a rotary quantum gate;
processing the first type of block diagonal matrix into a second type of block diagonal matrix and a unitary matrix product representation corresponding to a rotary quantum gate;
taking diagonal blocks of the second type block diagonal matrix as a new target unitary matrix, and returning to execute the step of processing the target unitary matrix into a product represented by a first type block diagonal matrix and a first rotation matrix when the order of the target unitary matrix is larger than a preset value until the order of the target unitary matrix is equal to the preset value;
Processing the unitary matrix corresponding to the rotary quantum gate into a single-quantum bit rotary gate and a single-bit controlled gate of a specific type; and processing the target unitary matrix with the order equal to the preset value into a single-quantum bit revolving gate.
Optionally, the processing the target unitary matrix as represented by the product of a first type of block diagonal matrix and a unitary matrix corresponding to a rotary quantum gate includes:
and processing the target unitary matrix into the product of a first type of block diagonal matrix, a rotating quantum gate corresponding unitary matrix and another first type of block diagonal matrix.
Optionally, the processing the target unitary matrix as a product of a first type block diagonal matrix, a rotary quantum gate corresponding unitary matrix and another first type block diagonal matrix specifically includes:
the target unitary matrix is processed as a product of a first type block diagonal matrix, a rotating quantum gate corresponding unitary matrix, and another first type block diagonal matrix using the following equation:
wherein U is the target unitary matrix,for a first class of partitioned diagonal matrix, A 1 、A 2 Diagonal blocks in the first type of block diagonal matrix, respectively +.>For another first class of partitioned diagonal matrix, B 1 、B 2 Diagonal blocks in the first type of block diagonal matrix, respectively +.>Corresponding unitary matrix to the rotary quantum gate, and C 2 +S 2 =I d/2 And d is the order of the unitary matrix corresponding to the rotary quantum gate.
Optionally, the rotary quantum gate is a controlled R y And (3) a door.
Optionally, the processing the first type of block diagonal matrix into the product representation of the second type of block diagonal matrix and the unitary matrix corresponding to the rotary quantum gate includes:
and processing the first type of block diagonal matrix into the product of a second type of block diagonal matrix, a unitary matrix corresponding to the rotary quantum gate and another second type of block diagonal matrix.
Optionally, the processing the first type of block diagonal matrix into a product of a second type of block diagonal matrix, a unitary matrix corresponding to the rotary quantum gate and another second type of block diagonal matrix specifically includes:
processing the first type block diagonal matrix into a product of a second type block diagonal matrix, a rotating quantum gate corresponding unitary matrix and another second type block diagonal matrix by using the following formula:
wherein,for said first class of block diagonal matrix, < >>Is a second type of block diagonal matrix, wherein V is a diagonal block in the second type of block diagonal matrix, >For the unitary matrix corresponding to the rotary quantum gate, the D, the +.>Are diagonal blocks in the unitary matrix corresponding to the rotary quantum gate; />And (3) for another second type of block diagonal matrix, wherein W is a diagonal block in the second type of block diagonal matrix.
Optionally, the rotary quantum gate is a controlled R z And (3) a door.
Optionally, the processing the unitary matrix corresponding to the rotary quantum gate into a single-quantum bit rotary gate and a specific type of single-bit controlled gate includes:
and processing the unitary matrix corresponding to the rotary quantum gate into m single-quantum bit rotary gates and m single-bit controlled gates of the specific type, wherein m=d/2, and d is the order of the unitary matrix corresponding to the rotary quantum gate.
Optionally, the single-qubit revolving gate and the single-bit controlled gate of the specific type are obtained by decomposing the unitary matrix corresponding to the revolving quantum gate by using a preset uniform control revolving gate decomposition rule.
Optionally, the method further comprises:
and when the order number of the target unitary matrix is equal to the preset value, directly decomposing the target unitary matrix to obtain the single-quantum bit revolving door.
Optionally, processing the target unitary matrix with the order equal to the preset value into a single-qubit revolving gate includes:
Decomposing the target unitary matrix by the following formula to obtain the single-quantum bit rotation gate:
U(2)=e R z (α)R y (β)R z (γ)
wherein U is the target unitary matrix, 2 is the order, phi is the phase, and alpha, beta and gamma are the rotation angles of the revolving doorDegree of rotation, R y ,R z Are all the single-qubit turngates.
Yet another embodiment of the present application provides a decomposition apparatus of any quantum logic gate, the apparatus including:
the first processing module is used for processing the target unitary matrix into a product representation of a first type of block diagonal matrix and a unitary matrix corresponding to the rotary quantum gate when the order of the target unitary matrix corresponding to any quantum logic gate is larger than a preset value;
the second processing module is used for processing the first type block diagonal matrix into a second type block diagonal matrix and a unitary matrix product representation corresponding to the rotary quantum gate;
the third processing module is used for taking the diagonal blocks of the second class of block diagonal matrix as a new target unitary matrix, and returning to execute the first processing module until the order of the target unitary matrix is equal to the preset value;
the fourth processing module is used for processing the unitary matrix corresponding to the rotary quantum gate into a single-quantum bit rotary gate and a single-bit controlled gate of a specific type; and processing the target unitary matrix with the order equal to the preset value into a single-quantum bit revolving gate.
Optionally, the first processing module includes:
and the first processing unit is used for processing the target unitary matrix into the product of a first type block diagonal matrix, a rotary quantum gate corresponding unitary matrix and another first type block diagonal matrix.
Optionally, the first processing unit is specifically configured to:
the target unitary matrix is processed as a product of a first type block diagonal matrix, a rotating quantum gate corresponding unitary matrix, and another first type block diagonal matrix using the following equation:
wherein U is the target unitary matrix,for a first class of partitioned diagonal matrix, A 1 、A 2 Diagonal blocks in the first type of block diagonal matrix, respectively +.>For another first class of partitioned diagonal matrix, B 1 、β 2 Diagonal blocks in the first type of block diagonal matrix, respectively +.>Corresponding unitary matrix for one rotary quantum gate, and C 2 +S 2 =I d/2 And d is the order of the unitary matrix corresponding to the rotary quantum gate.
Optionally, the rotary quantum gate is a controlled R y And (3) a door.
Optionally, the second processing module includes:
and the second processing unit is used for processing the first type block diagonal matrix into the product of a second type block diagonal matrix, a unitary matrix corresponding to the rotary quantum gate and another second type block diagonal matrix.
Optionally, the second processing unit is specifically configured to:
processing the first type block diagonal matrix into a product of a second type block diagonal matrix, a rotating quantum gate corresponding unitary matrix and another second type block diagonal matrix by using the following formula:
wherein,for said first class of block diagonal matrix, < >>Is a second class of componentsA block diagonal matrix, wherein V is a diagonal block in the second type of block diagonal matrix,>for the unitary matrix corresponding to the rotary quantum gate, the D, the +.>Are diagonal blocks in the unitary matrix corresponding to the rotary quantum gate; />And (3) for another second type of block diagonal matrix, wherein W is a diagonal block in the second type of block diagonal matrix.
Optionally, the rotary quantum gate is a controlled R z And (3) a door.
Optionally, the fourth processing module includes:
and processing the unitary matrix corresponding to the rotary quantum gate into m single-quantum bit rotary gates and m single-bit controlled gates of the specific type, wherein m=d/2, and d is the order of the unitary matrix corresponding to the rotary quantum gate.
Optionally, the single-qubit revolving gate and the single-bit controlled gate of the specific type are obtained by decomposing the unitary matrix corresponding to the revolving quantum gate by using a preset uniform control revolving gate decomposition rule.
Optionally, the apparatus further includes:
and the obtaining module is used for directly decomposing the target unitary matrix when the order of the target unitary matrix is equal to the preset value, so as to obtain the single-quantum bit revolving door.
Optionally, the fourth processing module is further specifically configured to:
decomposing the target unitary matrix by the following formula to obtain the single-quantum bit rotation gate:
U(2)=e R z (α)R y (β)R z (γ)
wherein U is the target unitary matrix, 2 is the order, phi is the phase, and alpha, beta and gamma areThe rotating angle of the revolving door R y ,R z Are all the single-qubit turngates.
An embodiment of the present application provides a storage medium having a computer program stored therein, wherein the computer program is configured to perform, when run, the method of any of the above.
An embodiment of the application provides an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the method of any of the above.
Compared with the prior art, when the order number of a target unitary matrix corresponding to any quantum logic gate is larger than a preset value, the target unitary matrix is processed to be expressed by the product of a first type of block diagonal matrix and a unitary matrix corresponding to a rotary quantum gate; processing the first type of block diagonal matrix into a second type of block diagonal matrix and a unitary matrix product representation corresponding to the rotary quantum gate; then, taking the diagonal blocks of the second type block diagonal matrix as a new target unitary matrix, and returning to execute the step of processing the target unitary matrix into a product represented by the first type block diagonal matrix and the first rotation matrix when the order of the target unitary matrix is larger than a preset value until the order of the target unitary matrix is equal to the preset value; finally, the unitary matrix corresponding to the rotary quantum gate is processed into a single-quantum bit rotary gate and a single-bit controlled gate of a specific type; and processing the target unitary matrix with the order equal to the preset value into a single-quantum bit revolving gate. By using the embodiment of the invention, the depth of the quantum circuit can be reduced by reducing the number of quantum bits operated by the quantum logic gate, the simulation efficiency of the quantum circuit can be improved, and the fidelity of the decomposed quantum circuit executed on the quantum chip can be ensured.
Drawings
Fig. 1 is a hardware block diagram of a computer terminal according to an embodiment of the present invention, which is a method for decomposing any quantum logic gate;
FIG. 2 is a schematic flow chart of a method for decomposing any quantum logic gate according to an embodiment of the present invention;
FIG. 3a is a schematic diagram of a quantum circuit of a uniform control gate of 3 control qubits according to an embodiment of the present invention;
FIG. 3b is a schematic diagram of another quantum circuit of the 3 uniform control gates for controlling qubits according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an equivalent quantum circuit of a uniform control gate of 3 control qubits according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a quantum circuit corresponding to a uniform control gate according to an embodiment of the present invention;
fig. 6 is a schematic diagram of an equivalent quantum circuit after primary processing of a target unitary matrix according to an embodiment of the present invention;
fig. 7 is a schematic diagram of an equivalent quantum circuit of a 3-qubit uniform rotation control gate according to an embodiment of the present invention;
FIG. 8 is a diagram illustrating a uniform control R provided by an embodiment of the present invention y An equivalent quantum circuit schematic diagram corresponding to the gate;
fig. 9 is a schematic diagram of an equivalent quantum circuit after primary processing of a first type of block diagonal matrix according to an embodiment of the present invention;
Fig. 10 is a schematic diagram of another equivalent quantum circuit after processing a target unitary matrix according to an embodiment of the present invention;
fig. 11 is a schematic diagram of an equivalent quantum circuit of a target unitary matrix according to an embodiment of the present invention;
fig. 12 is a schematic structural diagram of an apparatus for decomposing any quantum logic gate according to an embodiment of the present invention.
Detailed Description
The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the invention.
The embodiment of the invention firstly provides a decomposition method of any quantum logic gate, which can be applied to electronic equipment such as computer terminals, in particular to common computers, quantum computers and the like.
The quantum computer is a kind of physical device which performs high-speed mathematical and logical operation, stores and processes quantum information according to the law of quantum mechanics. When a device processes and calculates quantum information and operates on a quantum algorithm, the device is a quantum computer. Quantum computers are a key technology under investigation because of their ability to handle mathematical problems more efficiently than ordinary computers, for example, to accelerate the time to crack RSA keys from hundreds of years to hours.
The following describes the operation of the computer terminal in detail by taking it as an example. Fig. 1 is a hardware block diagram of a computer terminal according to an embodiment of the present invention, which is a method for decomposing any quantum logic gate. As shown in fig. 1, the computer terminal may include one or more (only one is shown in fig. 1) processors 102 (the processor 102 may include, but is not limited to, a microprocessor MCU or a processing device such as a programmable logic device FPGA) and a memory 104 for storing data, and optionally, a transmission device 106 for communication functions and an input-output device 108. It will be appreciated by those skilled in the art that the configuration shown in fig. 1 is merely illustrative and is not intended to limit the configuration of the computer terminal described above. For example, the computer terminal may also include more or fewer components than shown in FIG. 1, or have a different configuration than shown in FIG. 1.
The memory 104 may be used to store software programs and modules of application software, such as program instructions/modules corresponding to a method for decomposing any quantum logic gate in the embodiments of the present application, and the processor 102 executes the software programs and modules stored in the memory 104, thereby performing various functional applications and data processing, i.e., implementing the above-mentioned method. Memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include memory remotely located relative to the processor 102, which may be connected to the computer terminal via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission means 106 is arranged to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, NIC) that can connect to other network devices through a base station to communicate with the internet. In one example, the transmission device 106 may be a Radio Frequency (RF) module for communicating with the internet wirelessly.
The quantum computing is a novel computing mode for regulating and controlling the quantum information unit to compute according to a quantum mechanical law, wherein the most basic principle based on the quantum computing is a quantum mechanical state superposition principle, and the quantum mechanical state superposition principle enables the state of the quantum information unit to be in a superposition state with multiple possibilities, so that quantum information processing has greater potential compared with classical information processing in efficiency. A quantum system comprises a number of particles which move according to the laws of quantum mechanics, known as a quantum state of the system in a state space.
It should be noted that a real quantum computer is a hybrid structure, which includes two major parts: part of the computers are classical computers and are responsible for performing classical computation and control; the other part is quantum equipment, which is responsible for running quantum programs so as to realize quantum computation. The quantum program is a series of instruction sequences written by a quantum language such as the qlunes language and capable of running on a quantum computer, so that the support of quantum logic gate operation is realized, and finally, quantum computing is realized. Specifically, the quantum program is a series of instruction sequences for operating the quantum logic gate according to a certain time sequence.
In practical applications, quantum computing simulations are often required to verify quantum algorithms, quantum applications, etc., due to the development of quantum device hardware. Quantum computing simulation is a process of realizing simulated operation of a quantum program corresponding to a specific problem by means of a virtual architecture (namely a quantum virtual machine) built by resources of a common computer. In general, it is necessary to construct a quantum program corresponding to a specific problem. The quantum program, namely the program for representing the quantum bit and the evolution thereof written in the classical language, wherein the quantum bit, the quantum logic gate and the like related to quantum computation are all represented by corresponding classical codes.
Quantum circuits, which are one embodiment of quantum programs, also weigh sub-logic circuits, are the most commonly used general quantum computing models, representing circuits that operate on qubits under an abstract concept, the composition of which includes qubits, circuits (timelines), and various quantum logic gates, and finally the results often need to be read out by quantum measurement operations.
Unlike conventional circuits, which are connected by metal lines to carry voltage or current signals, in a quantum circuit, the circuit can be seen as being connected by time, i.e., the state of the qubit naturally evolves over time, as indicated by the hamiltonian operator, during which it is operated until a logic gate is encountered.
One quantum program is corresponding to one total quantum circuit, and the quantum program refers to the total quantum circuit, wherein the total number of quantum bits in the total quantum circuit is the same as the total number of quantum bits of the quantum program. It can be understood that: one quantum program may consist of a quantum circuit, a measurement operation for the quantum bits in the quantum circuit, a register to hold the measurement results, and a control flow node (jump instruction), and one quantum circuit may contain several tens to hundreds or even thousands of quantum logic gate operations. The execution process of the quantum program is a process of executing all quantum logic gates according to a certain time sequence. Note that the timing is the time sequence in which a single quantum logic gate is executed.
It should be noted that in classical computation, the most basic unit is a bit, and the most basic control mode is a logic gate, and the purpose of the control circuit can be achieved by a combination of logic gates. Similarly, the way in which the qubits are handled is a quantum logic gate. The quantum logic gate is used to make the quantum state evolve, and the quantum logic gate is the basis of the quantum circuit, and includes single-bit quantum logic gate, such as Hadamard gate (H gate, aldar Ma Men), paulownia X gate (X gate), brix gate (Y gate), brix gate (Z gate), R x Door, R y Door, R z A door, etc.; two or more bit quantum logic gates, such as CNOT gates, CR gates, CZ gates, iSWAP gates, toffoli gates, and the like. Quantum logic gates are typically represented using unitary matrices, which are not only in matrix form, but also an operation and transformation. The effect of a general quantum logic gate on a quantum state is calculated by multiplying the unitary matrix by the matrix corresponding to the right vector of the quantum state.
Referring to fig. 2, fig. 2 is a flow chart of a method for decomposing an arbitrary quantum logic gate according to an embodiment of the present invention, which may include the following steps:
s201: and when the order number of the target unitary matrix corresponding to any quantum logic gate is larger than a preset value, processing the target unitary matrix into a product representation of the first type of block diagonal matrix and the unitary matrix corresponding to the rotary quantum gate.
Any quantum logic gate can be any type of quantum logic gate, specifically, the any quantum logic gate can be a U gate, and the any quantum logic gate is equivalent to a quantum program corresponding to a quantum algorithm for solving a certain problem, can be equivalent to a part of the quantum program, and can also be a quantum logic gate corresponding to a part of matrix obtained by processing provided by the embodiment of the invention.
The target unitary matrix can be obtained by receiving the information sent by other devices, can be generated by the target unitary matrix, and can be obtained by calling the stored information of the target unitary matrix. The order of the target unitary matrix is related to the number of qubits corresponding to the unitary matrix, and the number of corresponding qubits is 4, for example, the order of the target unitary matrix is 2 4 =16。
The preset value can be determined according to an empirical value or a processing mode, for example, only a target unitary matrix with more than 2 steps can be processed, and the preset value is 2; of course, the preset value may also be determined by other means.
The blocking matrix is a matrix, which is divided into a plurality of small sub-matrices according to the horizontal and vertical directions. Each small matrix is then considered an element. Illustratively, the form of the blocking matrix may be as follows:
wherein A is a block matrix, E 1 、E 2 Each of O, B is a sub-block of a and is a small matrix of 2 x 2.
In the embodiment of the invention, a target unitary matrix is processed to obtain a first type of block diagonal matrix. The partitioned diagonal matrix has zero elements in all sub-blocks except the sub-blocks on the diagonal (including a single diagonal element). Illustratively, the form of a partitioned diagonal matrix may be as follows:
The number of the first type block diagonal matrix is preset, no matter how many the number of the first type block diagonal matrix is, as long as the product of the first type block diagonal matrix and the unitary matrix corresponding to the rotary quantum gate is the target unitary matrix, the specific processing mode can be various. The arrangement mode of the unitary matrix corresponding to the first type of block diagonal matrix and the rotary quantum gate can be preset, or can be determined in other modes.
S202: and processing the first type of block diagonal matrix into a second type of block diagonal matrix and a unitary matrix product representation corresponding to the rotary quantum gate.
The rotary quantum gate may be the same type as S201, or may be a different type. The method for processing the first type block diagonal matrix may be the same as or different from the method for processing the target unitary matrix, so long as the product of the obtained second type block diagonal matrix and the unitary matrix corresponding to the rotary quantum gate is the first type block diagonal matrix, and the specific mode is not limited. When the number of the first-type block diagonal matrices is more than one, each of the first-type block diagonal matrices is processed separately.
S203: and returning to S201 by taking the diagonal blocks of the second class of block diagonal matrix as a new target unitary matrix until the order of the target unitary matrix is equal to the preset value.
The diagonal blocks in the second class of block diagonal matrix are used as new target unitary matrix, and the iteration processing is circulated until the order of the target unitary matrix is equal to a preset value by using the method provided by the embodiment of the invention.
S204: processing the unitary matrix corresponding to the rotary quantum gate into a single-quantum bit rotary gate and a single-bit controlled gate of a specific type; and processing the target unitary matrix with the order equal to the preset value into a single-quantum bit revolving gate.
The rotary quantum gate referred to herein is a rotary quantum gate of a plurality of qubits. The single-qubit rotary gate and the single-bit controlled gate obtained through processing act on the quantum circuit, and the effect is the same as that of the rotary quantum gate acting on the quantum circuit.
The single-qubit rotating gate refers to a quantum logic gate with a rotating function and acting on single-qubit, and comprises R x Door, R y Door, R z One or more of the doors, R x Door, R y Door, R z The three doors can be mutually converted.
The single-bit controlled gate refers to a quantum logic gate with only one target bit and one control bit, namely the two-bit quantum logic gate, and the specific type of single-bit controlled gate can be a CNOT gate or a two-bit quantum logic gate with other functions.
When the order of the target unitary matrix is equal to a preset value, which indicates that the target unitary matrix can not be processed into the product representation of the first type of block diagonal matrix and the unitary matrix corresponding to the rotary quantum gate, the target unitary matrix is directly processed to obtain the single-quantum-bit rotary gate.
Any quantum logic gate acts on the quantum circuit, the method provided by the embodiment of the invention is utilized to process the any quantum logic gate to obtain a single-quantum bit rotating gate and a single-bit controlled gate of a specific type, then the obtained quantum logic gate sequentially acts on the quantum bit according to the process of processing any quantum logic gate to obtain a new quantum circuit, the quantum circuit is equivalent to the quantum circuit of any quantum logic gate, but the depth of the quantum circuit is reduced, so that the simulation efficiency of the quantum circuit can be improved, and the fidelity of the decomposed quantum circuit executed on a quantum chip is ensured.
As can be seen, when the order number of a target unitary matrix corresponding to any quantum logic gate is larger than a preset value, the target unitary matrix is processed into a product representation of a first type of block diagonal matrix and a unitary matrix corresponding to a rotary quantum gate; processing the first type of block diagonal matrix into a second type of block diagonal matrix and a unitary matrix product representation corresponding to the rotary quantum gate; then, taking the diagonal blocks of the second type block diagonal matrix as a new target unitary matrix, and returning to execute the step of processing the target unitary matrix into a product represented by the first type block diagonal matrix and the first rotation matrix when the order of the target unitary matrix is larger than a preset value until the order of the target unitary matrix is equal to the preset value; finally, the unitary matrix corresponding to the rotary quantum gate is processed into a single-quantum bit rotary gate and a single-bit controlled gate of a specific type; and processing the target unitary matrix with the order equal to the preset value into a single-quantum bit revolving gate. By using the embodiment of the invention, the depth of the quantum circuit can be reduced by reducing the number of quantum bits operated by the quantum logic gate, the simulation efficiency of the quantum circuit can be improved, and the fidelity of the decomposed quantum circuit executed on the quantum chip can be ensured. By using the embodiment of the invention, the depth of the quantum circuit can be reduced by reducing the number of quantum bits operated by the quantum logic gate, the simulation efficiency of the quantum circuit can be improved, and the fidelity of the decomposed quantum circuit executed on the quantum chip can be ensured.
In some possible embodiments of the present invention, the processing the target unitary matrix as represented by a product of a first type of block diagonal matrix and a rotating quantum gate corresponding unitary matrix may include:
and processing the target unitary matrix into the product of a first type of block diagonal matrix, a rotating quantum gate corresponding unitary matrix and another first type of block diagonal matrix.
In the embodiment of the invention, the target unitary matrix is processed to obtain two first-type block diagonal matrices, and a rotary quantum gate corresponding unitary matrix is arranged between one first-type block diagonal matrix and the other block diagonal matrix.
In some possible embodiments of the present invention, the processing the target unitary matrix as a product of a first type of block diagonal matrix, a rotating quantum gate corresponding unitary matrix, and another first type of block diagonal matrix may specifically include:
the target unitary matrix is processed as a product of a first type block diagonal matrix, a rotating quantum gate corresponding unitary matrix, and another first type block diagonal matrix using the following equation:
wherein U is the target unitary matrix,for a first class of partitioned diagonal matrix, A 1 、A 2 Diagonal blocks in the first type of block diagonal matrix, respectively +. >For another first class of partitioned diagonal matrix, B 1 、B 2 Diagonal blocks in the first type of block diagonal matrix, respectively +.>Corresponding unitary matrix for one rotary quantum gate, and C 2 +S 2 =I d/2 And d is the order of the unitary matrix corresponding to the rotary quantum gate.
Note that C, S is a real diagonal matrix, c=diag (cos (θ) 0 ),cos(θ 1 ),…),S=diag(sin(θ 0 ),sin(θ 1 ),…)。
In some possible implementations of the inventionIn this way, the rotary quantum gate may be a controlled R y Gates, i.e. rotary quantum gates, can be multiple quantum bits of R y The gate, in particular, may be R with control bits y And (3) a door.
In some possible embodiments of the present invention, the processing the first type of block diagonal matrix into a second type of block diagonal matrix and a rotation quantum gate corresponding unitary matrix product representation includes:
and processing the first type of block diagonal matrix into the product of a second type of block diagonal matrix, a unitary matrix corresponding to the rotary quantum gate and another second type of block diagonal matrix.
It should be noted that, the manner of processing the first type block diagonal matrix and the processing the target unitary matrix may be the same or different. In the embodiment of the present invention, for a second type of block diagonal matrix, diagonal blocks of the second type of block diagonal matrix may be the same diagonal blocks, and a form of a rotary quantum gate corresponding unitary matrix obtained herein may be different from a form of a rotary quantum gate corresponding unitary matrix obtained for a target unitary matrix, for example, a unitary matrix corresponding to a rotary quantum gate obtained by processing a first type of block diagonal matrix is a block diagonal matrix, and specifically, one diagonal block may be hermite of another diagonal block.
In some possible embodiments of the present invention, the processing the first type of block diagonal matrix into a product of a second type of block diagonal matrix, a rotation quantum gate corresponding unitary matrix and another second type of block diagonal matrix specifically includes:
processing the first type block diagonal matrix into a product of a second type block diagonal matrix, a rotating quantum gate corresponding unitary matrix and another second type block diagonal matrix by using the following formula:
wherein,for said first class of block diagonal matrix, < >>Is a second type of block diagonal matrix, wherein V is a diagonal block in the second type of block diagonal matrix,>for the unitary matrix corresponding to the rotary quantum gate, the D, the +.>Are diagonal blocks in the unitary matrix corresponding to the rotary quantum gate; />And (3) for another second type of block diagonal matrix, wherein W is a diagonal block in the second type of block diagonal matrix.
In some possible embodiments of the invention, the rotary quantum gate is a controlled R z And (3) a door.
Decomposing the first type of block diagonal matrix to obtain a rotary quantum gate controlled by R z And (3) a door. Controlled R z Door and controlled R y The doors are similar and are not described in detail herein.
In some possible embodiments of the present invention, the processing the rotating quantum gate corresponding unitary matrix into a single-qubit rotating gate and a specific type of single-bit controlled gate includes:
And processing the unitary matrix corresponding to the rotary quantum gate into m single-quantum bit rotary gates and m single-bit controlled gates of the specific type, wherein m=d/2, and d is the order of the unitary matrix corresponding to the rotary quantum gate.
The method for processing the unitary matrix corresponding to the rotary quantum gate to obtain m single-quantum bit rotary gates and m single-bit controlled gates of specific types is various, and the obtained effect of the combined action of all the single-quantum bit rotary gates and the single-bit controlled gates of specific types is the same as the action effect of the rotary quantum gate.
In some possible embodiments of the present invention, the single-qubit turnstile and the specific type of single-bit controlled turnstile are obtained by decomposing the unitary matrix corresponding to the turnstile by using a preset uniform control turnstile decomposition rule.
The uniform control gate (Uniformly Controlled Gate or Multiplexed gates) is a generalization of a conditional unitary gate with any number of control qubits, with different unitary operators applied to the target qubit for each different bit configuration of control qubits. Control qubits refer to qubits as control bits, and an exemplary uniform control gate for 3 control qubits corresponds to a unitary matrix as shown below, such a matrix form corresponding to a uniform rotation control gate with control bits above and target bits below.
Each block U is a unitary operator that acts on the same number of qubits. Here, each block is marked with a corresponding control state, for example, when the control bit is |011>When in use, U 011 Acting on the target bit.
The control qubits of the uniform control gates are generally represented by half-fills or boxes on the circuit diagram, and exemplary 3 control qubits of the uniform control gates can be shown in fig. 3a or fig. 3 b. For an n-bit controlled uniform control gate, this is equivalent to 2 n The combination of the uniform control single gates, for example, as shown in fig. 4, the 3 uniform control single gates controlling qubits can be decomposed into 8 uniform control single gates with control information. If each diagonal block in the matrix corresponding to the uniform control gate is a matrix of 2 x 2, the uniform control gate is called a uniform control single gate.
Uniform control doorThe corresponding quantum circuit may be as shown in fig. 5, where \ represents 1 or more control bits, and if \ is 1 bit, u 1 、u 2 The sizes of (2) are all 2 x 2The even control gate is an even control single gate; if \is 3 bits, u 1 、u 2 The sizes of (2) are all 8 x 8. Taking 1 bit as an example, when the control bit is |0>When applying u 1 When the control bit is |1>When applying u 2
The above-mentioned rotating quantum gate may be a uniform control rotating gate, and the matrix of n control quantum bits of the uniform control rotating gate may be expressed as:
according to the above formula for processing the target unitary matrix, taking the target unitary matrix of 4 qubits as an example, the target unitary matrix can be decomposed into an equivalent circuit diagram as shown in fig. 6 through one-time processing, wherein,
in one possible embodiment of the present invention, the uniformly controlled revolving door decomposition rule is: for a 1 n qubit uniform control rotation gate, the uniform control rotation gate corresponds to an order of 2 for a unitary matrix n Can be decomposed into 2 n-1 quantum bit uniform control turngates and 2 CNOT gates, then recursively decompose the n-1 quantum bit uniform control turngates, and finally decompose the n quantum bit uniform control turngates to obtain 2 n-1 Single qubit turnstile and 2 n-1 And CNOT gates.
Illustratively, taking a uniformly controlled turnstile as an example, the following formula illustrates that the logic gate effect before and after decomposition is equivalent:
wherein, the unitary matrix corresponding to CNOT isI is an identity matrix, X is an X gate pairA matrix of responses, in particular +.>R k Is R y Door or R z Door, then XR k1 ) X is equivalent to R k (-λ 1 ),θ 0 =λ 01 ,θ 1 =λ 01
Exemplary, as in FIG. 7, for a 3-bit uniform rotation control gate R k Decomposing the uniform control revolving door to finally obtain 4R k Gates and 4 CNOT gates, because some CNOT gates are juxtaposed on the quantum wire if acting on the quantum wire during decomposition, so that quantum state is not changed after passing through these CNOT gates, effects cancel, and therefore, CNOT gates with effects canceling each other are not included on the quantum wire. The recursive decomposition is performed according to such decomposition rules, with only single qubit rotation gates and CNOT gates at the end.
The rotating quantum gate corresponding unitary matrix obtained by processing the target unitary matrix can be uniformly controlled R y The matrix corresponding to the gate (also called the ucry gate), expressed asThus, for a 2-qubit ucry gate, the equivalent quantum circuit is shown in FIG. 8, and the circuit is equivalent as determined by the derivation of the following equation:
wherein,
the unitary matrix corresponding to the rotary quantum gate obtained by processing the first type of block diagonal matrix can be uniformly controlled R z The gates (also referred to as ucrz gates) correspond to unitary matrices. Thus, for a 2 qubit ucrz gate, the ucrz gate is decomposed to carry as can be seen from the following equationThe uniform control single gate with controlled information and the ucrz gate effect are equivalent:
wherein,
On the basis of fig. 6, one of the first type of block unitary matrices is processed, and the obtained equivalent quantum circuit is shown in fig. 9. For a target unitary matrix with 4 quantum bits, firstly, the target unitary matrix is processed, then the first type of block diagonal matrix is processed, the obtained equivalent quantum circuit diagram is shown in fig. 10, 2 ucrz gates, 1 ucry gate and 4 unitary matrices with 3 quantum bits are obtained, the 4 unitary matrices with 3 quantum bits are respectively subjected to iterative decomposition, and finally, the obtained single quantum bit rotation gate and CNOT gate can be seen. Meanwhile, the ucrz and ucry gates can be decomposed, and the single-quantum bit rotating gate and the single-bit controlled gate of a specific type can be also realized, so that only the single-quantum bit rotating gate and the single-bit controlled gate of the specific type are arranged in a circuit generated by decomposition.
In some possible embodiments of the invention, the method may further comprise:
and when the order number of the target unitary matrix is equal to the preset value, directly decomposing the target unitary matrix to obtain the single-quantum bit revolving door.
When the order number of the initial target unitary matrix is a preset value, the target unitary matrix may not be processed into a first type block diagonal matrix and a rotating quantum gate corresponding unitary matrix, and the target unitary matrix is directly processed. For example, the target unitary matrix has an order of 2, which indicates that the target unitary matrix may be a U gate of single qubit, and at this time, the single qubit rotation gate may be directly obtained. When the order of the target unitary matrix is 4, the single-quantum bit rotation gate and the CNOT gate can be directly obtained by decomposition in other modes.
In some possible embodiments of the present invention, processing a target unitary matrix with an order equal to the preset value as a single qubit rotation gate includes:
decomposing the target unitary matrix by the following formula to obtain the single-quantum bit rotation gate:
U(2)=e R z (α)R y (β)R z (γ)
wherein U is the target unitary matrix, 2 is the order, phi is the phase, alpha, beta and gamma are the rotation angle of the revolving door, R y ,R z Are all the single-qubit turngates.
In the embodiment of the present invention, the quantum circuit equivalent to the target unitary matrix is shown in fig. 11, in which the dashed box represents an uncontrolled gate without any substantial effect, and the gate corresponds to e ,e Since the global phase acts on all quantum logic gates in the quantum wire, the final result obtained through the quantum wire is not substantially changed, and is therefore indicated by a virtual frame on the quantum wire.
It can be seen that, in the embodiment of the present invention, when the order of a target unitary matrix corresponding to any quantum logic gate is greater than a preset value, the target unitary matrix is processed to be represented by the product of a first type of block diagonal matrix and a unitary matrix corresponding to a rotary quantum gate; processing the first type of block diagonal matrix into a second type of block diagonal matrix and a unitary matrix product representation corresponding to the rotary quantum gate; then, taking the diagonal blocks of the second type block diagonal matrix as a new target unitary matrix, and returning to execute the step of processing the target unitary matrix into a product represented by the first type block diagonal matrix and the first rotation matrix when the order of the target unitary matrix is larger than a preset value until the order of the target unitary matrix is equal to the preset value; finally, the unitary matrix corresponding to the rotary quantum gate is processed into a single-quantum bit rotary gate and a single-bit controlled gate of a specific type; and processing the target unitary matrix with the order equal to the preset value into a single-quantum bit revolving gate. By using the embodiment of the invention, the depth of the quantum circuit can be reduced by reducing the number of quantum bits operated by the quantum logic gate, the simulation efficiency of the quantum circuit can be improved, and the fidelity of the decomposed quantum circuit executed on the quantum chip can be ensured.
By applying the method provided by the embodiment of the invention, the target unitary matrix is processed, and the number of CNOT gates obtained isThe same target unitary matrix is decomposed by using a QR method, and the number of CNOT gates obtained is 2 x 4 n -(2n+3)*2 n +2n, a significant reduction in the number of CNOTs can be seen. By using the method provided by the embodiment of the invention, the overall depth of the quantum circuit obtained by processing the unitary matrix in the process of executing the quantum algorithm can be effectively reduced, and the fidelity of executing the quantum circuit on a chip is ensured. And time consumption of decomposing the unitary matrix by using a classical algorithm in the quantum algorithm process is reduced, and in short, less time is spent, so that less CNOT is obtained.
The method provided by the embodiment of the invention can be applied to a scene of solving the problem through any quantum logic gate, in particular to a quantum circuit with a quantum logic gate for operating a plurality of quantum bits, further to a scene of carrying out quantum computation by utilizing the quantum circuit, for example, to a scene of carrying out linear equation solving by utilizing the quantum circuit, to a scene of carrying out chemical simulation by utilizing the quantum circuit, to a scene of carrying out financial computation by utilizing the quantum circuit, to a scene of carrying out data classification by utilizing the quantum circuit, and the like, which are not listed one by one.
Referring to fig. 12, fig. 12 is a schematic structural diagram of an apparatus for decomposing any quantum logic gate according to an embodiment of the present invention, corresponding to the flow shown in fig. 2, the apparatus may include:
a first processing module 1201, configured to process a target unitary matrix corresponding to any quantum logic gate as represented by a product of a first type block diagonal matrix and a unitary matrix corresponding to a rotary quantum gate when an order of the target unitary matrix is greater than a preset value;
a second processing module 1202, configured to process the first type block diagonal matrix into a product representation of a second type block diagonal matrix and a unitary matrix corresponding to the rotary quantum gate;
a third processing module 1203, configured to take diagonal blocks of the second class of block diagonal matrix as a new target unitary matrix, and return to execute the first processing module 1201 until the order of the target unitary matrix is equal to the preset value;
a fourth processing module 1204, configured to process the unitary matrix corresponding to the rotary quantum gate into a single-quantum bit rotary gate and a single-bit controlled gate of a specific type; and processing the target unitary matrix with the order equal to the preset value into a single-quantum bit revolving gate.
In some possible embodiments of the present invention, the first processing module 1201 may include:
And the first processing unit is used for processing the target unitary matrix into the product of a first type block diagonal matrix, a rotary quantum gate corresponding unitary matrix and another first type block diagonal matrix.
In some possible embodiments of the present invention, the first processing unit may be specifically configured to:
the target unitary matrix is processed as a product of a first type block diagonal matrix, a rotating quantum gate corresponding unitary matrix, and another first type block diagonal matrix using the following equation:
wherein U is the target unitary matrix,for a first class of partitioned diagonal matrix, A 1 、A 2 Diagonal blocks in the first type of block diagonal matrix, respectively +.>For another first class of partitioned diagonal matrix, B 1 、B 2 Diagonal blocks in the first type of block diagonal matrix, respectively +.>Corresponding unitary matrix for one rotary quantum gate, and C 2 +S 2 =I d/2 And d is the order of the unitary matrix corresponding to the rotary quantum gate.
In some possible embodiments of the invention, the rotary quantum gate is a controlled R y And (3) a door.
In some possible embodiments of the present invention, the second processing module 1202 may include:
and the second processing unit is used for processing the first type block diagonal matrix into the product of a second type block diagonal matrix, a unitary matrix corresponding to the rotary quantum gate and another second type block diagonal matrix.
In some possible embodiments of the present invention, the second processing unit may be specifically configured to:
processing the first type block diagonal matrix into a product of a second type block diagonal matrix, a rotating quantum gate corresponding unitary matrix and another second type block diagonal matrix by using the following formula:
wherein,for said first class of block diagonal matrix, < >>Is a second type of block diagonal matrix, wherein V is a diagonal block in the second type of block diagonal matrix,>for the unitary matrix corresponding to the rotary quantum gate, the D, the +.>Are diagonal blocks in the unitary matrix corresponding to the rotary quantum gate; />And (3) for another second type of block diagonal matrix, wherein W is a diagonal block in the second type of block diagonal matrix.
In some possible embodiments of the invention, the rotary quantum gate is a controlled R z And (3) a door.
In some possible embodiments of the present invention, the fourth processing module 1204 may include:
and processing the unitary matrix corresponding to the rotary quantum gate into m single-quantum bit rotary gates and m single-bit controlled gates of the specific type, wherein m=d/2, and d is the order of the unitary matrix corresponding to the rotary quantum gate.
In some possible embodiments of the present invention, the single-qubit rotation gate and the specific type of single-bit controlled gate are obtained by decomposing the unitary matrix corresponding to the rotation quantum gate by using a preset uniform control rotation gate decomposition rule.
In some possible embodiments of the present invention, the apparatus may further include:
and the obtaining module is used for directly decomposing the target unitary matrix when the order of the target unitary matrix is equal to the preset value, so as to obtain the single-quantum bit revolving door.
In some possible embodiments of the present invention, the fourth processing module 1204 may be further specifically configured to:
decomposing the target unitary matrix by the following formula to obtain the single-quantum bit rotation gate:
U(2)=e R z (α)R y (β)R z (γ)
wherein U is the target unitary matrix, 2 is the order, phi is the phase, alpha, beta and gamma are the rotation angle of the revolving door, R y ,R z Are all the single-qubit turngates.
It can be seen that, in the embodiment of the present invention, when the order of a target unitary matrix corresponding to any quantum logic gate is greater than a preset value, the target unitary matrix is processed to be represented by the product of a first type of block diagonal matrix and a unitary matrix corresponding to a rotary quantum gate; processing the first type of block diagonal matrix into a second type of block diagonal matrix and a unitary matrix product representation corresponding to the rotary quantum gate; then, taking the diagonal blocks of the second type block diagonal matrix as a new target unitary matrix, and returning to execute the step of processing the target unitary matrix into a product represented by the first type block diagonal matrix and the first rotation matrix when the order of the target unitary matrix is larger than a preset value until the order of the target unitary matrix is equal to the preset value; finally, the unitary matrix corresponding to the rotary quantum gate is processed into a single-quantum bit rotary gate and a single-bit controlled gate of a specific type; and processing the target unitary matrix with the order equal to the preset value into a single-quantum bit revolving gate. By using the embodiment of the invention, the depth of the quantum circuit can be reduced by reducing the number of quantum bits operated by the quantum logic gate, the simulation efficiency of the quantum circuit can be improved, and the fidelity of the decomposed quantum circuit executed on the quantum chip can be ensured.
The embodiment of the invention also provides a storage medium, in which a computer program is stored, wherein the computer program is configured to perform the steps of any of the method embodiments described above when run.
Specifically, in the present embodiment, the above-described storage medium may be configured to store a computer program for executing the steps of:
s201: when the order number of a target unitary matrix corresponding to any quantum logic gate is larger than a preset value, processing the target unitary matrix into a product representation of a first type of block diagonal matrix and a unitary matrix corresponding to a rotary quantum gate;
s202: processing the first type of block diagonal matrix into a second type of block diagonal matrix and a unitary matrix product representation corresponding to a rotary quantum gate;
s203: taking the diagonal blocks of the second class of block diagonal matrix as a new target unitary matrix, and returning to execute S201 until the order of the target unitary matrix is equal to the preset value;
s204: processing the unitary matrix corresponding to the rotary quantum gate into a single-quantum bit rotary gate and a single-bit controlled gate of a specific type; and processing the target unitary matrix with the order equal to the preset value into a single-quantum bit revolving gate.
The present invention also provides an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Specifically, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Specifically, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s201: when the order number of a target unitary matrix corresponding to any quantum logic gate is larger than a preset value, processing the target unitary matrix into a product representation of a first type of block diagonal matrix and a unitary matrix corresponding to a rotary quantum gate;
s202: processing the first type of block diagonal matrix into a second type of block diagonal matrix and a unitary matrix product representation corresponding to a rotary quantum gate;
s203: taking the diagonal blocks of the second class of block diagonal matrix as a new target unitary matrix, and returning to execute S201 until the order of the target unitary matrix is equal to the preset value;
s204: processing the unitary matrix corresponding to the rotary quantum gate into a single-quantum bit rotary gate and a single-bit controlled gate of a specific type; and processing the target unitary matrix with the order equal to the preset value into a single-quantum bit revolving gate.
While the foregoing is directed to embodiments of the present invention, other and further embodiments of the invention may be devised without departing from the basic scope thereof, and the scope thereof is determined by the claims that follow.

Claims (14)

1. A method of decomposing any quantum logic gate, the method comprising:
when the order number of a target unitary matrix corresponding to any quantum logic gate is larger than a preset value, processing the target unitary matrix into a product representation of a first type of block diagonal matrix and a unitary matrix corresponding to a rotary quantum gate;
processing the first type of block diagonal matrix into a second type of block diagonal matrix and a unitary matrix product representation corresponding to a rotary quantum gate;
taking diagonal blocks of the second type block diagonal matrix as a new target unitary matrix, and returning to execute the step of processing the target unitary matrix into a product represented by a first type block diagonal matrix and a first rotation matrix when the order of the target unitary matrix is larger than a preset value until the order of the target unitary matrix is equal to the preset value;
processing the unitary matrix corresponding to the rotary quantum gate into a single-quantum bit rotary gate and a single-bit controlled gate of a specific type; and processing the target unitary matrix with the order equal to the preset value into a single-quantum bit revolving gate.
2. The method of claim 1, wherein the processing the target unitary matrix as represented by a product of a first type of block diagonal matrix and a rotating quantum gate corresponding unitary matrix comprises:
And processing the target unitary matrix into the product of a first type of block diagonal matrix, a rotating quantum gate corresponding unitary matrix and another first type of block diagonal matrix.
3. The method of claim 2, wherein the processing the target unitary matrix as a product of a first type of block diagonal matrix, a rotating quantum gate corresponding unitary matrix, and another first type of block diagonal matrix, specifically comprises:
the target unitary matrix is processed as a product of a first type block diagonal matrix, a rotating quantum gate corresponding unitary matrix, and another first type block diagonal matrix using the following equation:
wherein U is the target unitary matrix,for a first class of partitioned diagonal matrix, A 1 、A 2 Diagonal blocks in the first type of block diagonal matrix, respectively +.>For another first class of partitioned diagonal matrix, B 1 、B 2 Diagonal blocks in the first type of block diagonal matrix, respectively +.>Corresponding unitary matrix for rotating quantum gate, and C 2 +S 2 =I d/2 And d is the order of the unitary matrix corresponding to the rotary quantum gate.
4. The method of claim 2, wherein the rotary quantum gate is a controlled R y And (3) a door.
5. The method of claim 1, wherein said processing the first class of block diagonal matrices into a second class of block diagonal matrices and rotating quantum gate corresponding unitary matrix product representations comprises:
And processing the first type of block diagonal matrix into the product of a second type of block diagonal matrix, a unitary matrix corresponding to the rotary quantum gate and another second type of block diagonal matrix.
6. The method of claim 5, wherein processing the first type of block diagonal matrix as a product of a second type of block diagonal matrix, a rotating quantum gate corresponding unitary matrix, and another second type of block diagonal matrix, specifically comprises:
processing the first type block diagonal matrix into a product of a second type block diagonal matrix, a rotating quantum gate corresponding unitary matrix and another second type block diagonal matrix by using the following formula:
wherein,for said first class of block diagonal matrix, < >>Is a second type of block diagonal matrix, wherein V is a diagonal block in the second type of block diagonal matrix,>for the unitary matrix corresponding to the rotary quantum gate, the D, the +.>Are diagonal blocks in the unitary matrix corresponding to the rotary quantum gate; />And (3) for another second type of block diagonal matrix, wherein W is a diagonal block in the second type of block diagonal matrix.
7. The method of claim 5, wherein the rotary quantum gate is a controlled R z And (3) a door.
8. The method of claim 1, wherein said processing said rotated quantum gate corresponding unitary matrix into a single-qubit rotated gate and a particular type of single-bit controlled gate comprises:
and processing the unitary matrix corresponding to the rotary quantum gate into m single-quantum bit rotary gates and m single-bit controlled gates of the specific type, wherein m=d/2, and d is the order of the unitary matrix corresponding to the rotary quantum gate.
9. The method of claim 8, wherein the single-qubit rotation gate and the particular type of single-bit controlled gate are derived by decomposing the unitary matrix corresponding to the rotation quantum gate using a preset uniform control rotation gate decomposition rule.
10. The method according to claim 1, characterized in that the method further comprises:
and when the order number of the target unitary matrix is equal to the preset value, directly decomposing the target unitary matrix to obtain the single-quantum bit revolving door.
11. The method of any of claims 1-10, wherein processing the target unitary matrix with an order equal to the preset value as a single-qubit rotation gate comprises:
decomposing the target unitary matrix by the following formula to obtain the single-quantum bit rotation gate:
U(2)=e R z (α)R y (β)R z (γ)
Wherein U is the target unitary matrix, 2 is the order, phi is the phase, alpha, beta and gamma are the rotation angle of the revolving door, R y ,R z Are all the single-qubit turngates.
12. A disaggregation apparatus for an arbitrary quantum logic gate, the apparatus comprising:
the first processing module is used for processing the target unitary matrix into a product representation of a first type of block diagonal matrix and a unitary matrix corresponding to the rotary quantum gate when the order of the target unitary matrix corresponding to any quantum logic gate is larger than a preset value;
the second processing module is used for processing the first type block diagonal matrix into a second type block diagonal matrix and a unitary matrix product representation corresponding to the rotary quantum gate;
the third processing module is used for taking the diagonal blocks of the second class of block diagonal matrix as a new target unitary matrix, and returning to execute the first processing module until the order of the target unitary matrix is equal to the preset value;
the fourth processing module is used for processing the unitary matrix corresponding to the rotary quantum gate into a single-quantum bit rotary gate and a single-bit controlled gate of a specific type; and processing the target unitary matrix with the order equal to the preset value into a single-quantum bit revolving gate.
13. A storage medium having a computer program stored therein, wherein the computer program is arranged to perform the method of any of claims 1 to 11 when run.
14. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to run the computer program to perform the method of any of the claims 1 to 11.
CN202210989693.6A 2022-08-16 2022-08-16 Method and device for decomposing any quantum logic gate, storage medium and electronic device Pending CN117634619A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210989693.6A CN117634619A (en) 2022-08-16 2022-08-16 Method and device for decomposing any quantum logic gate, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210989693.6A CN117634619A (en) 2022-08-16 2022-08-16 Method and device for decomposing any quantum logic gate, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN117634619A true CN117634619A (en) 2024-03-01

Family

ID=90025778

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210989693.6A Pending CN117634619A (en) 2022-08-16 2022-08-16 Method and device for decomposing any quantum logic gate, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN117634619A (en)

Similar Documents

Publication Publication Date Title
CN108154240B (en) Low-complexity quantum line simulation system
CN112633508B (en) Quantum circuit generation method and device, storage medium and electronic device
CN111563599B (en) Quantum circuit decomposition method and device, storage medium and electronic device
EP4152215A1 (en) Quantum state preparation circuit generation method and apparatus, chip, device, and program product
CN113222155B (en) Quantum circuit construction method and device, electronic device and storage medium
CN112633507B (en) Method and device for encoding complex vector to quantum circuit
CN112232513A (en) Quantum state preparation method and device
CN114764549B (en) Quantum circuit simulation calculation method and device based on matrix product state
CN115293254A (en) Quantum multilayer perceptron-based classification method and related equipment
CN112214200B (en) Quantum subtraction operation method, device, electronic device and storage medium
CN113222157B (en) Quantum simulation method, quantum simulation device, electronic device and storage medium
CN113222153B (en) Quantum state simulation method and device, storage medium and electronic device
CN114819163B (en) Training method and device for quantum generation countermeasure network, medium and electronic device
CN114358317B (en) Data classification method based on machine learning framework and related equipment
CN116403657A (en) Drug response prediction method and device, storage medium and electronic device
CN114511094B (en) Quantum algorithm optimization method and device, storage medium and electronic device
CN117634619A (en) Method and device for decomposing any quantum logic gate, storage medium and electronic device
CN117521821A (en) Quantum circuit generation method and device, storage medium and electronic device
CN115809707A (en) Quantum comparison operation method and device, electronic device and basic arithmetic assembly
CN114692879B (en) Quantum preprocessing method and device based on sparse linear system
CN117744818A (en) Constant adder based on quantum Fourier transform, operation method and related device
CN114819169B (en) Quantum estimation method and device for matrix condition number
CN116366250B (en) Quantum federal learning method and system
CN116167407A (en) Quantum circulation neural network-based data prediction method and related equipment
CN114881239A (en) Method and apparatus for constructing quantum generator, medium, and electronic apparatus

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination