Preparation method and device of normal distribution quantum state

By preparing the target quantum state of the first register in quantum computing and determining the rotation angle of the controlled RY gate, the problem of inaccurate preparation of normal distributed quantum states in the prior art is solved, and a higher precision normal distributed quantum state preparation is achieved, which improves the application accuracy in related fields.

CN120046747APending Publication Date: 2025-05-27ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311605840.6
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

Technical Problem

The existing normal distribution quantum state preparation method is based on Schmitt decomposition, which leads to the prepared quantum state approximation rather than accuracy, which may introduce large deviations and affect the development of related fields.

Method used

By preparing the target quantum state of the first register based on the random variable value and preparation accuracy of the target normal distribution, the rotation angle of each controlled RY gate is determined based on the numerical range and control bits of the target normal distribution, and then applying a corresponding controlled RY gate on the second register to obtain the normal distributed quantum state.

Benefits of technology

It realizes the relatively accurate preparation of normal distributed quantum states, reduces deviations, and improves the accuracy and reliability of applications in related fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120046747A_ABST
    Figure CN120046747A_ABST
Patent Text Reader

Abstract

The invention discloses a normal distribution quantum state preparation method and device, and the method comprises the steps: preparing a target quantum state of a first register according to a random variable value and preparation precision of target normal distribution; determining the rotation angle of each controlled RY gate according to the numerical range of the random variable of the target normal distribution and the control bit of each controlled RY gate determined from the first register; and acting on the second register in the initial quantum state on a controlled RY gate which takes the angle controlled by the first register in the target quantum state as the determined rotation angle to obtain a normal distribution quantum state. According to the embodiment of the invention, the normal distribution quantum state can be accurately prepared.
Need to check novelty before this filing date? Find Prior Art

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 very widely used probability distribution, and its applications in the fields of finance, medical research, quality control, etc. are very extensive. For example, the stock change rate approximately follows the normal distribution; in risk analysis, the rate of return also follows the normal distribution; in quality inspection, the product quality pass rate also follows the normal distribution. With the dramatic increase in the amount of data, 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 match the quantum state. Therefore, preparing a normal distribution quantum state can realize using 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 and device 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 a target quantum state of a first register according to a random variable value of a target normal distribution and a preparation accuracy; determining a rotation angle of each controlled RY gate according to a numerical range of a random variable of the target normal distribution and a control qubit of each controlled RY gate determined from the first register;

[0007] Acting on a second register in an initial quantum state with a controlled RY gate whose rotation angle is the determined rotation angle and controlled by the first register in the target quantum state to obtain a normal distribution quantum state.

[0008] Optionally, the first register includes n qubits, and the second register includes qubits, 2 n being reciprocal to the preparation accuracy.

[0009] Optionally, preparing the target quantum state of the first register according to a random variable value of the target normal distribution and the preparation accuracy includes:

[0010] Determining a binary string of a random variable value of the target normal distribution;

[0011] Based on the binary string, determining a target binary string, where the length of the target binary string is n;

[0012] Preparing the quantum state of the first register as the target quantum state corresponding to the target binary string. 4. The method according to claim 2, wherein the controlled RY gate includes a first controlled RY gate and a second controlled RY gate, the first controlled RY gate is a single-qubit controlled RY gate, and the second controlled RY gate is a two-qubit controlled RY gate.

[0013] Optionally, the number of the first controlled RY gates is n;

[0014] The number of the second controlled RY gates is ;

[0015] The qubits in the second register acted on by each first controlled RY gate are different from each other;

[0016] The qubits in the second register acted on by each second controlled RY gate are different from each other;

[0017] The qubits in the second register acted on by each first controlled RY gate are different from the qubits in the second register acted on by each second controlled RY gate.

[0018] Optionally, determining the rotation angle of each controlled RY gate according to the numerical range of the random variable of the target normal distribution and the control bit of each controlled RY gate determined from the first register includes:

[0019] Using the relationship between the numerical range of the random variable of the target normal distribution and the variance of the target normal distribution to determine the parameters required for calculating the rotation angle;

[0020] Using the determined parameters and the serial number of the control bit determined from the first register to calculate the rotation angle of each controlled RY gate.

[0021] Optionally, using the determined parameters and the serial number of the control bit determined from the first register to calculate the rotation angle of each controlled RY gate includes:

[0022] Using the formula to calculate the rotation angle of each first RY gate, where λ is the determined parameter;

[0023] Using the formula calculate the rotation angle of each second RY gate, where i, j, and k are the sequence numbers of the corresponding control bits respectively.

[0024] Another embodiment of the present invention provides a device for preparing a normal distribution quantum state. The device includes:

[0025] A determination module, configured to prepare the target quantum state of the first register according to a random variable value of the target normal distribution and the preparation accuracy; and determine the rotation angle of each controlled RY gate according to the numerical range of the random variable of the target normal distribution and each control bit determined from the first register;

[0026] An obtaining module, configured to apply a controlled RY gate with the determined rotation angle controlled by the first register in the target quantum state to the second register in the initial quantum state to obtain a normal distribution quantum state.

[0027] An embodiment of the present invention provides a storage medium, in which a computer program is stored. Wherein, the computer program is configured to implement the method described in any one of the above when running.

[0028] An embodiment of the present invention provides an electronic device, including a memory and a processor. 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.

[0029] Compared with the prior art, the present invention first prepares the target quantum state of the first register according to a random variable value of the target normal distribution and the preparation accuracy; determines the rotation angle of each controlled RY gate according to the numerical range of the random variable of the target normal distribution and each control bit determined from the first register; and then applies a controlled RY gate with the determined rotation angle controlled by the first register in the target quantum state to the second register in the initial quantum state to obtain a normal distribution quantum state. By applying a controlled RY gate with a specific rotation angle to the qubits of the second register, a normal distribution quantum state is obtained, and the rotation angle is determined based on the numerical range of the normal distribution and the control bits, without first processing the quantum state to be prepared to prepare a normal distribution quantum state after discarding information, but directly preparing a normal distribution quantum state by using the preparation accuracy and the properties of the normal distribution, thereby obtaining a more accurate normal distribution quantum state. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is a network block diagram of a system for preparing a normal distribution quantum state provided by an embodiment of the present invention;

[0031] Figure 2 A flowchart of a method for preparing a normal distribution quantum state provided by an embodiment of the present invention;

[0032] Figure 3 A schematic diagram of a quantum circuit for preparing a normal distribution quantum state provided by an embodiment of the present invention;

[0033] Figure 4 A schematic structural diagram of a device for preparing a normal distribution quantum state provided by an embodiment of the present invention. Detailed implementation manners

[0034] 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.

[0035] Figure 1 A network block diagram of a system for preparing a normal distribution quantum state provided by an embodiment of the present invention. The system for preparing a normal distribution 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, and a quantum processing system 170, and may further include additional memories, classical processors, quantum processors, and other devices not shown.

[0036] The network 110 is a medium for providing a communication link between various devices and computers connected together within the system for preparing a normal distribution quantum state, including but not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof, and the connection method may adopt a wired, wireless communication link, or a fiber optic cable, etc.

[0037] The server 120 and the client 140 are conventional data processing systems, which may contain data and have application programs or software tools for performing conventional computing processes. The client 140 may be a personal computer or a network computer, so the data may also be provided by the server 120. The wireless device 130 may be a smart phone, a tablet, a laptop computer, a smart wearable device, etc. The storage unit 150 may include a database 151, which may be configured to store data such as qubit parameters, quantum logic gate parameters, quantum circuits, and quantum programs.

[0038] The classical processing system 160 (quantum processing system 170) may include a classical processor 161 (quantum processor 171) for processing classical data (quantum data) and a memory 163 (memory 172) for storing classical data (quantum data). The classical data (quantum data) may be a boot file, an operating system image, and an application program 162 (application program 173). The application program 162 (application program 173) may be used to implement a quantum algorithm compiled according to the method for preparing a normal distribution quantum state provided by an embodiment of the present invention.

[0039] Any data or information stored or generated in the 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.

[0040] It should be noted that a real quantum computer has a hybrid structure and it includes at least Figure 1 two major parts: a classical processing system 160, which is responsible for performing classical calculations and controls; and a quantum processing system 170, which is responsible for running quantum programs to implement quantum calculations.

[0041] The above-mentioned classical processing system 160 and quantum processing system 170 can be integrated in 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, and storage and network services required for quantum applications are also provided. Users develop quantum application programs through the quantum application development tools and services on it, and send quantum programs to the second device including the quantum processing system 170 through the network services on it. 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.

[0042] In the classical processing system 160 based on a silicon chip, the unit of the classical processor 161 is a CMOS transistor. This kind of computing unit is not restricted by time and coherence, that is, this kind of computing unit is not restricted by the usage duration and is available at any time. In addition, in the 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 that can be selected 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.

[0043] Different from such logical units in the classical processing system 160, the basic computing unit of the quantum processor 171 in the quantum processing system 170 is a qubit. The input of a qubit is restricted by coherence and also by the coherence time, that is, a qubit is restricted by the usage duration and is not available at any time. Making full use of qubits within their available usage duration is a key problem in quantum computing. In addition, the number of qubits in a quantum computer is one of the representative indicators of the performance of the quantum computer. Each qubit realizes its computing function through a logically functional configuration on demand. Given the limited number of qubits and the diverse logical functions in the field of quantum computing, 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. During quantum computing, it is necessary to combine a limited number of qubits with diverse logical function combinations to achieve the operation effect.

[0044] When the quantum logical function acts on a qubit, the individuality of the qubit needs to be considered, such as the individual identifier of which qubit the qubit is in the quantum chip, its position, the relationship with surrounding qubits, and the available usage duration of each qubit. Therefore, the quantum algorithm composed of quantum logical functions not only expresses the operation relationship of the algorithm, but also expresses the dependence of the algorithm on the individuality of the qubit.

[0045] A quantum chip may include qubits and channels for regulating the qubits. The quantum logic gates are realized through analog signals. Different combinations of analog signals are applied to the qubits through the channels for regulating the qubits, so as to realize quantum circuits with different functions and complete the processing of data. Therefore, the design of the quantum logical 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 operation performance of the quantum computer and requires special design. This is also the uniqueness of the quantum algorithm based on the quantum logical function, which is essentially and significantly different from the classical algorithm based on the classical logical 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.

[0046] For some problems involving probability distribution calculations, they can be solved by using quantum computing. 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 calculations 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, simulating some classical random processes with normal distribution quantum states 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 normal distribution quantum states can help users process and solve these problems more quickly.

[0047] See Figure 2 , Figure 2 which is a schematic flowchart of the preparation of a normal distribution quantum state provided by an embodiment of the present invention, and may include the following steps:

[0048] S201: Prepare the target quantum state of the first register according to a random variable value of the target normal distribution and the preparation accuracy; determine the rotation angle of each controlled RY gate according to the numerical range of the random variable of the target normal distribution and the control qubits determined from the first register.

[0049] The target normal distribution is a normal distribution with a mathematical expectation μ of 0. The random variable value can be any real number in the range of [0, 1). Since the mathematical expectation is 0, the probability density function corresponding to the target normal distribution is symmetric about the 0 point, and an additional quantum bit can be used to represent the positive or negative of the random variable value.

[0050] 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, determining the number of qubits of the first register through the preparation accuracy can prepare the quantum state of the normal distribution 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. Before each preparation of the normal distribution quantum state, various factors such as the preparation accuracy requirements, preparation time, and computing resources required for the preparation of the normal distribution quantum state can be comprehensively considered, and the preparation accuracy of the normal distribution quantum state can be preset in advance.

[0051] The quantum state of the first register evolves from an initial quantum state to a target quantum state, and the target quantum state is determined by the selected random variable value.

[0052] In some possible embodiments of the present invention, the first register includes n qubits, and the second register includes qubits, 2 n is the reciprocal of the preparation precision.

[0053] The preparation precision determines the number of qubits in the first register and the second register, that is, the preparation precision determines the number of qubits required to prepare the quantum state of the normal distribution. Exemplarily, the preset preparation precision is 2 -10 , then n = 10, the first register includes 10 qubits, and the second register includes 55 qubits; the preset preparation precision is 2 -5 , then n = 5, the first register includes 5 qubits, and the second register includes 15 qubits.

[0054] In some possible embodiments of the present invention, the preparing the target quantum state of the first register according to a random variable value of the target normal distribution and the preparation precision may include:

[0055] Determining a binary string of a random variable value of the target normal distribution;

[0056] Based on the binary string, determining a target binary string, where the length of the target binary string is n;

[0057] Preparing the quantum state of the first register to be the target quantum state corresponding to the target binary string.

[0058] In the present invention, the selected random variable value is converted into a binary string, and then, according to the relationship between the length of the binary string and n, a truncation operation or a zero-padding operation is determined to obtain a target binary string. If the length of the binary string is less than n, a zero-padding operation needs to be performed on the binary string, specifically, zeros are padded at the end of the binary string; if the length of the binary string is greater than n, the binary string needs to be truncated, specifically, truncation is performed from the front to the back; if the length of the binary string is equal to n, the binary string is the target binary string. Exemplarily, the target value is 0.5, and its corresponding binary string is 0.1. Assuming n = 8, since the length of the binary string is less than 8, a zero-padding operation needs to be performed, and the binary string after zero-padding is 0.10000000. If the target value is 0.2, its corresponding binary string is 0.001100110011001100110011001100110011001100110011001101. Since the length exceeds 8, the binary string needs to be truncated, and the truncated binary string is 0.00110011. The target binary string represents the selected random variable value or approximately represents the selected random variable value.

[0059] An n-bit target binary string can be represented as:

[0060]

[0061] x i is the i-th significant bit of the target binary string, and the significant bits are numbered starting from after the decimal point. Exemplarily, for the target binary string 0.00110011, the 2nd significant bit is 1, and the 4th significant bit is 0.

[0062]

[0063] In the summation of the above formula, there are terms, and the second register includes qubits.

[0064] One qubit in the first register corresponds one-to-one to the significant bits in the target binary string. Exemplarily, the 0th significant bit corresponds to the qubit q 0 in the first register, and the 1st significant bit corresponds to the qubit q 1. The first register encodes the target binary string to obtain the target quantum state. Specifically, the H gate can be applied to each qubit in the first register to obtain the target quantum state. It should be noted that there is an additional qubit encoding symbol bit in the first register, which is used to represent the positive or negative value of the random variable according to the quantum state corresponding to this symbol bit. This additional qubit is the highest - order qubit in the first register. When there is a symbol bit, the first register includes n + 1 qubits, where n qubits are used to encode the data bits of the random variable value, and 1 qubit is used to encode the symbol bit. Unless otherwise specified below, n is determined by the preparation accuracy, and it is the number of qubits in the first register used to encode the random variable value, excluding the qubit corresponding to the symbol bit.

[0065] S202: Apply a controlled - RY gate with the rotation angle determined by the angle controlled by the first register in the target quantum state to the second register in the initial quantum state to obtain a normal - distribution quantum state.

[0066] The RY gate of a single qubit can be represented in the following unitary matrix form:

[0067]

[0068] where θ is the rotation angle.

[0069] The RY gate can achieve the following quantum state evolution:

[0070] RY(θ)|0> = cos(θ / 2)|0> + sin(θ / 2)|1>

[0071] For the controlled - RY gate, whether it is executed is determined by the quantum state of its control qubit. The rotation angle of the controlled - RY gate can be used to control the RY gate to excite the qubit in the second register to a specific state. Further, the specific state of the qubit can be used to form a quantum state representing the normal distribution. In the embodiments of the present invention, the RY gate acting on the second register is controlled by the quantum state of the first register, so that the qubits in the second register are excited to a specific state, thereby obtaining a normal - distribution quantum state. Compared with the prior art, it is not necessary to process the to - be - prepared normal - distribution quantum state and then prepare the processed quantum state with some information removed. Instead, it is directly prepared, and when preparing, the number of qubits required for preparation and the rotation angle of the controlled - RY gate are determined according to the preparation accuracy and the properties of the normal distribution, and a normal - distribution quantum state can be prepared more precisely.

[0072] In some embodiments of the present invention, the controlled RY gate may include a first controlled RY gate and a second controlled RY gate. The first controlled RY gate is a single-qubit controlled RY gate, and the second controlled RY gate is a two-qubit controlled RY gate.

[0073] In some embodiments of the present invention, the number of the first controlled RY gates may be n; the number of the second controlled RY gates is pieces;

[0074] The qubits in the second register affected by each first controlled RY gate are different from each other;

[0075] The qubits in the second register affected by each second controlled RY gate are different from each other;

[0076] The qubits in the second register affected by each first controlled RY gate are different from the qubits in the second register affected by each second controlled RY gate.

[0077] In an embodiment of the present invention, when the preparation accuracy is determined, the number of qubits required for preparation and the controlled RY gates are also determined accordingly. The sum of the number of the first controlled RY gates and the number of the second controlled RY gates is the number of qubits in the second register, and each qubit in the second register acts on one controlled RY gate.

[0078] To determine the control qubit of the first controlled RY gate, a qubit that has not been used as the control qubit of other first controlled RY gates can be randomly selected from the first register as the control qubit of this first controlled RY gate; or the qubits in the first register can be sequentially used as the control qubits of the first controlled RY gates. Of course, the control qubits of the first controlled RY gates can also be determined in other ways, as long as there are no identical control qubits for all the first controlled RY gates, that is, the control qubits of each controlled RY gate are different from each other.

[0079] For the second controlled RY gate, 2 qubits can be randomly selected from the first register as the control qubits of this second controlled RY gate, or 2 qubits can be selected from the first register as the control qubits of the second controlled RY gate according to a certain order. For the n qubits in the first register, every two qubits form a group, and there are a total of groups, and one group is assigned to each second controlled RY gate as the control qubits.

[0080] In the embodiments of the present invention, the qubit on which the controlled RY gate acts in the second register is the target qubit of the controlled RY gate. To determine the control qubit of the first controlled RY gate, the target qubit of the first controlled RY gate can be sequentially determined from the second register in a certain order, or a qubit can be randomly selected from the second register as the target qubit. Of course, it can also be determined by other means, which will not be enumerated one by one here, as long as the target qubits of the first controlled RY gate are different. For the second controlled RY gate, the same method as that for determining the target qubit of the first controlled RY gate can be used, or it can be different, as long as the target qubits of each second controlled RY gate are different from each other and also different from the target qubit of the first RY gate.

[0081] Since the target qubit and the control qubit of the first RY gate are both different, the first RY gate can be executed in parallel, that is, the first RY gate can be executed in the same layer, and the second RY gate can be executed in a layer less than or equal to 2n + 1. Therefore, in the embodiments of the present invention, the quantum state of the qubits in the first register is used to control the controlled RY gate. The qubits in the second register do not need to be quantum entangled with each other, and the quantum circuit depth is relatively shallow, so that the preparation of the normal distribution quantum state can be realized. To a certain extent, it can effectively prevent the decoherence of qubits, improve the stability and reliability of the prepared normal distribution quantum state, realize the effective preparation of the normal distribution quantum state through a relatively small number of quantum gates, and also can save computing resources to a certain extent and improve the efficiency of the preparation process.

[0082] In the embodiments of the present invention, the complexity of the qubit is O(n), and the complexity of the quantum logic gate is O(n 2 ). Based on this, the complexity of preparing the normal distribution quantum state is polynomial level, rather than exponential level.

[0083] In some embodiments of the present invention, determining the rotation angle of each controlled RY gate according to the numerical range of the random variable of the target normal distribution and the control qubit of each controlled RY gate determined from the first register may include:

[0084] Using the relationship between the numerical range of the random variable of the target normal distribution and the variance of the target normal distribution to determine the parameters required for calculating the rotation angle;

[0085] Using the determined parameters and the serial number of the control qubit determined from the first register to calculate the rotation angle of each controlled RY gate.

[0086] The parameter λ 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

[0087] The serial number of the control bit is its serial number in the first register. The serial number of the qubit in the first register corresponds to the serial number of the significant bit of the random variable value encoded by the qubit. The qubits in the first register correspond to the significant bits of the random variable value from low to high from low bit to high bit. After determining the parameter and the control bit, the rotation angle of each RY gate can be calculated. Specifically, the formula can be used to calculate the rotation angle of each first RY gate, where λ is the determined parameter; the formula can be used to calculate the rotation angle of each second RY gate, where i, j, and k are the serial numbers of the corresponding control bits respectively.

[0088] Exemplarily, when n = 4 and the numerical range of the target normal distribution is (-3σ, 3σ), the calculated Then 4 qubits in the first register encode the random variable value, 1 qubit is used to encode the sign bit, and the number of qubits in the second register is ones, the number of the first controlled RY gates is 4, and the number of the second controlled RY gates is 6. One kind of quantum circuit for preparing the normal distribution quantum state can be as Figure 3 shown, q 4 is the qubit corresponding to the sign bit, and the number in the RY gate represents the rotation angle. From Figure 3 it can be seen that the quantum circuit structure for preparing the normal distribution quantum state is relatively simple, and the number of qubits and the rotation angle of the controlled RY gate can be adjusted according to the actual situation, making the preparation of the normal distribution quantum state easy to expand.

[0089] In the embodiment of the present invention, through the action of the controlled RY gate, the quantum state is obtained:

[0090]

[0091] where A is the action of all controlled RY gates. It can be seen from this that the action of the controlled RY gate is to realize the preparation of the exponential distribution quantum state.

[0092] It can be seen that in the present invention, first, according to a random variable value of the target normal distribution and the preparation precision, the target quantum state of the first register is prepared; according to the numerical range of the random variable of the target normal distribution and each control qubit determined from the first register, the rotation angle of each controlled RY gate is determined; then, for the second register in the initial quantum state, a controlled RY gate with the rotation angle determined as the angle controlled by the first register in the target quantum state is applied to obtain the normal distribution quantum state. By applying a controlled RY gate with a specific rotation angle to the qubits of the second register, the normal distribution quantum state is obtained, and the rotation angle is determined based on the numerical range of the normal distribution and the control qubits. It is not necessary to first process the quantum state to be prepared to prepare the normal distribution quantum state after discarding information, but the normal distribution quantum state is directly prepared by using the preparation precision and the properties of the normal distribution, so as to obtain a more accurate normal distribution quantum state.

[0093] See Figure 4 , Figure 4 is a schematic structural diagram of a device for preparing a normal distribution quantum state provided by an embodiment of the present invention, corresponding to the Figure 2 shown process. The device includes:

[0094] A determination module 401, configured to prepare the target quantum state of the first register according to a random variable value of the target normal distribution and the preparation precision; and determine the rotation angle of each controlled RY gate according to the numerical range of the random variable of the target normal distribution and each control qubit determined from the first register;

[0095] An obtaining module 402, configured to apply a controlled RY gate with the rotation angle determined as the angle controlled by the first register in the target quantum state to the second register in the initial quantum state to obtain the normal distribution quantum state.

[0096] In some possible implementation manners of the present invention, the first register may include n qubits, and the second register may include qubits, and 2 n is reciprocal to the preparation precision.

[0097] In some possible implementation manners of the present invention, the determination module 401 may include:

[0098] A first determination unit, configured to determine the binary string of a random variable value of the target normal distribution;

[0099] A second determination unit, configured to determine the target binary string based on the binary string, where the length of the target binary string is n;

[0100] A preparation unit for preparing the quantum state of a first register into a target quantum state representing the target binary string.

[0101] In some possible embodiments of the present invention, the controlled RY gate includes a first controlled RY gate and a second controlled RY gate. The first controlled RY gate is a single-qubit controlled RY gate, and the second controlled RY gate is a two-qubit controlled RY gate.

[0102] In some possible embodiments of the present invention, the number of the first controlled RY gates is n;

[0103] The number of the second controlled RY gates is pieces;

[0104] The qubits in the second register acted on by each first controlled RY gate are different from each other;

[0105] The qubits in the second register acted on by each second controlled RY gate are different from each other;

[0106] The qubits in the second register acted on by each first controlled RY gate are different from the qubits in the second register acted on by each second controlled RY gate.

[0107] In some possible embodiments of the present invention, the determination 401 may further include:

[0108] A third determination unit for determining the parameters required for calculating the rotation angle by using the relationship between the numerical range of the random variable of the target normal distribution and the variance of the target normal distribution;

[0109] A calculation unit for calculating the rotation angle of each controlled RY gate by using the determined parameters and the sequence number of the control bit determined from the first register.

[0110] In some possible embodiments of the present invention, the calculation unit may specifically be used for:

[0111] Using the formula To calculate the rotation angle of each first RY gate, where λ is the determined parameter;

[0112] Using the formula To calculate the rotation angle of each second RY gate, where i, j, and k are the sequence numbers of the corresponding control bits respectively.

[0113] It can be seen that in the present invention, first, according to a random variable value of the target normal distribution and the preparation accuracy, the target quantum state of the first register is prepared; according to the numerical range of the random variable of the target normal distribution and each control bit of the controlled RY gate determined from the first register, the rotation angle of each controlled RY gate is determined; then, for the second register in the initial quantum state, a controlled RY gate with the rotation angle determined as the angle controlled by the first register in the target quantum state is applied, and a normal distribution quantum state is obtained. By applying a controlled RY gate with a specific rotation angle to the qubits of the second register, a normal distribution quantum state is obtained, and the rotation angle is determined based on the numerical range of the normal distribution and the control bits, without the need to first process the quantum state to be prepared to prepare a normal distribution quantum state after discarding information, but directly prepare a normal distribution quantum state by utilizing the preparation accuracy and the properties of the normal distribution, thereby obtaining a relatively accurate normal distribution quantum state.

[0114] An embodiment of the present invention further provides a storage medium, in which a computer program is stored, and wherein the computer program is configured to implement the steps in any one of the above method embodiments when running.

[0115] Specifically, in this embodiment, the above storage medium may be configured to store a computer program for implementing the following steps:

[0116] S201: According to a random variable value of the target normal distribution and the preparation accuracy, prepare the target quantum state of the first register; according to the numerical range of the random variable of the target normal distribution and each control bit of the controlled RY gate determined from the first register, determine the rotation angle of each controlled RY gate;

[0117] S202: For the second register in the initial quantum state, apply a controlled RY gate with the rotation angle determined as the angle controlled by the first register in the target quantum state, and obtain a normal distribution quantum state.

[0118] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to implement the steps in any one of the above method embodiments.

[0119] Specifically, the above electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the above processor, and the input / output device is connected to the above processor.

[0120] Specifically, in this embodiment, the above processor may be configured to implement the following steps through a computer program:

[0121] S201: Prepare the target quantum state of the first register according to a random variable value of the target normal distribution and the preparation accuracy; determine the rotation angle of each controlled RY gate according to the numerical range of the random variable of the target normal distribution and each control bit determined from the first register.

[0122] S202: Apply a controlled RY gate with the rotation angle determined as the angle controlled by the first register in the target quantum state to the second register in the initial quantum state to obtain a normal distribution quantum state.

[0123] The structure, features and effects of the present invention have been described in detail based on the embodiments shown in the drawings. The above are only the preferred embodiments of the present invention, but the present invention is not limited to the scope of implementation shown in the drawings. Any changes made according to the concept of the present invention, or equivalent embodiments modified into equivalent changes, should still be within the protection scope of the present invention when they do not exceed the spirit covered by the description and the drawings.

Claims

1. A method for preparing a normal distribution quantum state, characterized in that, the method includes: Preparing the target quantum state of the first register according to a random variable value of the target normal distribution and the preparation accuracy; determining the rotation angle of each controlled RY gate according to the numerical range of the random variable of the target normal distribution and the control qubits determined from the first register; Applying controlled RY gates with the rotation angles determined as the angles controlled by the first register in the target quantum state to the second register in the initial quantum state to obtain the normal distribution quantum state.

2. The method according to claim 1, characterized in that, The first register includes n qubits, and the second register includes qubits, 2 n which is reciprocal to the preparation precision.

3. The method according to claim 2, characterized in that, The preparing the target quantum state of the first register according to a random variable value of the target normal distribution and the preparation accuracy includes: Determining the binary string of a random variable value of the target normal distribution; Based on the binary string, determining the target binary string, where the length of the target binary string is n; Preparing the quantum state of the first register as the target quantum state corresponding to the target binary string.

4. The method according to claim 2, characterized in that, The controlled RY gates include a first controlled RY gate and a second controlled RY gate. The first controlled RY gate is a single-qubit controlled RY gate, and the second controlled RY gate is a two-qubit controlled RY gate.

5. The method according to claim 4, characterized in that, The number of the first controlled RY gates is n; The number of the second controlled RY gates is ; The qubits in the second register acted on by each first controlled RY gate are different from each other; The qubits in the second register acted on by each second controlled RY gate are different from each other; The qubits in the second register acted on by each first controlled RY gate are different from the qubits in the second register acted on by each second controlled RY gate.

6. The method according to claim 5, characterized in that, The determining the rotation angle of each controlled RY gate according to the numerical range of the random variable of the target normal distribution and the control qubits determined from the first register includes: Using the relationship between the numerical range of the random variable of the target normal distribution and the variance of the target normal distribution to determine the parameters required for calculating the rotation angle; Using the determined parameters and the sequence numbers of the control qubits determined from the first register to calculate the rotation angle of each controlled RY gate.

7. The method according to claim 6, characterized in that, The using the determined parameters and the sequence numbers of the control qubits determined from the first register to calculate the rotation angle of each controlled RY gate includes: Using the arithmetic formula calculate the rotation angle of each first RY gate, where λ is the determined parameter; Using the arithmetic formula calculate the rotation angle of each second RY gate, where i, j, and k are the sequence numbers of the corresponding control bits respectively.

8. A device for preparing a normal distribution quantum state, characterized in that, the device includes: A determining module, configured to prepare the target quantum state of the first register according to a random variable value of the target normal distribution and the preparation accuracy; determine the rotation angle of each controlled RY gate according to the numerical range of the random variable of the target normal distribution and the control qubits determined from the first register; An acquisition module is configured to apply a controlled RY gate with a rotation angle determined by the angle controlled by the first register in the target quantum state to the second register in the initial quantum state, so as to obtain a quantum state of normal distribution.

9. A storage medium, characterized in that, a computer program is stored in the storage medium, wherein the computer program is configured to implement the method according to any one of claims 1 to 7 when running.

10. An electronic device, comprising a memory and a processor, characterized in that, a computer program is stored in the memory, and the processor is configured to run the computer program to implement the method according to any one of claims 1 to 7.