CN115907016A - Method for searching target range value based on quantum computation and related device - Google Patents

Method for searching target range value based on quantum computation and related device Download PDF

Info

Publication number
CN115907016A
CN115907016A CN202111163610.XA CN202111163610A CN115907016A CN 115907016 A CN115907016 A CN 115907016A CN 202111163610 A CN202111163610 A CN 202111163610A CN 115907016 A CN115907016 A CN 115907016A
Authority
CN
China
Prior art keywords
quantum
target value
target
value
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.)
Pending
Application number
CN202111163610.XA
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.)
Origin Quantum Computing Technology Co Ltd
Original Assignee
Origin Quantum Computing Technology 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 Origin Quantum Computing Technology Co Ltd filed Critical Origin Quantum Computing Technology Co Ltd
Priority to CN202111163610.XA priority Critical patent/CN115907016A/en
Publication of CN115907016A publication Critical patent/CN115907016A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The application discloses a method for searching a target range value based on quantum computing and a related device, wherein the method comprises the following steps: respectively preparing the quantum state of the element to be processed in the target set, comparing the quantum state with a target value, acquiring the probability that the quantum state is greater than the target value, and searching out a target range value which is greater than the target value in the element to be processed according to the probability that the quantum state is greater than the target value. By utilizing the embodiment of the application, the parallel acceleration advantage of quantum computing can be exerted, the search of the target range value can be realized, and the blank of the related technology is filled.

Description

Method for searching target range value based on quantum computation and related device
Technical Field
The invention belongs to the field of quantum computation, and particularly relates to a method for searching a target range value based on quantum computation and a related device.
Background
Quantum computers are physical devices that perform high-speed mathematical and logical operations, store, and process quantum information following quantum mechanics laws. When a device processes and calculates quantum information and runs quantum algorithms, the device is a quantum computer. Quantum computers are a key technology under study because they have the ability to handle mathematical problems more efficiently than ordinary computers, for example, they can speed up the time to break RSA keys from hundreds of years to hours.
At present, with the continuous development of quantum computing, more and more quantum algorithms are generated. However, for the aspect of searching data in a target range, a corresponding quantum algorithm is lacked, so that the parallel acceleration advantage of quantum computing is fully exerted, which is a problem to be solved urgently, wherein quantum data refers to quantum information data carried by quantum bits, and classical data refers to information data in the field of classical computing.
Disclosure of Invention
The invention aims to provide a method for searching a target range value based on quantum computation and a related device, which are used for solving the defects in the prior art, exerting the parallel acceleration advantage of quantum computation, realizing the search of the target range value and filling the blank of the related technology.
In a first aspect, the present application provides a method for searching a target range value based on quantum computation, including:
respectively preparing the quantum states of the elements to be treated in the target set;
comparing the quantum state with a target value and obtaining the probability that the quantum state is greater than the target value;
and searching out a target range value which is larger than the target value in the element to be processed according to the probability that the quantum state is larger than the target value.
Optionally, the comparing the quantum state to the target value comprises:
constructing a quantum wire for comparing the quantum state to the magnitude of the target value;
running the quantum wire and measuring target quantum bits contained in the quantum wire;
and acquiring the probability that the quantum state is larger than the target value according to a measurement result obtained by measuring the target quantum bit.
Optionally, the constructing a quantum wire for comparing the quantum state with the magnitude of the target value comprises:
determining a binary form of the target value, wherein a length of the binary form is consistent with a first number of qubits for storing the quantum state;
acquiring a second qubit for storing carry information and a third qubit for storing a determination result;
according to the magnitude relation between the quantum state and the target value and each bit of the binary form, determining a corresponding first quantum logic gate for generating carry information and a corresponding second quantum logic gate for generating a determination result according to the carry information;
and adding the first quantum logic gate to the first qubit and the second qubit, and adding the second quantum logic gate to the second qubit and the third qubit to obtain a quantum wire for comparing the quantum state with the target value.
Optionally, the searching for the target range value greater than the target value in the element to be processed according to the probability that the quantum state is greater than the target value includes:
establishing a mapping relation between an index value and a first target value and a second target value, wherein the index value is in one-to-one correspondence with the quantum state, when the quantum state corresponding to the first index value is larger than the target value, the first index value corresponds to the first target value, and when the quantum state corresponding to the second index value is smaller than the target value, the second index value corresponds to the second target value;
creating a superposition state according to the quantum state;
setting a first operator, wherein the first operator is used for checking the index value;
checking the index values one by one according to the first operator, and turning the quantum state of the index value corresponding to the first target value;
amplifying the amplitude of the quantum state corresponding to the first target value according to a second operator;
and acquiring the target range value according to the amplified amplitude.
Optionally, the quantum wire for comparing the quantum state with the magnitude of the target value includes a CNOT gate, a Toffoli gate, and an OR gate.
In a second aspect, the present application provides an apparatus for searching for a target range value based on quantum computing, comprising:
the preparation unit is used for respectively preparing the quantum states of the elements to be treated in the target set;
the comparison unit is used for comparing the quantum state with a target value and acquiring the probability that the quantum state is larger than the target value;
and the searching unit is used for searching out a target range value which is larger than the target value in the element to be processed according to the probability that the quantum state is larger than the target value.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor, a memory, a communication interface, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for executing steps in the method according to the first aspect of the embodiment of the present application.
In a fourth aspect, the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program for electronic data exchange, where the computer program makes a computer perform some or all of the steps described in the method according to the first aspect of the present application.
In a fifth aspect, the present application provides a computer program product, where the computer program product includes a non-transitory computer-readable storage medium storing a computer program, where the computer program is operable to cause a computer to perform some or all of the steps described in the method according to the first aspect of the present application. The computer program product may be a software installation package.
In a sixth aspect, the present application provides a quantum computer operating system, where the quantum computer operating system implements processing for searching a target range value based on quantum computation according to some or all of the steps described in the method according to the first aspect of the present application.
It can be seen that, compared with the prior art, the method for searching for the target range value based on quantum computing provided by the present application respectively prepares the quantum states of the elements to be processed in the target set, compares the quantum states with the target values, obtains the probability that the quantum states are greater than the target values, and searches for the target range value greater than the target values in the elements to be processed according to the probability that the quantum states are greater than the target values. By utilizing the embodiment of the application, the parallel acceleration advantage of quantum computing can be exerted, the search of the target range value can be realized, and the blank of the related technology can be filled.
Drawings
FIG. 1 is a schematic flow chart of a method for searching target range values based on quantum computation according to the present application;
FIG. 2 is a diagram of a quantum circuit for numerical comparison provided herein;
FIG. 3 is a schematic diagram of a logic OR gate structure according to the present application;
FIG. 4 is an iterative schematic diagram of a Grover algorithm provided herein;
fig. 5 is a schematic diagram of a structured modular quantum circuit corresponding to a Grover algorithm provided in the present application;
FIG. 6 is a schematic diagram of the apparatus for searching target range values based on quantum computing according to the present application;
fig. 7 is a schematic structural diagram of an apparatus for searching for a target range value based on quantum computation according to an embodiment of the present application.
Detailed Description
The embodiments described below with reference to the drawings are illustrative only and should not be construed as limiting the invention.
The embodiment of the invention provides a method for searching a target range value based on quantum computing and a related device, which are used for solving the defects in the prior art, exerting the parallel acceleration advantage of quantum computing, realizing the search of the target range value and filling the blank of the related technology.
It should be noted that, the quantum program referred to in the embodiments of the present application is a program written in a classical language and representing a qubit and its evolution, where the qubit, a quantum logic gate, and the like related to quantum computation are all represented by corresponding classical codes.
Quantum wires, as an embodiment of quantum programs, are also weighing sub-logic wires, are the most commonly used general quantum computing model, and represent wires operating on quantum bits under an abstract concept, and the components of the quantum wires include quantum bits, wires (timeline), and various quantum logic gates, and finally, the result is often read through quantum measurement operation. The quantum wires may be presented in a sequence of quantum logic gates arranged in a certain execution sequence.
Unlike conventional circuits that are connected by metal lines to pass either voltage or current signals, in quantum circuits, the lines can be viewed as being connected by time, i.e., the state of a qubit evolves naturally over time, in the process being operated on by the hamiltonian until encountering a quantum logic gate.
A quantum program corresponds to an overall quantum circuit as a whole, and the quantum program refers to the overall quantum circuit, wherein the total number of quantum bits in the overall quantum circuit is the same as the total number of quantum bits of the quantum program. It can be understood that: a quantum program may consist of quantum wires, measurement operations for quantum bits in the quantum wires, registers to hold measurement results, and control flow nodes (jump instructions), and a quantum wire may contain tens to hundreds or even thousands of quantum logic gate operations. The execution process of the quantum program is a process executed for all the quantum logic gates according to a certain time sequence. It should be noted that timing is the time sequence in which the single quantum logic gate is executed.
It should be noted that in the classical calculation, 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 through the combination of the logic gates. Similarly, the way qubits are handled is quantum logic gates. The quantum state evolution can be achieved by using quantum logic gates, which are the basis for forming quantum circuits, including single-bit quantum logic gates (or single-quantum logic gates, simplies)Referred to as "single gate"), such as a Hadamard gate (H gate, aldamard gate), a Pauli-X gate (X gate), a Pauli-Y gate (Y gate), a Pauli-Z gate (Z gate), an RX gate, a RY gate, an RZ gate, and the like; two-bit quantum logic gates (or double quantum logic gates, simply "double gates"), such as CNOT gates, CR gates, SWAP gates, ISWAP gates, and so on; a multi-bit quantum logic gate (or a multi-quantum logic gate, abbreviated as "multi-gate"), such as a Toffoli gate, etc. Quantum logic gates are typically represented using unitary matrices, which are not only matrix-form but also an operation and transformation. The function of a general quantum logic gate on a quantum state is calculated by multiplying a unitary matrix by a matrix corresponding to a quantum state right vector. For example, a quantum state right vector |0>Corresponding vector is
Figure BDA0003290701150000051
Quantum state right vector |1>Corresponding vector is->
Figure BDA0003290701150000052
A quantum state, i.e., the logical state of a qubit. In quantum algorithms (or quantum programs), binary representation is adopted for quantum states of a group of quantum bits included in a quantum circuit, for example, a group of quantum bits are q0, q1, and q2, which represent 0 th, 1 st, and 2 nd quantum bits, and are ordered from high to low in the binary representation as q2q1q0, and quantum states corresponding to the group of quantum bits have 2 quanta to the power of the total number of quantum bits, that is, 8 eigenstates (determined states): |000>、|001>、|010>、|011>、|100>、|101>、|110>、|111>The bits of each quantum state correspond to qubits, e.g. |001>State 001 from high to low corresponding to q2q1q0, a>Is a dirac symbol. For a bit containing N quanta q 0 、q 1 、…、q n 、…、q N-1 The order of the binary representation quantum state of the quantum line is q N-1 q N-2 …、q 1 q 0
To illustrate with a single qubit, the logic state ψ for a single qubit may be at |0>State, |1>State, |0>Sum of states |1>Superposition of states (not)Determined state), specifically may be expressed as ψ = a |0>+b|1>Wherein a and b are complex numbers representing the amplitude (magnitude of probability) of the quantum state, the square of the modulus of the amplitude represents the probability, | a | y 2 、|b| 2 Respectively indicate that the logic state is |0>State, |1>Probability of state, | a 2 +|b| 2 And =1. In short, a quantum state is a superposition state of the eigenstates, and is in a uniquely determined eigenstate when the probability of other states is 0.
Referring to fig. 1, a flow diagram of a method for searching for a target range value based on quantum computation according to an embodiment of the present application includes:
101. respectively preparing the quantum states of the elements to be processed in the target set;
in this embodiment, an element set in a preset target range value domain in a certain set is searched out by using a quantum computing technique, and all elements to be processed in the set may be prepared into a quantum state.
Specifically, if a set a = [1,5,6,7], each element in the set a is first converted into a binary form, and the binary form corresponding to each element in the set a can be encoded according to an H gate, so as to obtain a first superposition state | Φ >:
Figure BDA0003290701150000061
wherein quantum state |001> corresponds to binary 1, |101> -101 is 5 corresponds to binary 5, |110> -110 is 6 corresponds to binary 6, |111> -111 is 7 corresponds to binary 7, and the amplitude of each quantum state is 1/2.
102. Comparing the quantum state with a target value and obtaining the probability that the quantum state is greater than the target value;
specifically, a quantum line for comparing the quantum state with the target value can be constructed, the quantum line is run, and target quantum bits contained in the quantum line are measured; and acquiring the probability that the quantum state is larger than the target value according to the measurement result obtained by measuring the target quantum bit.
Illustratively, a quantum wire comparing a quantum state to a target value size is constructed as follows:
201. determining a binary form of the target value, wherein a length of the binary form is consistent with a first number of qubits for storing the quantum state;
specifically, taking the target value as an integer as an example, the integer may be converted into a binary form, and then the binary form values are stored in the array t in an inverted order. Wherein the length of the binary form needs to be consistent with the first qubit number n.
Assuming that the first qubit number n =6, the integer 22, corresponding to a binary 10110, the binary length being smaller than n, the 10110 is padded with 0 to 010110 and stored in reverse order to t = [0,1, 0].
202. Acquiring a second qubit for storing carry information and a third qubit for storing a determination result;
the second qubit is used for storing carry information after each bit of the quantum state of the first qubit is compared with each bit of the binary system of the classical data, and the set number of the carry information can be the same as the number n of the first qubit; the third qubit is used to store the determination result of whether the target quantum data and the target classical data satisfy the target size relationship, and the number may be set to 1. For example, if one bit of the quantum state is larger than one bit of the integer binary, the carry information is 1, otherwise it is 0.
203. According to the magnitude relation between the quantum state and the target value and each bit of the binary form, determining a corresponding first quantum logic gate for generating carry information and a corresponding second quantum logic gate for generating a determination result according to the carry information;
204. and adding the first quantum logic gate to the first qubit and the second qubit, and adding the second quantum logic gate to the second qubit and the third qubit, so as to obtain a quantum wire for comparing the quantum state with the target value.
Illustratively, for a greater than relationship, the first quantum logic gate comprises: a CNOT gate, a Toffoli gate, OR a logic OR gate, the second quantum logic gate comprising: CNOT gate, specifically determined as follows:
if t [1] =0, a CNOT gate is correspondingly adopted, and t [1] =1 corresponds to no operation; if t [ k ] =0, a logic OR gate (OR gate) is correspondingly adopted, t [ k ] =1, a Toffoli gate is correspondingly adopted, and k is more than OR equal to 2 and less than OR equal to n;
in the specific target range value searching process, the target range value is not limited to be greater than a certain value, but may be smaller than, less than or equal to or greater than or equal to, and the corresponding quantum circuit diagram changes as follows:
for the relation less than or equal to, on the basis of the relation greater than or equal to, increasing a second quantum logic gate X gate;
for the relation of being greater than or equal to, if t [1] =0, replace the first quantum logic gate CNOT gate that is used when being greater than the relation with X gate, the rest is unchanged, if t [1] =1, the quantum logic gate that is used is the same as that used when being greater than the relation;
and for the less than relation, adding a second quantum logic gate X gate on the basis of the more than or equal to relation.
For the greater than relationship, the addition is as follows:
for the first quantum logic gate: if t [1]]=0, add CNOT gate to first bit | i of first qubit 1 >And a first bit | a of a second qubit 1 Above, | i 1 >To control the bits, | a 1 >For the controlled bit, t [1]]=0, no added logic gate;
except for t 1]For t [ k ], in addition]=0 OR 1, add OR gate OR toffil gate to kth | i of first qubit k >The (k-1) | a of the second qubit k-1 >And the k-th bit | a k >Above, | i k >、|a k-1 >To control the bits, | a k >For the controlled bit, up to t [ n ]];
For the second quantum logic gate: at the end of the last addition of the CNOT gate, specifically to the last bit | a of the second qubit n >And a third qubit | c>Above, | a n >To control the ratioSpecially, | c>Are controlled bits. Finally, the resulting quantum wire may be as shown in fig. 2, with the initial quantum states of the second and third qubits both being |0>State.
In addition, for the relation of less than or equal to, the quantum wires may be: on the basis of the quantum circuit corresponding to the greater than relation, adding a second quantum logic gate X gate on the third quantum bit;
for the equal to or greater relationship, the quantum wires may be: if t [1]]=0, t [1] shown in fig. 2]CNOT gate corresponding to =0 is replaced by the first bit | a added to the second qubit 1 The X gate on (6), the rest is unchanged; if t [1]]=1, the corresponding quantum wires are unchanged from fig. 2 (only t [1] in fig. 2]Replacement of =0 by t [1]]=1)。
For smaller than relations, the quantum wires may be: and adding a second quantum logic gate X gate on the third quantum bit on the basis of the quantum line corresponding to the relation of being more than or equal to the third quantum bit.
In practical applications, it is also reasonably feasible to use quantum logic gates equivalent to toffei gates, OR gates, CNOT gates OR X gates. One way of constructing the OR gate may be as shown in fig. 3, and the left line of fig. 3 sequentially includes 3X gates, 1 toffil gate and 2X gates.
Specifically, the quantum state of the third qubit may be measured as the determination result; and determining whether the target quantum data and the target classical data meet a target size relation or not according to the determination result.
In the computer field, the true value true is generally denoted by 1, and exemplarily, if the measured determination result is in a state |1>, it is indicated that it is determined that the target quantum data and the target classical data satisfy the target size relationship; if the state is |0> state, the representation determines that the target quantum data and the target classical data do not satisfy the target size relationship.
For the case where the binary length of the integer is larger than the first qubit number n, assuming n =4, the binary length of the integer is 5, since 4 bits of quantum state are maximally represented as |1111 > and the minimum of 5-bit binary integer is 10000, i.e. the quantum data must be smaller than the classical data. At the moment, for the greater than relation and the greater than or equal to relation, the constructed quantum line is empty, and the third quantum bit directly outputs the |0> state; for a less than relation, less than or equal to relation, the quantum wires constructed may be: only one X gate is added to the third qubit, the remainder being empty, which thereby outputs the |1> state.
By running a quantum wire that compares greater than a relationship, measure a third qubit, and output the comparison result at bit | c >, if | c > = |1> state, then the probability that the quantum state is greater than the target value is 1, and if | c > = |0> state, then the probability that the quantum state is greater than the target value is 0.
For example, taking set a as an example, if the rule is set to "find out the elements greater than 4 in set a", quantum states |001>, |101>, |110>, |111> are compared with the target value 4 through a quantum line, and output at bit | c >:
i001 > output |0>, I101 > output |1>, |110> output |1>, |111>: output |1>; due to the superposition of quantum states, quantum states |000>, |010>, |011>, |100> with amplitude 0 are simultaneously compared with the target value 4 through a quantum line, and |0> is output, which means that the probability that 0, 2, 3, 4 is greater than 4 is 0 (because 0, 2, 3, 4 does not exist in the set a). Thereby obtaining the probability that each quantum state contained in the superposition state | phi > is greater than the target value and is 00, 1. Since the elements are 7 maximum, binary 111, requiring 3 qubits to be encoded into the quantum states, 3 bits in total representing 2 powers of 3 data (0 to 7, corresponding to |000> to |111> states), a total of 8 probability data is output.
103. And searching out a target range value which is larger than the target value in the element to be processed according to the probability that the quantum state is larger than the target value.
In this embodiment, a target range value larger than the target value may be searched for in the database based on a Grover quantum algorithm. The mapping relationship between the elements and the probabilities can be established according to the probability that the quantum state is larger than the target value:
suppose there is a mapping
Figure BDA0003290701150000092
I.e. has a function->
Figure BDA0003290701150000093
For example, N =4, f (1) =0, f (2) =1, f (3) =1, f (4) =1, grover algorithm is to find a solution x of f (x) =1, x is an index, and the index corresponds to an element in the database.
Continuing with the example set a = [1,5,6,7], the target value is 4. Set A corresponds to the first superposition state | φ >:
Figure BDA0003290701150000091
quantum states with amplitude of 0, |000>, |010>, |011>, |100> correspond to 0, 2, 3, 4 (absent), and a = [1,5,6,7] is complemented by 0 to obtain [0,1,0, 5,6,7], the corresponding index of each element is 0 to 7, the probabilities of the indices are 0,1, and 1. According to the 8 probability values, an index value corresponding to the probability 1 is found, and then element values (5, 6 and 7) corresponding to the index value are found, namely target range values larger than the target value 4.
301. Establishing a mapping relation between an index value and a first target value and a second target value, wherein the index value is in one-to-one correspondence with the quantum state, when the quantum state corresponding to the first index value is larger than the target value, the first index value corresponds to the first target value, and when the quantum state corresponding to the second index value is smaller than the target value, the second index value corresponds to the second target value;
302. creating a second superposition state according to the quantum state;
303. setting a first operator, wherein the first operator is used for checking the index value;
304. checking the index values one by one according to the first operator, and turning the phase of the quantum state of the index value corresponding to a first target value;
305. amplifying the amplitude of the quantum state corresponding to the first target value according to a second operator;
306. and acquiring the target range value according to the amplified amplitude.
Establishing a mapping relation according to the elements and the probability values thereof, taking the set A as an example, if a rule is set to find out the numerical value greater than 4 in the set A, outputting the result quantum state |000>To |111>And its probability greater than 4. The probability of 0 indicates that the element does not conform to the set rule, and the probability of 1 indicates that the element conforms to the set rule. By
Figure BDA0003290701150000103
That is, f (0) =0, f (1) =0, f (2) =0, f (3) =0, f (4) =0, f (5) =1, f (6) =1, and f (7) =1, only the index x corresponding to f (x) =1 needs to be found, and the corresponding element can be found according to the index.
First, a second superposition state | ψ > is created, as shown in equation 1:
Figure BDA0003290701150000101
wherein N is the number of output probability values. Taking set a as an example, N =8.
Setting the first Oracle operator o, which is used for the corresponding quantum state flip phase when f (x) =1, as shown in formula 2:
Figure BDA0003290701150000102
defining a second operator G (Grover operator) for expanding the amplitude of the quantum state of the flipped phase as shown in equation 3:
g = (2 | ψ > < ψ | -I) O equation 3
Wherein O is
Figure BDA0003290701150000111
Without loss of generality, assume that all x constituent quantum states of f (x) =1 are as shown in equation 4:
Figure BDA0003290701150000112
then, the quantum state composed of all x of f (x) =0 is as shown in equation 5:
Figure BDA0003290701150000113
/>
wherein, M represents the number of solutions in the set, | α > represents the quantum superposition state of all non-solutions, | β > represents the quantum superposition state of all solutions, i.e. the final quantum state.
Wherein N =2 n . So | ψ>Can be shown by equation 6:
Figure BDA0003290701150000114
the Grover algorithm is applied using equation 7:
o (a | α > + b | β >) = a | α > -b | β > formula 7
For simple calculation, let
Figure BDA0003290701150000115
It can be found that | ψ > after the second operator G is acted upon once is as shown in equation 8:
Figure BDA0003290701150000116
further, it is found that | ψ > when the second operator G acts k times is as shown in equation 9:
Figure BDA0003290701150000117
the usable image representation is shown in fig. 4, and multiple uses of G may allow for | ψ>Continuous approach to beta>. Finally, measure | psi>Then | β can be obtained with high probability>I.e. the index of f (x) =1. Exemplary of a Grover algorithmAs shown in fig. 5, a modular quantum wire diagram, as can be appreciated by those skilled in the art,
Figure BDA0003290701150000118
and the quantum logic gate module (including an H gate) representing the created stack state, wherein the Oracle working space corresponds to the first Oracle operator o, and the G corresponds to the second Grover operator, which is not described herein in detail.
It can be seen that the target range value which is greater than the target value in the element to be processed is searched out according to the probability that the quantum state is greater than the target value by preparing the quantum state of the element to be processed, comparing the quantum state with the target value, obtaining the probability that the quantum state is greater than the target value. By utilizing the embodiment of the application, the parallel acceleration advantage of quantum computing can be exerted, the search of the target range value can be realized, and the blank of the related technology is filled.
The foregoing describes the present invention from the perspective of a method, and the present invention is further described below from the perspective of an apparatus, specifically referring to fig. 6, an apparatus schematic diagram of an apparatus for searching for a target range value based on quantum computation provided by an embodiment of the present invention includes:
the preparation unit 601 is used for respectively preparing the quantum states of the elements to be processed in the target set;
a comparing unit 602, configured to compare the quantum state with a target value, and obtain a probability that the quantum state is greater than the target value;
a searching unit 603, configured to search out a target range value greater than the target value in the to-be-processed element according to the probability that the quantum state is greater than the target value.
It can be seen that, the preparation unit 601 is configured to respectively prepare quantum states of elements to be processed in a target set, the comparison unit 602 is configured to compare the quantum states with a target value and obtain a probability that the quantum states are greater than the target value, and the search unit 603 is configured to search out a target range value that is greater than the target value in the elements to be processed according to the probability that the quantum states are greater than the target value. By utilizing the embodiment of the application, the parallel acceleration advantage of quantum computing can be exerted, the search of the target range value can be realized, and the blank of the related technology can be filled.
The following description will be made in detail by taking the example of the operation on a computer terminal. Fig. 7 is a block diagram of a hardware structure of a computer terminal of a method for searching a target range value based on quantum computation according to an embodiment of the present invention. As shown in fig. 7, the computer terminal may include one or more processors 701 (only one is shown in fig. 7) (the processor 701 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 702 for storing data, and optionally may further include a transmission device 703 for communication functions and an input-output device 704. It will be understood by those skilled in the art that the structure shown in fig. 7 is only an illustration, and is not intended to limit the structure of the computer terminal. For example, the computer terminal may also include more or fewer components than shown in FIG. 7, or have a different configuration than shown in FIG. 7.
The memory 702 may be used to store software programs and modules of application software, such as program instructions/modules corresponding to the method for searching for a target range value based on quantum computing in the embodiment of the present application, and the processor 701 executes various functional applications and data processing by running the software programs and modules stored in the memory 702, so as to implement the method described above. The memory 702 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 702 may further include memory located remotely from the processor 701, which may be connected to a computer terminal through 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 device 703 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the computer terminal. In one example, the transmission device 703 includes a Network adapter (NIC) that can be connected to other Network devices through a base station so as to communicate with the internet. In one example, the transmission device 703 may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner. Embodiments of the present application also provide a computer-readable storage medium, where the computer-readable storage medium stores a computer program for electronic data exchange, the computer program enables a computer to execute part or all of the steps of any one of the methods as described in the above method embodiments, and the computer includes an electronic device.
Embodiments of the present application also provide a computer program product comprising a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods as described in the above method embodiments. The computer program product may be a software installation package, the computer comprising an electronic device.
The embodiments of the present application further provide a quantum computer operating system, which implements the processing based on the quantum search target value according to part or all of the steps of any one of the methods described in the above method embodiments.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art will recognize that the embodiments described in this specification are preferred embodiments and that acts or modules referred to are not necessarily required for this application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the above-described division of the units is only one type of division of logical functions, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some interfaces, devices or units, and may be an electric or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit may be stored in a computer readable memory if it is implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a memory, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the above-mentioned method of the embodiments of the present application. And the aforementioned memory comprises: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and various media capable of storing program codes.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by associated hardware instructed by a program, which may be stored in a computer-readable memory, which may include: flash Memory disks, read-Only memories (ROMs), random Access Memories (RAMs), magnetic or optical disks, and the like.
The foregoing detailed description of the embodiments of the present application has been presented to illustrate the principles and implementations of the present application, and the above description of the embodiments is only provided to help understand the method and the core concept of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, the specific implementation manner and the application scope may be changed, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A method for searching for a target range value based on quantum computing, comprising:
respectively preparing the quantum states of the elements to be processed in the target set;
comparing the quantum state with a target value and obtaining the probability that the quantum state is greater than the target value;
and searching out a target range value which is larger than the target value in the element to be processed according to the probability that the quantum state is larger than the target value.
2. The method of claim 1, wherein the comparing the quantum state to the target value comprises:
constructing a quantum wire for comparing the quantum state to the magnitude of the target value;
running the quantum wire and measuring target quantum bits contained in the quantum wire;
and acquiring the probability that the quantum state is larger than the target value according to a measurement result obtained by measuring the target quantum bit.
3. The method of claim 1, wherein constructing a quantum wire for comparing the quantum state to the magnitude of the target value comprises:
determining a binary form of the target value, wherein a length of the binary form is consistent with a first number of qubits for storing the quantum state;
acquiring a second qubit for storing carry information and a third qubit for storing a determination result;
according to the magnitude relation between the quantum state and the target value and each bit of the binary form, determining a corresponding first quantum logic gate for generating carry information and a corresponding second quantum logic gate for generating a determination result according to the carry information;
and adding the first quantum logic gate to the first qubit and the second qubit, and adding the second quantum logic gate to the second qubit and the third qubit to obtain a quantum wire for comparing the quantum state with the target value.
4. The method of claim 1, wherein the searching for the target range value greater than the target value in the element to be processed according to the probability that the quantum state is greater than the target value comprises:
establishing a mapping relation between an index value and a first target value and a second target value, wherein the index value is in one-to-one correspondence with the quantum state, when the quantum state corresponding to the first index value is larger than the target value, the first index value corresponds to the first target value, and when the quantum state corresponding to the second index value is smaller than the target value, the second index value corresponds to the second target value;
creating a superposition state according to the quantum state;
setting a first operator, wherein the first operator is used for checking the index value;
checking the index values one by one according to the first operator, and turning the phase of the quantum state of the index value corresponding to a first target value;
amplifying the amplitude of the quantum state corresponding to the first target value according to a second operator;
and acquiring the target range value according to the amplified amplitude.
5. The method of claim 2, wherein the quantum wires for comparing the quantum states with the magnitude of the target value comprise a CNOT gate, a Toffol gate, and an OR gate.
6. An apparatus for searching a target range value based on quantum computing, comprising:
the preparation unit is used for respectively preparing the quantum states of the elements to be treated in the target set;
the comparison unit is used for comparing the quantum state with a target value and acquiring the probability that the quantum state is larger than the target value;
and the searching unit is used for searching out a target range value which is larger than the target value in the element to be processed according to the probability that the quantum state is larger than the target value.
7. The apparatus according to claim 6, wherein the comparing unit is specifically configured to:
constructing a quantum wire for comparing the quantum state with the magnitude of the target value;
and running the quantum wire and measuring a target quantum bit contained in the quantum wire.
8. An electronic device comprising a processor, a memory, a communication interface, and one or more programs stored in the memory and configured to be executed by the processor, the programs comprising instructions for performing the steps in the method of any of claims 1-5.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which is executed by a processor to implement the method of any of claims 1-5.
10. A quantum computer operating system implementing a search target range value processing based on quantum computation according to the method of any one of claims 1 to 5.
CN202111163610.XA 2021-09-30 2021-09-30 Method for searching target range value based on quantum computation and related device Pending CN115907016A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111163610.XA CN115907016A (en) 2021-09-30 2021-09-30 Method for searching target range value based on quantum computation and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111163610.XA CN115907016A (en) 2021-09-30 2021-09-30 Method for searching target range value based on quantum computation and related device

Publications (1)

Publication Number Publication Date
CN115907016A true CN115907016A (en) 2023-04-04

Family

ID=86493802

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111163610.XA Pending CN115907016A (en) 2021-09-30 2021-09-30 Method for searching target range value based on quantum computation and related device

Country Status (1)

Country Link
CN (1) CN115907016A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110145288A1 (en) * 2009-12-16 2011-06-16 At&T Intellectual Property I, Lp Methods, apparatus, and computer program products for quantum searching for multiple search targets
US20180232652A1 (en) * 2016-11-10 2018-08-16 Rigetti & Co., Inc. Generating Quantum Logic Control Sequences for Quantum Information Processing Hardware
CN109891438A (en) * 2016-11-01 2019-06-14 谷歌有限责任公司 The experiment of numerical value quantum
CN111241356A (en) * 2020-04-26 2020-06-05 腾讯科技(深圳)有限公司 Data search method, device and equipment based on analog quantum algorithm
CN111598249A (en) * 2020-05-19 2020-08-28 北京百度网讯科技有限公司 Method, apparatus, classical computer and storage medium for determining approximate quantum gate
CN112000673A (en) * 2020-08-31 2020-11-27 合肥本源量子计算科技有限责任公司 Method and device for inquiring transaction elements by using quantum line

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110145288A1 (en) * 2009-12-16 2011-06-16 At&T Intellectual Property I, Lp Methods, apparatus, and computer program products for quantum searching for multiple search targets
CN109891438A (en) * 2016-11-01 2019-06-14 谷歌有限责任公司 The experiment of numerical value quantum
US20180232652A1 (en) * 2016-11-10 2018-08-16 Rigetti & Co., Inc. Generating Quantum Logic Control Sequences for Quantum Information Processing Hardware
CN111241356A (en) * 2020-04-26 2020-06-05 腾讯科技(深圳)有限公司 Data search method, device and equipment based on analog quantum algorithm
CN111598249A (en) * 2020-05-19 2020-08-28 北京百度网讯科技有限公司 Method, apparatus, classical computer and storage medium for determining approximate quantum gate
CN112000673A (en) * 2020-08-31 2020-11-27 合肥本源量子计算科技有限责任公司 Method and device for inquiring transaction elements by using quantum line

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
吉作约子;李会方;: "任意幅度分布的量子搜索算法研究", 科学技术与工程, no. 36, 28 December 2011 (2011-12-28) *

Similar Documents

Publication Publication Date Title
CN113222155B (en) Quantum circuit construction method and device, electronic device and storage medium
CN113222150B (en) Quantum state transformation method and device
CN114764549B (en) Quantum circuit simulation calculation method and device based on matrix product state
CN113222161A (en) Method and device for realizing user-defined quantum logic gate
CN114819168B (en) Quantum comparison method and device for matrix eigenvalues
CN113222151B (en) Quantum state transformation method and device
CN112396166A (en) Graph convolution neural network training method and device based on mixed granularity aggregator
CN113222153A (en) Quantum state simulation method and device, storage medium and electronic device
CN115907016A (en) Method for searching target range value based on quantum computation and related device
CN115983392A (en) Method, device, medium and electronic device for determining quantum program mapping relation
CN115879562A (en) Quantum program initial mapping determination method and device and quantum computer
CN112000673A (en) Method and device for inquiring transaction elements by using quantum line
CN114862079A (en) Risk value estimation method, device, medium, and electronic device based on quantum line
CN115879557A (en) Data size comparison method and device based on quantum circuit and quantum computer
CN116089675A (en) Quantum clustering method and device, electronic equipment and storage medium
CN116089674A (en) Quantum computation-based data clustering method, device, equipment and storage medium
CN115713122A (en) Method and device for determining size relationship between quantum data and classical data
CN116048458A (en) Quantum computation-based numerical dividing method, device, equipment and storage medium
CN116049506A (en) Quantum calculation-based numerical value searching method, device, equipment and storage medium
CN115511094B (en) Quantum circuit execution result determining method and device and quantum computer operating system
CN115730669A (en) Quantum line processing method and device and quantum computer operating system
CN115730668A (en) Quantum line cutting method and device and quantum computer operating system
CN115879558A (en) Method and device for comparing sizes of multiple quantum states
CN115879560A (en) Method and device for judging equivalence relation between quantum data and classical data
CN116361961A (en) Quantum full-connection network realization method and device, electronic equipment and storage medium

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

Address after: 230088 6th floor, E2 building, phase II, innovation industrial park, 2800 innovation Avenue, Hefei 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, Hefei high tech Zone, Hefei City, Anhui Province

Applicant before: ORIGIN QUANTUM COMPUTING COMPANY, LIMITED, HEFEI

CB02 Change of applicant information