CN111582491B - Quantum circuit construction method and device - Google Patents
Quantum circuit construction method and device Download PDFInfo
- Publication number
- CN111582491B CN111582491B CN202010369413.2A CN202010369413A CN111582491B CN 111582491 B CN111582491 B CN 111582491B CN 202010369413 A CN202010369413 A CN 202010369413A CN 111582491 B CN111582491 B CN 111582491B
- Authority
- CN
- China
- Prior art keywords
- quantum
- module
- functional
- constructing
- state
- 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.)
- Active
Links
- 238000010276 construction Methods 0.000 title claims abstract description 21
- 239000011159 matrix material Substances 0.000 claims abstract description 44
- 238000000034 method Methods 0.000 claims abstract description 42
- 238000006243 chemical reaction Methods 0.000 claims abstract description 23
- 238000006073 displacement reaction Methods 0.000 claims abstract description 8
- 230000006870 function Effects 0.000 claims description 32
- 238000004590 computer program Methods 0.000 claims description 15
- 230000009466 transformation Effects 0.000 claims description 14
- 230000001131 transforming effect Effects 0.000 claims description 10
- 230000009471 action Effects 0.000 claims description 8
- 238000005516 engineering process Methods 0.000 abstract description 7
- 238000004364 calculation method Methods 0.000 abstract description 2
- 239000002096 quantum dot Substances 0.000 description 28
- 238000010586 diagram Methods 0.000 description 10
- 239000013598 vector Substances 0.000 description 10
- 238000004422 calculation algorithm Methods 0.000 description 9
- 239000007787 solid Substances 0.000 description 8
- 230000005540 biological transmission Effects 0.000 description 6
- 230000008569 process Effects 0.000 description 6
- 238000004088 simulation Methods 0.000 description 6
- 238000005259 measurement Methods 0.000 description 4
- 238000004891 communication Methods 0.000 description 2
- 238000009795 derivation Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000021615 conjugation Effects 0.000 description 1
- 238000005336 cracking Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 239000002184 metal Substances 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000000737 periodic effect Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 238000000844 transformation Methods 0.000 description 1
- 238000005303 weighing Methods 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
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Mathematical Analysis (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Condensed Matter Physics & Semiconductors (AREA)
- Computational Mathematics (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Artificial Intelligence (AREA)
- Complex Calculations (AREA)
Abstract
The application belongs to the field of quantum computation, and particularly discloses a method and a device for constructing a quantum circuit, wherein the method comprises the following steps: obtaining N qubits and an N x N matrix; wherein N is a positive integer and n=2 n The method comprises the steps of carrying out a first treatment on the surface of the Build for quantum state |j>Conversion to quantum state |k>A linearly combined functional module, wherein the functional module implements a quantum state |j>Conversion intoMatrix form of the functional modulesThe k represents the row of the matrix, the j represents the column of the matrix, and the a, b represent the displacement of the j, k; and constructing a quantum circuit corresponding to the functional module by utilizing a quantum logic gate. The application provides a quantum circuit construction method which is applied to quantum shift Fourier transform and used for simulating quantum calculation so as to fill the blank of the related technology.
Description
Technical Field
The application belongs to the technical field of quantum computing, and particularly relates to a method and a device for constructing a quantum circuit.
Background
Quantum computers use the superposition of quanta and in theory have the ability to accelerate exponentially in some cases. For example, cracking RSA keys takes hundreds of years on classical computers, while executing quantum algorithms on quantum computers takes only a few hours. However, the current quantum computer is limited by the limited controllable bit number caused by the development of quantum chip hardware, so that the computing capability is limited, the quantum algorithm cannot be universally operated, and the quantum algorithm is operated by a quantum computing simulation method.
In the analog implementation of quantum computing, it is often necessary to construct quantum algorithms with the aid of various quantum logic gates. For example, the quantum fourier transform is applied in solving the phase estimation algorithm, and the quantum shift fourier transform is widely focused in solving the quantum computation of the periodic boundary condition linear partial differential equation system, but in the prior art, it is very difficult to realize the quantum circuit simulation of the quantum shift fourier transform on a quantum virtual machine constructed by a classical computer.
Based on this, it is highly demanded to provide a method for constructing a quantum circuit, which is applied in the quantum shift fourier transform (shifted DFT) for the simulation of quantum computation, so as to fill the gap of the related art.
Disclosure of Invention
The application aims to provide a method and a device for constructing a quantum circuit, which solve the defects in the prior art and can be applied to quantum shift Fourier transform for simulating quantum calculation so as to fill the blank of the related technology.
One embodiment of the application provides a method for constructing a quantum circuit, which comprises the following steps:
obtaining N qubits and an N x N matrix; wherein N is a positive integer and n=2 n ;
Build for quantum state |j>Conversion to quantum state |k>A linearly combined functional module, wherein the functional module implements a quantum state |j>Conversion intoMatrix form of the functional modulesThe k represents the row of the matrix, the j represents the column of the matrix, and the a, b represent the displacement of the j, k;
and constructing a quantum circuit corresponding to the functional module by utilizing a quantum logic gate.
A method for constructing a quantum wire as described above, wherein preferably, the constructing a functional module for transforming a quantum state |j > into a linear combination of quantum states |k > includes:
converting the quantum state |j > to a binary representation;
constructing a plurality of function sub-modules of the function module; the number of the functional submodules is determined by the number of the quantum bits, and the evolution result of the quantum bits corresponding to the m bits of j after the action of the mth functional submodule is as follows, wherein m is more than or equal to 1 and less than or equal to n:
and constructing an exchange operation module, and obtaining a linear combination function module for realizing quantum state |k > according to each function sub-module and the exchange operation module.
The method for constructing a quantum circuit as described above, preferably, before the constructing a plurality of functional sub-modules of the functional module, further includes:
defining quantum logic gatesAnd Quantum logic gate-> wherein ,/>
The method for constructing a quantum circuit as described above, wherein preferably, the constructing a plurality of functional sub-modules of the functional module includes:
constructing a plurality of Hadamard gates,Door(s)>Gate and Pauli-X gate sub-quantum wires.
The method for constructing a quantum circuit according to the above aspect, preferably, the constructing, by using a quantum logic gate, a quantum circuit corresponding to the functional module includes:
according to the quantum bits respectively operated by each sub-quantum circuit and the exchange operation module, sequentially inserting each sub-quantum circuit and the exchange operation module into the quantum circuit, wherein the exchange operation module comprises: SWAP gate.
A further embodiment of the application provides a quantum wire constructed according to any of the methods described above.
Still another embodiment of the present application provides a quantum wire constructing apparatus, including:
the acquisition module is used for acquiring N quantum bits and an N matrix; wherein N is a positive integer and n=2 n ;
A first construction module for constructing a quantum state |j>Conversion to quantum state |k>A linearly combined functional module, wherein the functional module implements a quantum state |j>Conversion intoMatrix form of the functional modules->The k represents the row of the matrix, the j represents the column of the matrix, and the a, b represent the displacement of the j, k;
and the second construction module is used for constructing the quantum circuit corresponding to the functional module by utilizing the quantum logic gate.
A quantum wire constructing apparatus as described above, wherein preferably, the first constructing module includes:
a conversion module for converting the quantum state |j > into a binary representation;
the third construction module is used for constructing a plurality of function sub-modules of the function module; the number of the functional submodules is determined by the number of the quantum bits, and the evolution result of the quantum bits corresponding to the m bits of j after the action of the mth functional submodule is as follows, wherein m is more than or equal to 1 and less than or equal to n:
and the fourth construction module is used for constructing an exchange operation module, and obtaining a linear combination function module for realizing quantum state |k > according to each function sub-module and the exchange operation module.
A further embodiment of the application provides a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the method of any of the preceding claims when run.
Yet another embodiment of the application provides an electronic device comprising a memory having a computer program stored therein and a processor configured to run the computer program to perform the method described in any of the above.
Compared with the prior art, the application discloses a method for constructing a quantum circuit, which is used for transforming a quantum state |j > into a quantum state |k > linear combination quantum circuit, solves the problem of simulating quantum shift Fourier transformation in quantum computing, and fills the blank of the related technology.
Drawings
Fig. 1 is a hardware block diagram of a computer terminal of a quantum circuit construction method according to an embodiment of the present application;
fig. 2 is a schematic flow chart of a quantum circuit construction method according to an embodiment of the present application;
fig. 3 is a schematic diagram of a first functional submodule quantum circuit according to an embodiment of the present application;
FIG. 3 (a) is a first functional sub-module according to an embodiment of the present applicationA schematic of a quantum circuit of (a);
FIG. 3 (b) is a first functional sub-module according to an embodiment of the present applicationA schematic of a quantum circuit of (a);
fig. 4 is a schematic diagram of a quantum circuit of a second functional submodule according to an embodiment of the present application;
FIG. 4 (a) is a second functional sub-module according to an embodiment of the present applicationA schematic of a quantum circuit of (a);
FIG. 4 (b) is a block diagram of an embodiment of the present applicationTwo-function sub-moduleA schematic of a quantum circuit of (a);
fig. 5 is a schematic diagram of a third functional sub-module quantum circuit provided by an embodiment of the present application;
FIG. 5 (a) is a third functional sub-module according to an embodiment of the present applicationA schematic of a quantum circuit of (a);
FIG. 5 (b) is a third functional sub-module according to an embodiment of the present applicationA schematic of a quantum circuit of (a);
FIG. 6 is a schematic diagram of a quantum circuit of a quantum shift Fourier transform of three qubits provided by an embodiment of the present application;
FIG. 7 is a schematic diagram of a quantum circuit of a quantum shift Fourier transform of n qubits provided by an embodiment of the present application;
fig. 8 is a schematic structural diagram of a quantum circuit building device according to an embodiment of the present application.
Detailed Description
The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the application.
It should be noted that the terms "first," "second," and the like in the description and in the claims are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
The embodiment of the application provides a method for constructing a quantum circuit, which is used for simulating the conversion operation of a quantum state in the quantum circuit, and can be applied to electronic equipment such as a computer terminal, in particular to a common computer, a quantum computer and the like.
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 of a quantum circuit construction method according to an embodiment of the present application. As shown in fig. 1, the computer terminal 10 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 10 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 the quantum computing simulation method in the embodiment of the present application, and the processor 102 executes the software programs and modules stored in the memory 104 to perform various functional applications and data processing, i.e., implement the method described above. 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 located remotely from the processor 102, which may be connected to the computer terminal 10 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. The specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal 10. 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.
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. Quantum logic gates are used, which are the basis for forming a quantum circuit, and comprise single-bit quantum logic gates, such as Hadamard gates (H gates), pauli-X gates, pauli-Y gates, pauli-Z gates, RX gates, RY gates and RZ gates; multi-bit quantum logic gates such as CNOT gate, CR gate, iSWAP gate, toffoli gate. 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. Assume that a quantum state right vector isThe corresponding quantum state left vector is +.> wherein ,c1 ,c 2 ,...,c n All are plural and are added with>Representation c n Is a conjugate of (c). It can be seen that the right vector represents an n×1 column vector and the left vector represents a 1×n row vectorThe amount, and the two vectors are transposed conjugated to each other.
The quantum fourier transform is the basis for implementing many quantum algorithms, such as phase estimation algorithms, implicit sub-group problems, and the period for solving arbitrary functions. In mathematical expression, there is a vector x of complex numbers 0 ,x 1 ,…,x N-1 Transforming it to obtain a new N-dimensional vector y 0 ,y 1 ,…,y N-1 The conversion is defined as follows Generalized to the quantum Fourier transform, which can be understood to act on a set of orthonormal groups |0>,…,|N-1>The results after the action are as follows: />Can also be written as +.>
It will be appreciated by those skilled in the art that in classical computers, the basic unit of information is a bit, one bit having two states, 0 and 1, the most common physical implementation being to represent both states by the level of high and low. In quantum computing, the basic unit of information is a qubit, and one qubit also has two states of 0 and 1, denoted as |0> and |1>, but it can be in a superposition of the two states of 0 and 1, which is not possessed by classical bits. After measurement, the state of the qubit collapses to a certain state (eigenstate, here |0> state, |1> state), where| > is the dirac sign.
Quantum states, i.e., states of a qubit, whose eigenstates are represented in binary in a quantum algorithm (or weighing subroutine). For example, a group of qubits q0, q1, q2, representing the 0 th, 1 st, and 2 nd qubits, ordered from high order to low order as q2q1q0, the quantum state of the group of qubits being 2 3 Intrinsic of eachThe superposition of states, 8 eigenstates (defined states) refer to: i000>、|001>、|010>、|011>、|100>、|101>、|110>、|111>Each eigenstate corresponds to a qubit, e.g., |000>In states, 000 corresponds to q2q1q0 from high to low. In short, a quantum state is an overlapped state composed of each eigenstate, and when the probability amplitude of the other states is 0, it is in one of the determined eigenstates.
As shown in fig. 2, fig. 2 is a flow chart of a quantum circuit construction method, including:
s201: obtaining N qubits and an N x N matrix; wherein N is a positive integer and n=2 n 。
Specifically, a matrix of N qubits and N is obtained, where the matrix of N qubits and N is obtainable by user input such that a computation basis (or quantum state) may be represented by N qubits, computing the N qubit state | … 0>Is a positive integer and n=2 n Then base |0>,…,|2 n -1>Is the computational basis of a quantum computer with n qubits.
S202 is constructed for incorporating quantum state |j>Conversion to quantum state |k>A linearly combined functional module, wherein the functional module implements a quantum state |j>Conversion intoMatrix form of the functional modulesThe k represents the rows of the matrix, j represents the columns of the matrix, and the a, b represent the shifts of j, k.
Quantum shift Fourier transform, i.e. the basis |j will be calculated>TransformationQuantum state |k>The linear combination is->Where i is a complex number, classical shiftThe bit fourier transform can be regarded as a generalization of the discrete fourier transform, i.e. shifting the transformed samples by a and b in the time and/or frequency domain, respectively, in the general form +.>This shift transformation is most often used for data symmetry to represent different boundary symmetries, which correspond to different forms of discrete cosine and sine transformations for real symmetric data, the purpose of which is to construct the quantum wire is to realize the transformation->The matrix form of the quantum wires to be built is +.>Shift (shift), in particular the position offset of j, k, is used to construct the quantum state |j>Conversion to quantum state |k>A linear combination functional module comprising the steps of:
s2021 converting the quantum state |j > to a binary representation.
Specifically, the binary representation of the non-negative integer x is:
x=x 1 x 2 …xn=x 1 2 n-1 +x 2 2 n-2 +…+x n 2 0
the binary representation of the decimal is:
0.x l x l+1 …x m =x l 2 -1 +x l+1 2 -2 +…+x m 2 -m+l-1
thus, generalize to quantum state |j>Binary representation of (a), namely: quantum state |j>Written in binary form as j=j 1 j 2 …j n More positive, it can be written as j=j 1 2 n-1 +j 2 2 n-2 +…+j n 2 0 Quantum state |j>After conversion to binary representation, the quantum state |j is realized for more intuitively showing the functional module>Conversion intoCan be deduced as follows, namely:
is provided with
Then
Because of
exp (2pi im) =1, m ε Z, where Z is an integer set
Then
S2022, constructing a plurality of function sub-modules of the function module; the number of the functional submodules is determined by the number of the quantum bits, and the evolution result of the quantum bits corresponding to the m bits of j after the action of the mth functional submodule is as follows, wherein m is more than or equal to 1 and less than or equal to n:
specifically, several functional sub-modules of the functional module are constructedPreviously, quantum logic gates could be definedAnd Quantum logic gate-> wherein ,/>
Specifically, from the derivation of step S2021, it can be seen from the final result that each qubit is subjected to Hadamard gate to generate a relative bit transform, i.e. unitary transform And
constructing a plurality of function sub-modules of the function module; the number of the functional submodules is determined by the number of the quantum bits, and the evolution result of the quantum bits corresponding to the m bits of j after the action of the mth functional submodule is as follows, wherein m is more than or equal to 1 and less than or equal to n:
and constructing a plurality of functional sub-modules of the functional module, including constructing a plurality of sub-modules including Hadamard gates,Door(s)>Gate and Pauli-X gate sub-quantum wires.
Taking the example of the qubit number n=3 as an example, the process of constructing the functional sub-module performs step S202, specifically:
as can be seen from the above derivation, the result can be seen as consisting of 3 functional sub-modules, wherein the quantum states of the first functional sub-module are: the first functional sub-module constructed by the method is shown in figure 3, and it can be seen that figure 3 is composed of quantum state |j 1 >、|j 2 >、|j 3 >、|a 1 >、|a 2 >、|a 3 >、|b 1 >、|b 2 >、|b 3 >Corresponding qubit, time line, and quantum logic gate H gate, pauli-X gate and two functional sub-modules composed of quantum logic gates ∈ -> and />A constitution in which the quantum logic gate H gate acts on the quantum state |j 1 >On the corresponding qubit; functional submodule->Acting at |j 1 >、|j 2 >、|j 3 >、|a 1 >、|a 2 >、|a 3 >On the corresponding qubit, and the functional submodule->The vertical lines and the hollow points are connected, when the quantum state |b 3 >The corresponding qubit quantum state is |0>When executingGo->The operation is not executed otherwise; likewise, functional submodule->Acting at |j 1 >、|j 2 >、|j 3 >、|a 1 >、|a 2 >、|a 3 >On the corresponding qubit, and the functional submodule->The vertical lines and solid points connected represent when the quantum state |b 3 >The corresponding qubit quantum state is |1>Execution +.>The operation is not executed otherwise; vertical lines and solid dots connected to the Pauli-X gate of the quantum logic gate indicate when the quantum state |b 3 >The corresponding qubit quantum state is |1>And executing Pauli-X gate operation, otherwise, not executing.
As shown in fig. 3 (a), it can be seen that fig. 3 (a) is composed of quantum states |j 1 >、|j 2 >、|j 3 >、|a 1 >、|a 2 >、|a 3 >Corresponding qubit, time line, and Quantum logic Gate-> Constitution, wherein the quantum logic gate->Acting in quantum state |j 1 >On the corresponding qubit; AND quantum logicDoor->The vertical lines and solid points connected represent when the quantum state |a 1 >The corresponding qubit quantum state is |1>Execution +.>Door operation, otherwise not performed; and quantum logic gate->The vertical lines and solid dots connected represent when the quantum state |j 2 >The corresponding qubit quantum state is |1>Execution +.>Door operation, otherwise not performed; and quantum logic gate->The vertical lines and solid points connected represent when the quantum state |a 2 >The corresponding qubit quantum state is |1>Execution +.>Door operation, otherwise not performed; and quantum logic gate->The vertical lines and solid dots connected represent when the quantum state |j 3 >The corresponding qubit quantum state is |1>Execution +.>Door operation, otherwise not performed; and quantum logic gate->The vertical lines and solid points connected represent when the quantum state |a 3 >The corresponding qubit quantum state is |1>Execution +.>Gate operation, otherwise not performed. Likewise, the->As shown in fig. 3 (b), the functions of the solid or hollow dots connected to each functional module are the same as those described above, and will not be described here again.
The quantum state of the second functional submodule is: the second functional submodule constructed therewith is shown in fig. 4, wherein +>As shown in figure 4 (a), and (2)>As shown in fig. 4 (b); the quantum state of the third functional submodule is: the third functional submodule constructed therewith is shown in fig. 5, wherein +>As shown in fig. 5 (a), +.>The quantum circuit of (a) is shown in fig. 5 (b).
S2023, constructing an exchange operation module, and obtaining a linear combination function module for realizing quantum state |k > according to each function sub-module and the exchange operation module.
As can be appreciated by those skilled in the art, the essence of a quantum circuit is that the matrix form corresponding to each transformation performs operations on the quantum state vector according to time sequence, so as to realize the evolution of the quantum state, and the operation of the corresponding matrix and the quantum state is realized whether the quantum fourier transformation or the quantum shift fourier transformation on the quantum circuit is simulated.
Specifically, a switching operation module is constructed, the main function of the module is to switch the states of two bits, and the status of the two bits is peer-to-peer, so that no control and controlled relationship exists.
And obtaining a linear combination function module for realizing quantum state |k > according to each function sub-module and the exchange operation module.
S203: and constructing a quantum circuit for realizing the functional module by using a quantum logic gate.
Specifically, the functional module realizes quantum state |j>Conversion intoAccording to the quantum bits respectively operated by each sub-quantum circuit and the exchange operation module, sequentially inserting each sub-quantum circuit and the exchange operation module into the quantum circuit, wherein the exchange operation module comprises: a SWAP gate; the quantum logic gate comprises a Hadamard gate,/-a>Door(s)>Gates and Pauli-X gates.
Illustratively, the above example with a qubit number n=3 is followed, i.e. the functional module implements a quantum state |j>Conversion intoThe quantum circuit shown in fig. 6, i.e., three functional sub-modules and a switching operation module (quantum state |j shown in fig. 6 1 >On corresponding qubitsIcon "X" and quantum state |j 3 >The corresponding icon 'X' and the connecting vertical line thereof on the quantum bit, namely the SWAP gate of the exchange operation module in the quantum circuit), are inserted into the quantum circuit in sequence, so that +_ can be realized>And constructing a corresponding quantum circuit. It will be appreciated that for the general case, where the number of qubits is n, the functional module implements the quantum state |j>Is changed into->Each of n sub-quantum circuits and a switching operation module (SWAP gate) were inserted into the quantum circuits in this order, to obtain a quantum circuit as shown in fig. 7.
The above process fully shows the process of constructing the quantum circuit according to the above method, and the sub-quantum circuit or the quantum circuit constructed by any of the above methods, which are equivalent and/or carried out equivalently by a person skilled in the art, fall within the above protection scope.
It should be noted that, the quantum shift fourier transform corresponding to the quantum circuit shown in fig. 7 supports a controlled operation, that is, the transform operation is performed only when the control bits are all 1, otherwise, the transform operation is not performed.
Specifically, the qubit shown in fig. 7 may further include: control bits (not shown) for simulating controlled operations in quantum computing, in particular: and judging whether to execute the step of converting the quantum state |j > into the quantum state |k > linear combination functional module according to the control bit. The control bit is used as the controlled identification bit, has no other physical significance, is not limited, and is preferably one bit in order to reduce the occupation of computing resources.
Further, in order to facilitate subsequent reduction, the inverse transformation operation may also be performed on the transformed linear combination of quantum states |k >, i.e.: and performing transposed conjugation operation corresponding to the functional module step of converting the quantum state |j > into the quantum state |k > linear combination so as to restore the quantum state |k > linear combination into the quantum state |j >. In practical quantum applications, the transform and transpose conjugate operations tend to occur in pairs.
Compared with the prior art, the application discloses a method for constructing a quantum circuit, which is used for transforming a quantum state |j > into a quantum state |k > linear combination quantum circuit, solves the problem of simulating quantum shift Fourier transformation in quantum computing, and fills the blank of the related technology.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a quantum circuit construction device according to an embodiment of the present application, which corresponds to the flow shown in fig. 2, and may include:
an obtaining module 801, configured to obtain N qubits and an n×n matrix; wherein N is a positive integer and n=2 n ;
A first construction module 802 for constructing a quantum state |j>Conversion to quantum state |k>A linearly combined functional module, wherein the functional module implements a quantum state |j>TransformationMatrix form of the functional modules->The k represents the row of the matrix, the j represents the column of the matrix, and the a, b represent the displacement of the j, k;
and the second construction module 803 is used for constructing the quantum circuit corresponding to the functional module by utilizing the quantum logic gate.
Specifically, the first construction module includes:
a conversion module for converting the quantum state |j > into a binary representation;
the third construction module is used for constructing a plurality of function sub-modules of the function module; the number of the functional submodules is determined by the number of the quantum bits, and the evolution result of the quantum bits corresponding to the m bits of j after the action of the mth functional submodule is as follows, wherein m is more than or equal to 1 and less than or equal to n:
and the fourth construction module is used for constructing an exchange operation module, and obtaining a linear combination function module for realizing quantum state |k > according to each function sub-module and the exchange operation module.
Compared with the prior art, the application discloses a method for constructing a quantum circuit, which is used for transforming a quantum state |j > into a quantum state |k > linear combination quantum circuit, solves the problem of simulating quantum shift Fourier transformation in quantum computing, and fills the blank of the related technology.
The embodiment of the application also provides a storage medium in which a computer program is stored, wherein the computer program is arranged 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:
step S201, obtaining N quantum bits and a matrix of N; wherein N is a positive integer and n=2 n ;
Step S202 is constructed for incorporating the quantum state |j>Conversion to quantum state |k>A linearly combined functional module, wherein the functional module implements a quantum state |j>Conversion intoMatrix form of the functional modulesThe k represents the row of the matrix, the j represents the column of the matrix, and the a, b represent the displacement of the j, k;
and S203, constructing a quantum circuit corresponding to the functional module by utilizing a quantum logic gate.
Specifically, in the present embodiment, the storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
Compared with the prior art, the application discloses a method for constructing a quantum circuit, which is used for transforming a quantum state |j > into a quantum state |k > linear combination quantum circuit, solves the problem of simulating quantum shift Fourier transformation in quantum computing, and fills the blank of the related technology.
The present application 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:
step S201, obtaining N quantum bits and a matrix of N; wherein N is a positive integer and n=2 n ;
Step S202 is constructed for incorporating the quantum state |j>Conversion to quantum state |k>A linearly combined functional module, wherein the functional module implements a quantum state |j>Conversion intoMatrix form of the functional modulesThe k represents the row of the matrix, the j represents the column of the matrix, and the a, b represent the displacement of the j, k;
and S203, constructing a quantum circuit corresponding to the functional module by utilizing a quantum logic gate.
Compared with the prior art, the application discloses a method for constructing a quantum circuit, which is used for transforming a quantum state |j > into a quantum state |k > linear combination quantum circuit, solves the problem of simulating quantum shift Fourier transformation in quantum computing, and fills the blank of the related technology.
While the foregoing is directed to embodiments of the present application, other and further embodiments of the application may be devised without departing from the basic scope thereof, and the scope thereof is determined by the claims that follow.
Claims (10)
1. The method for constructing the quantum circuit is characterized by comprising the following steps of:
obtaining N qubits and a matrix of N+ N; wherein N is a positive integer and n=2 n ;
Constructing a functional module for transforming the quantum state |j > into the quantum state |k > linear combination, wherein the functional module comprises a functional sub-module and a switching operation module, and the functional module realizes the transformation of the quantum state |j > into the quantum state |kMatrix form of the functional modules->The k represents the row of the matrix, the j represents the column of the matrix, and the a, b represent the displacement of the j, k;
and constructing a quantum circuit corresponding to the functional module by utilizing a quantum logic gate.
2. The method of claim 1, wherein said constructing a functional module for transforming quantum state |j > into a linear combination of quantum states |k >, comprises:
converting the quantum state |j > to a binary representation;
constructing a plurality of function sub-modules of the function module; the number of the functional submodules is determined by the number of the quantum bits, and the evolution result of the quantum bits corresponding to the m bits of j after the action of the mth functional submodule is as follows, wherein m is more than or equal to 1 and less than or equal to n:
and constructing an exchange operation module, and obtaining a linear combination function module for realizing quantum state |k > according to each function sub-module and the exchange operation module.
3. The method according to claim 2, further comprising, prior to said constructing a number of functional sub-modules of said functional module:
defining quantum logic gatesAnd Quantum logic gate-> wherein ,
4. a method according to claim 3, wherein said constructing a number of functional sub-modules of said functional module comprises:
constructing a plurality of Hadamard gates,And a sub-quantum wire of Pauli-X gate.
5. A method according to claim 3, wherein the constructing a quantum circuit corresponding to the functional module using quantum logic gates includes:
according to the quantum bits respectively operated by each sub-quantum circuit and the exchange operation module, sequentially inserting each sub-quantum circuit and the exchange operation module into the quantum circuit, wherein the exchange operation module comprises: SWAP gate.
6. A quantum wire constructed according to the method of any one of claims 1-5.
7. The device for constructing the quantum circuit is characterized by comprising the following components:
an acquisition module for acquiring N qubits and a matrix of N x N; wherein N is a positive integer and n=2 n ;
A first construction module for constructing a functional module for transforming the quantum state |j > into the quantum state |k > linear combination, wherein the functional module comprises a functional sub-module and a switching operation module, and the functional module realizes the transformation of the quantum state |j > into the quantum state |kMatrix form of the functional modules->The k represents the row of the matrix, the j represents the column of the matrix, and the a, b represent the displacement of the j, k;
and the second construction module is used for constructing the quantum circuit corresponding to the functional module by utilizing the quantum logic gate.
8. The apparatus of claim 7, wherein the first build module comprises:
a conversion module for converting the quantum state |j > into a binary representation;
the third construction module is used for constructing a plurality of function sub-modules of the function module; the number of the functional submodules is determined by the number of the quantum bits, and the evolution result of the quantum bits corresponding to the m bits of j after the action of the mth functional submodule is as follows, wherein m is more than or equal to 1 and less than or equal to n:
and the fourth construction module is used for constructing an exchange operation module, and obtaining a linear combination function module for realizing quantum state |k > according to each function sub-module and the exchange operation module.
9. 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 5 when run.
10. 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 claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010369413.2A CN111582491B (en) | 2020-04-30 | 2020-04-30 | Quantum circuit construction method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010369413.2A CN111582491B (en) | 2020-04-30 | 2020-04-30 | Quantum circuit construction method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111582491A CN111582491A (en) | 2020-08-25 |
CN111582491B true CN111582491B (en) | 2023-10-13 |
Family
ID=72125083
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010369413.2A Active CN111582491B (en) | 2020-04-30 | 2020-04-30 | Quantum circuit construction method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111582491B (en) |
Families Citing this family (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112132614B (en) * | 2020-09-18 | 2024-02-09 | 本源量子计算科技(合肥)股份有限公司 | Method and device for preference prediction demonstration by quantum circuit |
CN112162723B (en) * | 2020-09-30 | 2023-12-15 | 本源量子计算科技(合肥)股份有限公司 | Quantum subtraction operation method, device, electronic device and storage medium |
CN112114776B (en) * | 2020-09-30 | 2023-12-15 | 本源量子计算科技(合肥)股份有限公司 | Quantum multiplication method, device, electronic device and storage medium |
CN114638368B (en) * | 2020-11-30 | 2023-08-04 | 本源量子计算科技(合肥)股份有限公司 | Quantum circuit construction method and device for QRAM architecture |
CN114819167B (en) * | 2021-01-29 | 2023-08-08 | 本源量子计算科技(合肥)股份有限公司 | Sparse approximate inverse quantum preprocessing method and device for sparse linear system |
CN114692879B (en) * | 2020-12-31 | 2023-08-08 | 本源量子计算科技(合肥)股份有限公司 | Quantum preprocessing method and device based on sparse linear system |
WO2022143789A1 (en) * | 2020-12-31 | 2022-07-07 | 合肥本源量子计算科技有限责任公司 | Quantum preprocessing method and apparatus, storage medium, and electronic apparatus |
CN114764618B (en) * | 2020-12-31 | 2023-08-04 | 本源量子计算科技(合肥)股份有限公司 | Quantum preprocessing method and device for linear system |
CN114819171B (en) * | 2021-02-26 | 2023-08-08 | 本源量子计算科技(合肥)股份有限公司 | Quantum convolution operation realization method and device |
CN113052319B (en) * | 2021-03-24 | 2024-03-19 | 东南大学 | Quantum-computing Cramer-Schmitt orthogonalization method |
CN113377441B (en) * | 2021-06-16 | 2023-07-11 | 南方科技大学 | Universal time sequence controller architecture for quantum physical experiment platform |
CN114548413A (en) * | 2022-02-25 | 2022-05-27 | 北京百度网讯科技有限公司 | Quantum circuit operation method and device, electronic device and medium |
CN116738126B (en) * | 2022-03-04 | 2024-06-14 | 本源量子计算科技(合肥)股份有限公司 | Differential equation solving method and device based on computational domain decomposition |
CN117713385B (en) * | 2024-02-05 | 2024-05-03 | 威海双城电气有限公司 | Electric power detection system and method based on combination of quantum computation and artificial intelligence |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108154240A (en) * | 2017-12-29 | 2018-06-12 | 合肥本源量子计算科技有限责任公司 | A kind of quantum wire simulation system of low complex degree |
CN109376867A (en) * | 2018-09-17 | 2019-02-22 | 合肥本源量子计算科技有限责任公司 | The processing method and processing device of two quantum bit logic gates |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2015179753A1 (en) * | 2014-05-23 | 2015-11-26 | The Regents Of The University Of Michigan | Methods for general stabilizer-based quantum computing simulation |
-
2020
- 2020-04-30 CN CN202010369413.2A patent/CN111582491B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108154240A (en) * | 2017-12-29 | 2018-06-12 | 合肥本源量子计算科技有限责任公司 | A kind of quantum wire simulation system of low complex degree |
CN109376867A (en) * | 2018-09-17 | 2019-02-22 | 合肥本源量子计算科技有限责任公司 | The processing method and processing device of two quantum bit logic gates |
Non-Patent Citations (2)
Title |
---|
姜敏 ; 张曾科 ; .基于基本逻辑门的量子傅立叶算法实现的改进.计算机工程与应用.2006,(11),全文. * |
王佳佳 ; 陈汉武 ; 李文骞 ; 李志强 ; 刘文杰 ; .量子计算与量子电路仿真技术.东南大学学报(自然科学版).2007,(03),全文. * |
Also Published As
Publication number | Publication date |
---|---|
CN111582491A (en) | 2020-08-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111582491B (en) | Quantum circuit construction method and device | |
CN112114776B (en) | Quantum multiplication method, device, electronic device and storage medium | |
CN111563599B (en) | Quantum circuit decomposition method and device, storage medium and electronic device | |
CN112633508B (en) | Quantum circuit generation method and device, storage medium and electronic device | |
CN112232513B (en) | Quantum state preparation method and device | |
CN113222150B (en) | Quantum state transformation method and device | |
CN113850389B (en) | Quantum circuit construction method and device | |
CN114764549B (en) | Quantum circuit simulation calculation method and device based on matrix product state | |
CN113222153B (en) | Quantum state simulation method and device, storage medium and electronic device | |
CN114492815A (en) | Method, device and medium for calculating target system energy based on quantum chemistry | |
CN114764620B (en) | Quantum convolution operator | |
CN113222151B (en) | Quantum state transformation method and device | |
CN115879562B (en) | Quantum program initial mapping determination method and device and quantum computer | |
CN116403657A (en) | Drug response prediction method and device, storage medium and electronic device | |
CN114819167B (en) | Sparse approximate inverse quantum preprocessing method and device for sparse linear system | |
CN114638368B (en) | Quantum circuit construction method and device for QRAM architecture | |
CN114881238A (en) | Method and apparatus for constructing quantum discriminator, medium, and electronic apparatus | |
CN114881239A (en) | Method and apparatus for constructing quantum generator, medium, and electronic apparatus | |
CN114764618B (en) | Quantum preprocessing method and device for linear system | |
CN114692879B (en) | Quantum preprocessing method and device based on sparse linear system | |
CN115879558B (en) | Method and device for comparing sizes of multiple quantum states | |
CN115713122B (en) | Method and device for determining size relation between quantum data and classical data | |
CN115829038B (en) | Method for determining the transformation from a fermi subsystem to a qubit system and transformation framework | |
CN115879552B (en) | Quantum modulus multiplication inverse operation method and device, electronic device and modulus arithmetic component | |
CN117669757A (en) | Hamiltonian volume construction method and device |
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 | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: 230088 6th floor, E2 building, phase II, innovation industrial park, 2800 innovation Avenue, high tech Zone, Hefei City, Anhui Province Applicant after: Benyuan Quantum Computing Technology (Hefei) Co.,Ltd. Address before: 230088 6th floor, E2 building, phase II, innovation industrial park, 2800 innovation Avenue, high tech Zone, Hefei City, Anhui Province Applicant before: ORIGIN QUANTUM COMPUTING COMPANY, LIMITED, HEFEI |
|
GR01 | Patent grant | ||
GR01 | Patent grant |