Preparation method and device of normal distribution quantum state
By preparing quantum states that characterize the target value and the square of the target value, and using quantum logic gate combination and amplitude amplification technology, the problem of large deviation in the preparation of normal distributed quantum states in the existing technology is solved, and a relatively accurate preparation of normal distributed quantum states is achieved, and the development of related fields is promoted.
Patent Information
- Application Number
- CN202311595377.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-24
- Publication Date
- 2025-05-27
AI Technical Summary
The existing normal distribution quantum state preparation method is based on Schmitt's approximation method, which leads to large deviations in the prepared quantum states, affecting the development of related fields.
By preparing the quantum state of the first register as the first quantum state that represents the target value, the quantum state of the second register as the second quantum state that represents the square of the target value, and using the quantum logic gate combination, the quantum state of the third register is prepared as the third quantum state with an exponential value, and finally amplification of the superimposed state to obtain a normal distributed quantum state.
The relatively accurate preparation of normal distributed quantum states is achieved, reducing the information filtering of quantum states to be prepared. The obtained quantum state can better fit the corresponding probability distribution, reflect the real situation, and promote the development of related fields.
Smart Images

Figure CN120046746A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of quantum computing, and particularly relates to a method and device for preparing a normal distribution quantum state. Background Art
[0002] The normal distribution is a probability distribution with a very wide range of applications. It is widely used in the fields of finance, medical research, quality control, etc. For example, the rate of change of stocks approximately follows a normal distribution; in risk analysis, the rate of return also follows a normal distribution; in quality inspection, the pass rate of product quality also follows a normal distribution. With the explosion of data volume, the computing power limited to classical computing restricts the application of the normal distribution in various fields. According to the characteristics of the law of large numbers, the properties satisfied by the normal distribution can effectively fit quantum states. Therefore, preparing a normal distribution quantum state can achieve the use of relevant quantum algorithms to solve related problems in the application fields of the normal distribution, thereby promoting the development of related fields.
[0003] The existing preparation of the normal distribution quantum state is an approximate preparation method based on Schmidt decomposition. The method first performs Schmidt decomposition on the quantum state to be prepared, and then discards some Schmidt coefficients close to 0 to reduce the problem scale, and then prepares a normal distribution quantum state that discards some information. The quantum state obtained by the above method is an approximate normal distribution quantum state. Based on this quantum state for research, the results obtained may have relatively large deviations, thus affecting the development of related fields. Therefore, it is necessary to prepare a normal distribution quantum state more precisely. Summary of the Invention
[0004] The purpose of the present invention is to provide a method for preparing a normal distribution quantum state, aiming to prepare a normal distribution quantum state more precisely.
[0005] An embodiment of the present invention provides a method for preparing a normal distribution quantum state, the method comprising:
[0006] Preparing the quantum state of the first register from the initial state into a first quantum state representing a target value, wherein the target value is a value within the numerical range of a target normal distribution processed random variable;
[0007] Preparing the quantum state of the second register from the initial state into a second quantum state representing the square of the target value;
[0008] Through a quantum logic gate combination for preparing an exponential distribution quantum state, using the second quantum state, preparing the quantum state of the third register from the initial state into a third quantum state whose exponent includes the square of the target value;
[0009] Performing amplitude amplification on the superposition state including the first quantum state and the third quantum state to obtain a normal distribution quantum state.
[0010] Optionally, the first register includes n + 1 qubits, where n qubits are used to encode the target value, 1 qubit is used to represent the positive or negative of the target value, and n is determined by a preset preparation accuracy;
[0011] The second register includes 2n qubits, and the second quantum state is obtained by applying a quantum multiplication module to the second register.
[0012] Optionally, the quantum logic gate combination includes 2n RY gates. The control qubit of each RY gate is one qubit in the second register, and the control qubits of each RY gate are different from each other;
[0013] The target qubit of each RY gate is one qubit in the third register, and the target qubits of each RY gate are different from each other;
[0014] The rotation angle of each RY gate is determined by the serial number of the corresponding control qubit in the second register.
[0015] Optionally, the rotation angle of each RY gate is 2arccos(e -λ2-j-1 ), where λ is determined by the numerical range of the random variable of the target normal distribution, j is the serial number of the control qubit of the RY gate in the second register, and j ∈ {0, 2n - 1}.
[0016] Optionally, the method further includes:
[0017] Performing a reset operation on the second register to reset the quantum state of the second register from the second quantum state to the initial state.
[0018] Optionally, the amplitude amplification of the superposition state including the first quantum state and the third quantum state to obtain a normal distribution quantum state includes:
[0019] Performing a filtering operation on the superposition state including the first quantum state and the third quantum state to filter out a specific quantum state, where the specific quantum state is a quantum state component corresponding to the superposition state when the target value is zero;
[0020] Performing amplitude amplification on the superposition state after the filtering operation to obtain a normal distribution quantum state.
[0021] Optionally, the filtering operation is implemented by using a multi-controlled NOT gate;
[0022] The control qubits of the multi-controlled NOT gate are the first register, and the target qubit is a preset auxiliary qubit.
[0023] Optionally, the amplitude amplification of the superposition state after the filtering operation to obtain a normal distribution quantum state includes:
[0024] Measure the third register to obtain the measurement probability of the target state;
[0025] Use the measurement probability to calculate the number of iterations of amplitude amplification;
[0026] Perform amplitude amplification on the superposition state after the filtering operation according to the calculated number of iterations to obtain a normal distribution quantum state.
[0027] Optionally, the number of iterations is where P is the measurement probability.
[0028] Another embodiment of the present invention provides an apparatus for preparing a normal distribution quantum state, the apparatus comprising:
[0029] A first preparation module for preparing the quantum state of the first register from an initial state into a first quantum state representing a target value, where the target value is a value within the numerical range of a random variable after target normal distribution processing;
[0030] A second preparation module for preparing the quantum state of the second register from an initial state into a second quantum state representing the square of the target value;
[0031] A third preparation module for preparing the quantum state of the third register from an initial state into a third quantum state whose exponent includes the square of the target value by using the second quantum state through a combination of quantum logic gates for preparing an exponential distribution quantum state;
[0032] An amplitude amplification module for performing amplitude amplification on the superposition state including the first quantum state and the third quantum state to obtain a normal distribution quantum state.
[0033] An embodiment of the present invention provides a storage medium in which a computer program is stored, where the computer program is configured to implement the method described in any one of the above when running.
[0034] An embodiment of the present invention provides an electronic device comprising a memory and a processor, where a computer program is stored in the memory, and the processor is configured to run the computer program to implement the method described in any one of the above.
[0035] Compared with the prior art, in the present invention, the quantum state of the first register is first prepared from the initial state into a first quantum state representing the target value; then the quantum state of the second register is prepared from the initial state into a second quantum state representing the square of the target value; then, through a quantum logic gate combination for preparing an exponentially distributed quantum state, using the second quantum state, the quantum state of the third register is prepared from the initial state into a third quantum state whose exponent includes the square of the target value; finally, amplitude amplification is performed on the superposition state including the first quantum state and the third quantum state to obtain a normally distributed quantum state. The present invention obtains the square of the target value through simple arithmetic operations, then obtains a part of the normally distributed quantum state through the preparation of the exponentially distributed quantum state, and then obtains the desired normally distributed quantum state through amplitude amplification. During the preparation process, the quantum state to be prepared is not processed to filter out high-frequency part of the information, but a series of quantum operations are performed based on the quantum state to be prepared to obtain the corresponding quantum state. Because no partial information is filtered out, a relatively accurate normally distributed quantum state is prepared. The obtained quantum state can well fit the corresponding probability distribution and can reflect the real situation. Based on this quantum state for further research, relatively accurate results can be obtained, thus promoting the development of related fields. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 It is a network block diagram of a system for preparing a normally distributed quantum state provided by an embodiment of the present invention;
[0037] Figure 2 It is a schematic flowchart of a method for preparing a normally distributed quantum state provided by an embodiment of the present invention;
[0038] Figure 3 It is a schematic structural diagram of a device for preparing a normally distributed quantum state provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0039] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0040] Figure 1 It is a network block diagram of a system for preparing a normally distributed quantum state provided by an embodiment of the present invention. The system for preparing a normally distributed quantum state may include a network 110, a server 120, a wireless device 130, a client 140, a storage unit 150, a classical processing system 160, a quantum processing system 170, and may also include additional memories, classical processors, quantum processors, and other devices not shown.
[0041] Network 110 is a medium for providing communication links between various devices and computers connected together within a preparation system for normal distribution quantum states, including but not limited to the Internet, intranet, local area network, mobile communication network, and their combinations. The connection method can use wired, wireless communication links, fiber optic cables, etc.
[0042] Server 120 and client 140 are conventional data processing systems, which may contain data and have application programs or software tools for performing conventional computing processes. Client 140 can be a personal computer or a network computer, so the data can also be provided by server 120. Wireless device 130 can be a smart phone, tablet, laptop, smart wearable device, etc. Storage unit 150 can include database 151, which can be configured to store data such as qubit parameters, quantum logic gate parameters, quantum circuits, quantum programs, etc.
[0043] Classical processing system 160 (quantum processing system 170) can include classical processor 161 (quantum processor 171) for processing classical data (quantum data) and memory 163 (memory 172) for storing classical data (quantum data). Classical data (quantum data) can be boot files, operating system images, and application programs 162 (application programs 173). Application programs 162 (application programs 173) can be used to implement quantum algorithms compiled according to the preparation method of normal distribution quantum states provided by embodiments of the present invention.
[0044] Any data or information stored or generated in classical processing system 160 (quantum processing system 170) can also be configured to be stored or generated in another classical (quantum) processing system in a similar manner. Similarly, any application program executed by it can also be configured to be executed in another classical (quantum) processing system in a similar manner.
[0045] It should be noted that a real quantum computer has a hybrid structure, which at least includes Figure 1 two major parts: classical processing system 160, responsible for performing classical computing and control; quantum processing system 170, responsible for running quantum programs to achieve quantum computing.
[0046] The above-mentioned classical processing system 160 and quantum processing system 170 can be integrated into one device or distributed in two different devices. For example, the first device including the classical processing system 160 runs a classical computer operating system, on which quantum application development tools and services are provided, as well as the storage and network services required for quantum applications. Users develop quantum applications through the quantum application development tools and services thereon, and send the quantum program to the second device including the quantum processing system 170 through the network service thereon. The second device runs a quantum computer operating system, parses the code of the quantum program through the quantum computer operating system, and compiles it into instructions that can be recognized and executed by the quantum computer measurement and control system. The quantum processor 170 implements the quantum algorithm corresponding to the quantum program according to the instructions.
[0047] In the classical processing system 160 based on a silicon chip, the unit of the classical processor 161 is a CMOS transistor. Such a computing unit is not restricted by time and coherence, that is, such a computing unit is not restricted by the usage duration and is available at any time. In addition, in a silicon chip, the number of such computing units is also sufficient. Currently, the number of computing units in a classical processor is in the thousands. The number of computing units is sufficient and the computing logic selectable by the CMOS transistor is fixed, for example: AND logic. When operating with CMOS transistors, a large number of CMOS transistors are combined with limited logic functions to achieve the operation effect.
[0048] Different from such logic units in the classical processing system 160, the basic computing unit of the quantum processor 171 in the quantum processing system 170 is a quantum bit. The input of a quantum bit is restricted by coherence and also by the coherence time, that is, a quantum bit is restricted by the usage duration and is not available at any time. Making full use of quantum bits within the available usage duration of quantum bits is a key problem in quantum computing. In addition, the number of quantum bits in a quantum computer is one of the representative indicators of the performance of a quantum computer. Each quantum bit realizes the computing function through the logic function configured as needed. Given the limited number of quantum bits, while the logic functions in the field of quantum computing are diverse, for example: Hadamard gate (H gate), Pauli-X gate (X gate), Pauli-Y gate (Y gate), Pauli-Z gate (Z gate), X gate, RY gate, RZ gate, CNOT gate, CR gate, iSWAP gate, Toffoli gate, etc. When performing quantum computing, it is necessary to combine a limited number of quantum bits with diverse logic function combinations to achieve the operation effect.
[0049] When the quantum logic function acts on qubits, the individuality of the qubits needs to be considered, such as the individual identification of which qubit it is in the quantum chip, its position, the relationship with surrounding qubits, and the available duration of each qubit. Therefore, the quantum algorithm composed of quantum logic functions not only expresses the operation relationship of the algorithm, but also expresses the dependence of the algorithm on the individuality of the qubits.
[0050] A quantum chip may include qubits and channels for controlling the qubits. Quantum logic gates are implemented through analog signals. Different combinations of analog signals are applied to the qubits through the channels for controlling the qubits, thereby implementing quantum circuits with different functions and completing data processing. Therefore, the design of the quantum logic function acting on the qubits (including the design of whether to use the qubits and the design of the usage efficiency of each qubit) is the key to improving the computing performance of quantum computers and requires special design. This is also the uniqueness of the quantum algorithm based on the quantum logic function, which is essentially and significantly different from the classical algorithm based on the classical logic function. And the above-mentioned design for qubits is a technical problem that ordinary computing devices do not need to consider and do not need to face.
[0051] For some problems involving probability distribution calculations, quantum computing can be used to solve them. For example, in asset pricing or risk estimation activities, it is usually necessary to simulate and predict the future price and its fluctuations of an asset, and these processes usually involve probability distribution calculations. To achieve faster computing than classical computers, quantum computing can be used to help solve these problems. The normal distribution, as a widely used probability distribution model, is of great significance for using quantum computing to solve some problems involving probability distribution calculations. For example, using the normal distribution quantum state to simulate some classical random processes can more accurately estimate the volatility of asset prices and predict and evaluate future asset prices. In addition, the normal distribution can also be used in the Monte Carlo method of quantum simulation to more accurately estimate financial risks and probabilities. Therefore, preparing the normal distribution quantum state can help users process and solve these problems more quickly.
[0052] See Figure 2 , Figure 2 which is a schematic flowchart of a method for preparing a normal distribution quantum state provided by an embodiment of the present invention, and may include the following steps:
[0053] S201: Prepare the quantum state of the first register from the initial state into a first quantum state representing a target value, where the target value is a value within the numerical range of the random variable after being processed by the target normal distribution.
[0054] The initial state of the first register can be that all qubits in the first register are in the 0 state. The first quantum state can be implemented using the H gate, and the first quantum state is a uniform superposition state. In the embodiments of the present invention, the target normal distribution is a positive normal distribution with a mathematical expectation μ of 0, that is, the random variable of the target normal distribution is distributed around 0. The numerical range after processing the target normal distribution is (-1, 1).
[0055] Specifically, the first register includes n + 1 qubits, where n qubits are used to encode the target value, and 1 qubit is used to represent the positive or negative of the target value, and n is determined by the preset preparation accuracy.
[0056] Generally, there will be a certain degree of error between the prepared normal distribution quantum state and the theoretical normal distribution. The smaller the error, the higher the preparation accuracy, and vice versa. Therefore, by determining the number of qubits in the first register according to the preparation accuracy, the quantum state of the normal distribution can be prepared according to the preparation accuracy requirements, increasing the preparation flexibility. The preparation accuracy can represent a preparation requirement of the normal distribution quantum state. A high-precision normal distribution quantum state can perform quantum calculations more accurately to precisely simulate classical random processes. Correspondingly, the preparation of a low-precision normal distribution quantum state takes less time and does not occupy too much computing resources, and can simply simulate some classical random processes with low-precision requirements. Specifically, the preparation accuracy is reciprocal to 2 n Exemplarily, if the preset preparation accuracy is 2 -10 , then n = 10; if the preset preparation accuracy is 2 -5 , then n = 5.
[0057] The first register includes a qubit for representing the positive or negative of the target value, that is, there is a sign bit. Since the numerical range of the random variable of the processed target normal distribution is (-1, 1) and the numerical range is symmetric about the 0 point, the target value is actually in the range [0, 1), and the value within (-1, 1) can be represented because of the existence of the sign bit.
[0058] It should be noted that the number of target values is related to n. Specifically, the number of target values is 2 n Using the H gate, the first quantum state obtained can be:[[]]
[0059]
[0060] n where i is the number of the target value. The first quantum state is a uniform superposition state, corresponding to 2
[0061] points uniformly distributed in the interval (-1, 1), and one point is a target value.S202: Prepare the quantum state of the second register from the initial state to the second quantum state representing the square of the target value.
[0062] In an embodiment of the present invention, a quantum logic gate combination for squaring is utilized to excite the quantum state of the second register from the initial state to the second quantum state.
[0063] Specifically, the second register may include 2n qubits, and the second quantum state may be obtained by applying a quantum multiplication module to the second register.
[0064] The 2n qubits of the second register are used to implement the square of the target value. The quantum multiplication module is composed of a quantum logic gate combination for implementing multiplication. To implement the square of the target value, both the multiplier and the multiplicand input to the quantum multiplication module may be the target value. The quantum logic gate combination for implementing multiplication can be various as long as the second quantum state representing the square of the target value can be obtained.
[0065] S203: By using a quantum logic gate combination for preparing an exponentially distributed quantum state and utilizing the second quantum state, prepare the quantum state of the third register from the initial state to a third quantum state whose exponent includes the square of the target value.
[0066] Under the control of the second quantum state, the quantum logic gate combination for preparing an exponentially distributed quantum state excites the quantum state of the third register from the initial state to the third quantum state. The third quantum state is an exponentially distributed quantum state, and the exponent includes the square of the target value.
[0067] In some possible embodiments of the present invention, the quantum logic gate combination includes 2n RY gates, the control bit of each RY gate is one qubit in the second register, and the control bits of each RY gate are different from each other;
[0068] The target bit of each RY gate is one qubit in the third register, and the target bits of each RY gate are different from each other;
[0069] The rotation angle of each RY gate is determined by the serial number of the corresponding control bit in the second register.
[0070] In an embodiment of the present invention, the quantum states of the qubits in the second register have been excited from the initial state to the second quantum state. By respectively performing an RY gate controlled by the second register on each qubit in the third register in the initial state, the third quantum state for characterizing the exponential distribution is obtained. Preparing the third quantum state requires 2n single-bit controlled quantum logic gates, and both the control bits and the target bits of the RY gates are different, indicating that these RY gates can be executed in parallel, resulting in a relatively low circuit depth. This not only improves the preparation efficiency but also effectively prevents quantum decoherence and enhances the stability of the quantum circuit operation, thereby improving the stability and reliability of the prepared normal distribution quantum state.
[0071] In an embodiment of the present invention, the RY gate is used to operate the state of qubits on a quantum computer. The RY gate can implement the operation on a qubit with a rotation angle θ. The rotation angle can be used to control the RY gate to excite the qubit to a specific state. Since each qubit needs to be in a different specific state after being subjected to the controlled RY gate operation to represent the third quantum state, the rotation angles corresponding to the RY gates for different qubits are different. Specifically, the rotation angle of each RY gate is 2arccos(e -λ2-j-1 ), where λ is determined by the numerical range of the random variable before the target normal distribution is normalized, and j is the serial number of the control qubit of the RY gate in the second register, j ∈ {0, 2n - 1}.
[0072] For each RY gate, a qubit is selected from the second register as the control qubit of the RY gate, and then a qubit is selected from the third register as the target qubit of the RY gate. Whether it is the control qubit or the target qubit can be randomly selected or selected according to certain rules. Exemplarily, it can be selected from largest to smallest or smallest to largest according to the bit number of the target value corresponding to the qubit. Of course, it can also be selected in other ways. For an RY gate, the ways of selecting the control qubit and the target qubit can be different, but qubits that have been selected by other RY gates cannot be selected. Once the control qubit of an RY gate is determined, the rotation angle corresponding to the RY gate is also determined.
[0073] It should be noted that in the second register, the serial numbers of the qubits are arranged separately, which has nothing to do with the number of qubits in the first register. The serial numbers only relate to the sorting of the qubits in the second register. Exemplarily, for an RY gate, if the selected control qubit is qubit q 9 in the second register, and qubit q 9 is the qubit ranked at the 0th position in the second register, then j = 0. If the selected control qubit is the qubit ranked at the 3rd position in the second register, then j = 3.
[0074] In an embodiment of the present invention, the exponent includes not only the square of the target value but also the rate parameter λ. Specifically, it can be calculated from the numerical range of the target normal distribution. The numerical range is a numerical range symmetric about 0, and there is a multiple relationship between the endpoints of the numerical range and the variance. If the value range of the target normal distribution is (-ασ, ασ), then Exemplarily, the numerical range of the random variable of the target normal distribution is (-3σ, 3σ), the target normal distribution follows N(0, σ), and its corresponding probability density function is Let Then preparing the quantum state corresponding to f(x) in the interval (-3σ, 3σ) is equivalent to preparing the quantum state corresponding to h(x) in the interval (-1, 1). According to the above process, we can obtain
[0075] In the embodiments of the present invention, the number of qubits: O(n) ≈ 5n. Representing the target value requires n bits. Calculating the square of the target value represented by n bits requires 2n qubits, and performing the exponential operation requires 2n qubits. In the embodiments of the present invention, the process that contributes the most to the gate complexity lies in calculating the numerical square, which is an arithmetic multiplication with a complexity of O(n 2 )
[0076] S204: Amplitude amplify the superposition state including the first quantum state and the third quantum state to obtain a normal distribution quantum state.
[0077] Only a part of the quantum states in the superposition state are normal distribution quantum states, and amplitude amplification operations need to be performed to obtain a normal distribution quantum state. The main function of Amplitude Amplification is to amplify the amplitude of a given pure state, thereby adjusting the probability distribution of its measurement results.
[0078] In some embodiments of the present invention, in order to reduce the interference of the second quantum state on the finally obtained normal distribution quantum state, a reset operation needs to be performed on the second register so that the quantum state of the second register is reset from the second quantum state to the initial state. The second register is an auxiliary register that assists in the preparation of the third quantum state. When the preparation of the third quantum state is completed, the transpose conjugate operation of the second quantum state acquisition operation can be performed on the second register to make the quantum state of the second register return to the initial state, reducing the interference caused by entanglement with the second quantum state during subsequent amplitude amplification.
[0079] In some possible embodiments of the present invention, the amplitude amplifying the superposition state including the first quantum state and the third quantum state to obtain a normal distribution quantum state includes:
[0080] Performing a filtering operation on the superposition state including the first quantum state and the third quantum state to filter out specific quantum states, where the specific quantum state is an unnormalized quantum state perpendicular to the superposition state
[0081] Amplitude amplify the superposition state after the filtering operation to obtain a normal distribution quantum state.
[0082] In the embodiments of the present invention, the first quantum state can be prepared using n H gates, and the first quantum state can be expressed as:
[0083]
[0084] After preparing the second quantum state |i 2 >, the quantum state jointly corresponding to the first register and the second register becomes:
[0085]
[0086] After preparing the third quantum state, the quantum state jointly corresponding to the first register, the second register, and the third register becomes:
[0087]
[0088] Performing a transpose conjugate operation on the second register to reset the second register to its initial state, the quantum state |ψ 2 > becomes the quantum state |ψ 3 >, and the quantum state |ψ 3 > is:
[0089]
[0090] Since the second register returns to its initial state, ignoring the second register, the quantum state |ψ 4 >, |ψ 4 > is the superposition state including the first quantum state and the third quantum state, and the quantum state |ψ 4 > is:
[0091]
[0092] Among them, I n+1 represents the identity operator acting on n + 1 qubits. |⊥> is the unnormalized quantum state perpendicular to .
[0093] For the first register, the initial state can be respectively and When the qubit encoding the sign bit in the first register represents the positive or negative of the target value. When the target value is 0, there are two quantum state components in the superposition state. In one quantum state component, the qubit serving as the sign bit represents that the target value is positive, and in the other quantum state component, the qubit serving as the sign bit represents that the target value is negative. That is, when the target value is 0, in the superposition state, there are two quantum state components representing the same value, and the two quantum state components are respectively and One of the quantum state components needs to be filtered out to reduce the influence of this quantum state component on the final result during subsequent amplitude amplification. The filtered quantum state component is the specific quantum state. It should be noted that the filtering operation does not filter out part of the information in the to-be-prepared normal distribution quantum state, but filters out the repeated information that appears in the preparation method provided by the present invention.
[0094] In the embodiments of the present invention, a filtering operation can be used to filter specific quantum states, reducing the interference of specific quantum states on the desired quantum states during the amplitude amplification process. When amplitude amplification is performed, the amplitude of a specific quantum state may also be amplified, and entanglement may also occur with other desired quantum states, thereby possibly changing the desired quantum state and affecting the preparation accuracy. Specifically, the filtering operation can be implemented using a multi-controlled NOT gate, where the control qubits of the multi-controlled NOT gate are the first register and the target qubit is a preset auxiliary qubit. Specifically, an additional auxiliary qubit |0> can be added, and a multi-controlled NOT gate is applied. When the first register is in a certain state, the auxiliary qubit is flipped. The superposition state after the filtering operation is:
[0095]
[0096] where,
[0097] In some possible embodiments of the present invention, amplifying the superposition state after the filtering operation to obtain a normally distributed quantum state includes:
[0098] Measuring the third register to obtain the measurement probability of the target state;
[0099] Using the measurement probability to calculate the number of iterations of amplitude amplification;
[0100] Performing an amplitude amplification operation on the superposition state after the filtering operation according to the calculated number of iterations to obtain a normally distributed quantum state.
[0101] Specifically, the number of iterations is where P is the measurement probability.
[0102] The probability of measuring the third register to obtain the 0 state is
[0103]
[0104] where h(x) = -λx 2 , λ > 0. Therefore, if amplitude amplification is to be used to accurately obtain a normally distributed quantum state, the required number of iterations is That is,
[0105] Since when n → ∞, there is
[0106]
[0107] Estimating when, because e x ≥ 1 + x, there is
[0108] When λ < 1,
[0109] When λ ≥ 1,
[0110] In summary, when λ < 1, the probability of measuring the target state is greater than 1 / 2; when λ ≥ 1, the probability of measuring the target state is greater than That is, for any λ > 0, the range of the number of iterations required for amplitude amplification is determined by (1, O(max{1, λ 1 / 4})).
[0111] It can be seen that in the present invention, the quantum state of the first register is first prepared from the initial state into a first quantum state representing the target value; then the quantum state of the second register is prepared from the initial state into a second quantum state representing the square of the target value; then through a quantum logic gate combination for preparing an exponentially distributed quantum state, using the second quantum state, the quantum state of the third register is prepared from the initial state into a third quantum state whose exponent includes the square of the target value; finally, amplitude amplification is performed on the superposition state including the first quantum state and the third quantum state to obtain a normally distributed quantum state. The present invention obtains the square of the target value through simple arithmetic operations, then obtains a part of the normally distributed quantum state through the preparation of the exponentially distributed quantum state, and then obtains the desired normally distributed quantum state through amplitude amplification. During the preparation process, the quantum state to be prepared is not processed to filter out high-frequency part of the information, but a series of quantum operations are performed based on the quantum state to be prepared to obtain the corresponding quantum state. Because no part of the information is filtered out, a relatively accurate normally distributed quantum state is prepared, and the obtained quantum state can well fit the corresponding probability distribution and can reflect the real situation. Further research based on this quantum state can obtain relatively accurate results, thereby promoting the development of related fields.
[0112] See Figure 3 , Figure 3 is a schematic structural diagram of a device for preparing a normally distributed quantum state provided by an embodiment of the present invention, corresponding to the Figure 2 shown process. The device includes:
[0113] A first preparation module 301 for preparing the quantum state of the first register from the initial state into a first quantum state representing the target value, where the target value is a value within the numerical range of the random variable after target normal distribution processing;
[0114] A second preparation module 302 for preparing the quantum state of the second register from the initial state into a second quantum state representing the square of the target value;
[0115] The third preparation module 303 is configured to prepare the quantum state of the third register from an initial state to a third quantum state with an exponent including the square of the target value by using a quantum logic gate combination for preparing an exponentially distributed quantum state and using the second quantum state;
[0116] The amplitude amplification module 304 is configured to perform amplitude amplification on the superposition state including the first quantum state and the third quantum state to obtain a normally distributed quantum state.
[0117] In some possible embodiments of the present invention, the first register may include n + 1 qubits, where n qubits are used to encode the target value, 1 qubit is used to represent the positive or negative of the target value, and n is determined by a preset preparation accuracy;
[0118] The second register may include 2n qubits, and the second quantum state is obtained by applying a quantum multiplication module to the second register.
[0119] In some possible embodiments of the present invention, the quantum logic gate combination may include 2n RY gates. The control bit of each RY gate may be a qubit in the second register, and the control bits of each RY gate are different from each other;
[0120] The target bit of each RY gate may be a qubit in the third register, and the target bits of each RY gate are different from each other;
[0121] The rotation angle of each RY gate may be determined by the serial number of the corresponding control bit in the second register.
[0122] In some possible embodiments of the present invention, the rotation angle of each RY gate may be 2arccos(e -λ2-j-1 ), where λ is determined by the numerical range of the random variable of the target normal distribution, j is the serial number of the control bit of this RY gate in the second register, and j ∈ {0, 2n - 1}.
[0123] In some possible embodiments of the present invention, the device may further include:
[0124] A reset module, configured to perform a reset operation on the second register, so that the quantum state of the second register is reset from the second quantum state to the initial state.
[0125] In some possible embodiments of the present invention, the amplitude amplification module 304 may include:
[0126] A filtering unit, configured to perform a filtering operation of filtering a specific quantum state on the superposition state including the first quantum state and the third quantum state, where the specific quantum state is a quantum state component corresponding to the superposition state when the target value is zero;
[0127] An amplification unit for amplifying the amplitude of the superposition state after the filtering operation to obtain a quantum state with a normal distribution.
[0128] In some possible embodiments of the present invention, the filtering operation may be implemented by using a multi-controlled NOT gate;
[0129] The control bits of the multi-controlled NOT gate are the first register, and the target bit is a preset auxiliary bit.
[0130] In some possible embodiments of the present invention, the filtering unit may specifically be used for:
[0131] Measuring the third register to obtain the measurement probability of the target state;
[0132] Calculating the number of iterations of amplitude amplification by using the measurement probability;
[0133] Performing an amplitude amplification operation on the superposition state after the filtering operation according to the calculated number of iterations to obtain a quantum state with a normal distribution.
[0134] In some possible embodiments of the present invention, the number of iterations may be where P is the measurement probability.
[0135] It can be seen that in the present invention, the quantum state of the first register is first prepared from the initial state into a first quantum state representing the target value; then the quantum state of the second register is prepared from the initial state into a second quantum state representing the square of the target value; then through a combination of quantum logic gates for preparing a quantum state with an exponential distribution, using the second quantum state, the quantum state of the third register is prepared from the initial state into a third quantum state whose exponent includes the square of the target value; finally, the amplitude of the superposition state including the first quantum state and the third quantum state is amplified to obtain a quantum state with a normal distribution. The present invention obtains the square of the target value through simple arithmetic operations, then obtains a part of the quantum state with a normal distribution through the preparation of the quantum state with an exponential distribution, and finally obtains the desired quantum state with a normal distribution through amplitude amplification. During the preparation process, the quantum state to be prepared is not processed to filter out high-frequency part of the information, but a series of quantum operations are performed based on the quantum state to be prepared to obtain the corresponding quantum state. Because no part of the information is filtered out, a relatively accurate quantum state with a normal distribution is prepared, and the obtained quantum state can well fit the corresponding probability distribution and can reflect the real situation. Further research based on this quantum state can obtain relatively accurate results, thereby promoting the development of related fields.
[0136] The embodiment of the present invention also provides a storage medium, in which a computer program is stored, and the computer program is configured to implement the steps in any one of the above method embodiments when running.
[0137] Specifically, in this embodiment, the above storage medium can be set to store a computer program for implementing the following steps:
[0138] S201: Prepare the quantum state of the first register from the initial state into a first quantum state representing a target value, where the target value is a value within the numerical range of a random variable processed by a target normal distribution;
[0139] S202: Prepare the quantum state of the second register from the initial state into a second quantum state representing the square of the target value;
[0140] S203: Through a combination of quantum logic gates for preparing an exponential distribution quantum state, use the second quantum state to prepare the quantum state of the third register from the initial state into a third quantum state whose exponent includes the square of the target value;
[0141] S204: Perform amplitude amplification on the superposition state including the first quantum state and the third quantum state to obtain a normal distribution quantum state.
[0142] An embodiment of the present invention also provides an electronic device, including a memory and a processor. A computer program is stored in the memory, and the processor is set to run the computer program to implement the steps in any one of the above method embodiments.
[0143] Specifically, the above electronic device may further include a transmission device and an input / output device, where the transmission device is connected to the above processor, and the input / output device is connected to the above processor.
[0144] Specifically, in this embodiment, the above processor can be set to implement the following steps through a computer program:
[0145] S201: Prepare the quantum state of the first register from the initial state into a first quantum state representing a target value, where the target value is a value within the numerical range of a random variable processed by a target normal distribution;
[0146] S202: Prepare the quantum state of the second register from the initial state into a second quantum state representing the square of the target value;
[0147] S203: Through a combination of quantum logic gates for preparing an exponential distribution quantum state, use the second quantum state to prepare the quantum state of the third register from the initial state into a third quantum state whose exponent includes the square of the target value;
[0148] S204: Perform amplitude amplification on the superposition state including the first quantum state and the third quantum state to obtain a normal distribution quantum state.
[0149] The structure, features, and effects of the present invention have been described in detail based on the embodiments shown in the drawings. The above is only the preferred embodiment of the present invention, but the present invention is not limited to the scope of implementation shown in the drawings. Any changes made in accordance with the concept of the present invention, or equivalent embodiments modified to equivalent changes, which still do not exceed the spirit covered by the specification and the drawings, shall fall within the protection scope of the present invention.
Claims
1. A method for preparing a quantum state of normal distribution, characterized in that, the method includes: Preparing the quantum state of the first register from the initial state into a first quantum state representing the target value, where the target value is a value within the numerical range of the random variable after target normal distribution processing; Preparing the quantum state of the second register from the initial state into a second quantum state representing the square of the target value; Through a quantum logic gate combination for preparing a quantum state of exponential distribution, using the second quantum state, preparing the quantum state of the third register from the initial state into a third quantum state whose exponent includes the square of the target value; Performing amplitude amplification on the superposition state including the first quantum state and the third quantum state to obtain a quantum state of normal distribution.
2. The method according to claim 1, characterized in that, the first register includes n + 1 qubits, where n qubits are used to encode the target value, 1 qubit is used to represent the positive or negative of the target value, and n is determined by the preset preparation accuracy; the second register includes 2n qubits, and the second quantum state is obtained by applying a quantum multiplication module to the second register.
3. The method according to claim 2, characterized in that, the quantum logic gate combination includes 2n RY gates, the control qubit of each RY gate is a qubit in the second register, and the control qubits of each RY gate are different from each other; the target qubit of each RY gate is a qubit in the third register, and the target qubits of each RY gate are different from each other; the rotation angle of each RY gate is determined by the serial number of the corresponding control qubit in the second register.
4. The method according to claim 3, characterized in that, The rotation angle of each RY gate is where λ is determined by the numerical range of the random variable of the target normal distribution, and j is the serial number of the control bit of the RY gate in the second register, and j ∈ {0, 2n - 1}.
5. The method according to any one of claims 2 - 4, characterized in that, the method further includes: Performing a reset operation on the second register so that the quantum state of the second register is reset from the second quantum state to the initial state.
6. The method according to claim 5, characterized in that, the performing amplitude amplification on the superposition state including the first quantum state and the third quantum state to obtain a quantum state of normal distribution includes: Performing a filtering operation on the superposition state including the first quantum state and the third quantum state to filter out a specific quantum state, where the specific quantum state is a quantum state component corresponding to the superposition state when the target value is zero; Performing amplitude amplification on the superposition state after the filtering operation to obtain a quantum state of normal distribution.
7. The method according to claim 6, characterized in that, the filtering operation is implemented using a multi - controlled NOT gate; the control qubits of the multi - controlled NOT gate are the first register, and the target qubit is a preset auxiliary qubit.
8. The method according to claim 6, characterized in that, the performing amplitude amplification on the superposition state after the filtering operation to obtain a quantum state of normal distribution includes: Measuring the third register to obtain the measurement probability of the target state; Calculating the number of iterations of amplitude amplification using the measurement probability; Performing an amplitude amplification operation on the superposition state after the filtering operation according to the calculated number of iterations to obtain a quantum state of normal distribution.
9. The method according to claim 8, Characterized in that, The number of iterations is P is the measurement probability.
10. A device for preparing a quantum state of normal distribution, Characterized in that, The device comprises: A first preparation module, configured to prepare the quantum state of a first register from an initial state into a first quantum state representing a target value, where the target value is a value within the numerical range of a random variable after being processed by a target normal distribution; A second preparation module, configured to prepare the quantum state of a second register from an initial state into a second quantum state representing the square of the target value; A third preparation module, configured to prepare the quantum state of a third register from an initial state into a third quantum state whose exponent includes the square of the target value by using a quantum logic gate combination for preparing a quantum state of exponential distribution and by using the second quantum state; An amplitude amplification module, configured to perform amplitude amplification on a superposition state including the first quantum state and the third quantum state to obtain a quantum state of normal distribution.
11. A storage medium, Characterized in that, The storage medium stores a computer program, where the computer program is configured to implement the method according to any one of claims 1 to 9 when running.
12. An electronic device, comprising a memory and a processor, Characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to implement the method according to any one of claims 1 to 9.
Citation Information
Cited By
Black box quantum state preparation method based on grouping processing
CN120409727A