Normal distribution quantum state preparation method, device, storage medium and electronic device

By obtaining preset parameters and rotation parameters and using RY gate operations and summation operations, the problem of high complexity in preparing normally distributed quantum states in the existing technology is solved, and efficient and accurate normally distributed quantum state preparation is achieved.

CN117196050BActive Publication Date: 2025-09-19BENYUAN TIANGONG (ZHENGZHOU) QUANTUM TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311230721.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-20
Publication Date
2025-09-19
Estimated Expiration
2043-09-20

AI Technical Summary

Technical Problem

In the existing technology, the preparation method of normally distributed quantum states has high computational complexity and is difficult to meet the requirements of efficient preparation, especially due to the large number of quantum logic gates used.

Method used

By obtaining the first preset parameter and the second preset parameter, determining the number of quantum bits and the rotation parameter, and using the RY gate operation and the summation operation to prepare the normally distributed quantum state, the number of quantum logic gates and the computational complexity are reduced.

Benefits of technology

The efficient preparation of normally distributed quantum states is achieved, the number of quantum logic gates and computational complexity are reduced, the needs of efficient preparation are met, and the preparation accuracy is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117196050B_ABST
    Figure CN117196050B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, apparatus, storage medium, and electronic device for preparing a normally distributed quantum state, which are applied to the field of quantum computing. The method includes: obtaining a first preset parameter and a second preset parameter; wherein the first preset parameter is used to represent the preparation accuracy of the normally distributed quantum state, and the second preset parameter is used to represent the distribution law of the normally distributed state; based on the first preset parameter, the number n of quantum bits used to prepare the normally distributed quantum state can be determined; based on the second preset parameter, the rotation parameter of each quantum bit can be determined, and the PY gate operation corresponding to the rotation parameter is performed on each of the n quantum bits in the initial state; and then a summation operation is performed on the n quantum bits to obtain the normally distributed quantum state. Compared with the commonly used method of preparing normally distributed quantum states based on bisection, this solution reduces the number of quantum logic gates and computational complexity required to prepare the quantum state, thereby meeting the demand for efficient preparation of normally distributed quantum states.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of quantum computing technology, and in particular to a method, device, storage medium and electronic device for preparing a normally distributed quantum state. Background Art

[0002] Quantum computers are physical devices that follow the laws of quantum mechanics to perform high-speed mathematical and logical operations, store, and process quantum information. They rely on quantum bits (qubits), which also follow the laws of quantum mechanics, as their basic units. A truly practical quantum computer must have hundreds to thousands of qubits to solve practical problems. A quantum circuit, also known as a quantum logic circuit, abstractly represents the circuitry that operates on qubits. Quantum algorithms, described by quantum circuit models, can be used to manipulate quantum computers, causing them to process input states and output specific measurements. Quantum computers, when running quantum algorithms, are capable of processing mathematical problems more efficiently than conventional computers, making them a key technology under research.

[0003] The normal distribution has widespread applications in finance and other fields. For example, the rate of change of stock prices approximates a normal distribution; in risk analysis, the rate of return also follows a normal distribution. Therefore, a universal method for preparing normally distributed quantum states is crucial for solving specific problems using quantum computing. Due to the properties of the law of large numbers, the properties satisfied by the normal distribution effectively match quantum states, making it possible to prepare normally distributed quantum states on quantum amplitudes.

[0004] Currently, the preparation of normally distributed quantum states can be achieved through amplitude preparation using the bisection method. However, when using this type of general algorithm to more accurately prepare normally distributed quantum states, the large number of quantum logic gates used and the high computational complexity make it difficult to meet the requirements of efficient preparation. Summary of the Invention

[0005] The purpose of the present invention is to provide a method, device, storage medium and electronic device for preparing a normally distributed quantum state, aiming to reduce the number of quantum logic gates and computational complexity used to prepare the normally distributed quantum state, thereby meeting the demand for efficient preparation of the normally distributed quantum state.

[0006] One embodiment of the present invention provides a method for preparing a normally distributed quantum state, the method comprising:

[0007] Obtaining a first preset parameter and a second preset parameter; wherein the first preset parameter is used to represent the preparation accuracy of the normally distributed quantum state, and the second preset parameter is used to represent the distribution law of the normally distributed quantum state;

[0008] Determining the number n of quantum bits used to prepare the normally distributed quantum state based on the first preset parameter;

[0009] Determining a rotation parameter of each of the qubits based on the second preset parameter, and performing an RY gate operation corresponding to the rotation parameter on each of the n qubits in the initial state;

[0010] A summation operation is performed on the n quantum bits to obtain the normally distributed quantum state.

[0011] Optionally, the second preset parameter includes an expected value of the normal distribution. Before determining the number n of quantum bits used to prepare the normally distributed quantum state based on the first preset parameter, the method further includes:

[0012] If the expected value is not within the preset interval, a numerical transformation is performed on the expected value so that the transformed expected value is within the preset interval.

[0013] Optionally, after performing the summation operation on the n quantum bits, the method further includes:

[0014] A quantum logic gate operation corresponding to the inverse transformation of the numerical transformation is performed on the quantum state obtained by the summation operation.

[0015] Optionally, the second preset parameter includes an expected value E(x) of the normal distribution, and determining the rotation parameter of each of the qubits based on the second preset parameter includes:

[0016] Based on the expected value E(x) and the number of qubits n, a rotation parameter θ of each qubit is determined; wherein the rotation parameter θ satisfies the following formula:

[0017]

[0018] Optionally, performing the RY gate operation corresponding to the rotation parameter on the n qubits in the initial state respectively includes:

[0019] For each quantum bit in the initial state, the Ry(2θ) gate operation is performed separately.

[0020] Optionally, the second preset parameter includes the variance D(x) of the normal distribution, the number n of qubits is an odd number, and determining the rotation parameter of each qubit based on the second preset parameter includes:

[0021] The rotation parameter of one of the qubits is set to θ1, the rotation parameter of half of the other n-1 qubits is set to θ2, and the rotation parameter of the other half of the other n-1 qubits is set to θ3; wherein the rotation parameters θ1, θ2, and θ3 satisfy the following formula:

[0022]

[0023]

[0024]

[0025] Optionally, performing the RY gate operation corresponding to the rotation parameter on the n qubits in the initial state respectively includes:

[0026] Perform RY(2θ1) gate operation on one of the qubits, and qubits, respectively perform RY(2θ2) gate operations, and the other group qubits, each performing a RY(2θ3) gate operation.

[0027] Optionally, the first preset parameter includes a preparation accuracy ε of the normally distributed quantum state, and determining the number n of quantum bits used to prepare the normally distributed quantum state based on the first preset parameter includes:

[0028] The number n of quantum bits used to prepare the normally distributed quantum state is determined based on the preparation accuracy ε of the normally distributed quantum state; wherein the preparation accuracy ε and the number of quantum bits n raised to the power of 2 are reciprocals of each other.

[0029] Another embodiment of the present invention provides a device for preparing a normal distribution quantum state, the device comprising:

[0030] An acquisition module, configured to acquire a first preset parameter and a second preset parameter; wherein the first preset parameter is used to represent the preparation accuracy of the normally distributed quantum state, and the second preset parameter is used to represent the distribution law of the normally distributed quantum state;

[0031] A determination module, configured to determine the number n of quantum bits used to prepare the normally distributed quantum state based on the first preset parameter;

[0032] a rotation module, configured to determine a rotation parameter of each of the qubits based on the second preset parameter, and perform an RY gate operation corresponding to the rotation parameter on each of the n qubits in the initial state;

[0033] A summation module is used to perform a summation operation on the n quantum bits to obtain the normally distributed quantum state.

[0034] Yet another embodiment of the present invention provides a storage medium storing a computer program, wherein the computer program is configured to execute any of the above methods when running.

[0035] Yet another embodiment of the present invention provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform any of the above methods.

[0036] Compared with the prior art, the present invention provides a method for preparing a normally distributed quantum state and related equipment, which can obtain a first preset parameter and a second preset parameter; wherein the first preset parameter is used to represent the preparation accuracy of the normally distributed quantum state, and the second preset parameter is used to represent the distribution law of the normal distribution; based on the first preset parameter, the number n of quantum bits used to prepare the normally distributed quantum state can be determined; based on the second preset parameter, the rotation parameter of each quantum bit can be determined, and the RY gate operation corresponding to the rotation parameter can be performed on the n quantum bits in the initial state respectively; and then a summation operation can be performed on the n quantum bits to obtain a normally distributed quantum state.

[0037] Compared with the O(NlogN) quantum logic gates required for amplitude encoding to achieve normal distribution quantum state preparation through bisection, the complexity of the quantum logic gates required by this scheme is reduced to O(N), and the corresponding time complexity is only O(n 2 ), which greatly reduces the number of quantum logic gates and computational complexity, and can meet the needs of efficient preparation of normally distributed quantum states. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 A network block diagram of a normal distribution quantum state preparation system provided by an embodiment of the present invention;

[0039] Figure 2 A schematic flow chart of a method for preparing a normally distributed quantum state provided in an embodiment of the present invention;

[0040] Figure 3 A probability distribution fitting diagram of a normally distributed quantum state prepared according to an embodiment of the present invention;

[0041] Figure 4 A probability distribution fitting diagram of another prepared normally distributed quantum state provided in an embodiment of the present invention;

[0042] Figure 5 A probability distribution fitting diagram of another prepared normally distributed quantum state provided in an embodiment of the present invention;

[0043] Figure 6A schematic structural diagram of a device for preparing a normally distributed quantum state provided by an embodiment of the present invention;

[0044] Figure 7 A schematic structural diagram of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0045] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and are not to be construed as limiting the present invention.

[0046] Figure 1 This is a network block diagram of a system for preparing a normally distributed quantum state, provided in an embodiment of the present invention. The system may include a network 110, a server 120, a wireless device 130, a client 140, storage 150, a classical computing unit 160, a quantum computing unit 170, and may also include additional memory, classical processors, quantum processors, and other devices (not shown).

[0047] The network 110 is a medium for providing communication links between various devices and computers connected together in the normal distribution quantum state preparation system, including but not limited to the Internet, corporate intranet, local area network, mobile communication network and their combinations. The connection method can be wired, wireless communication links or optical fiber cables, etc.

[0048] Server 120, wireless device 130, and client 140 are conventional data processing systems that may contain data and applications or software tools that perform conventional computing processes. Client 140 may be a personal computer or a network computer, so the data may also be provided by server 120. Wireless device 130 may be a smartphone, tablet, laptop, smart wearable device, etc. Storage unit 150 may include database 151, which may be configured to store data such as qubit parameters, quantum logic gate parameters, quantum circuits, and quantum programs.

[0049] The classical computing unit 160 (quantum computing unit 170) may include a classical processor 161 (quantum processor 171) for processing classical data (quantum data) and a memory 162 (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 163 (application 173). The application 163 (application 173) may be used to implement a quantum algorithm compiled according to the method for preparing a normal distribution quantum state provided in an embodiment of the present invention.

[0050] Any data or information stored or generated in the classical computing unit 160 (quantum computing unit 170) can also be configured to be stored or generated in another classical (quantum) processing system in a similar manner, and similarly, any application program executed therein can also be configured to be executed in another classical (quantum) processing system in a similar manner.

[0051] It should be noted that a true quantum computer is a hybrid structure, which includes at least Figure 1 The system consists of two parts: the classical computing unit 160, which is responsible for performing classical calculations and control; and the quantum computing unit 170, which is responsible for running quantum programs and thus realizing quantum computing.

[0052] The classical computing unit 160 and quantum computing unit 170 can be integrated into a single device or distributed across two different devices. For example, a first device including the classical computing unit 160 runs a classical computer operating system, provides quantum application development tools and services, and also provides the storage and network services required for quantum applications. Users develop quantum programs using the quantum application development tools and services on the device, and send the quantum programs to a second device including the quantum computing unit 170 via the network services on the device. The second device runs a quantum computer operating system, which parses and compiles the code of the quantum program into instructions that can be recognized and executed by the quantum processor 170. The quantum processor 170 then implements the quantum algorithm corresponding to the quantum program based on the instructions.

[0053] The computing units of the classic processor 161 in the classic computing unit 160 are based on CMOS transistors on a silicon chip. These computing units are not constrained by time or coherence, meaning they are available at all times, regardless of the duration of their use. Furthermore, the number of these computing units on a silicon chip is plentiful. Currently, a classic processor 161 contains tens of thousands of computing units. This abundance of computing units and the selectable computational logic of the CMOS transistors are fixed, such as AND logic. When computing with CMOS transistors, a large number of CMOS transistors are combined with a limited number of logical functions to achieve the desired computational effect.

[0054] The basic computing unit of the quantum processor 171 in the quantum computing unit 170 is the qubit. The input of the qubit is limited by coherence and coherence time, that is, the qubit is limited by the length of use and is not available at any time. Making full use of the qubit within the available usage time of the qubit 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 the computing function through the logical function configured on demand. Given the limited number of qubits, the logical functions in the field of quantum computing are diverse, such as: 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 use limited qubits combined with a variety of logical functions to achieve the computing effect.

[0055] Based on these differences, the application of classical logic functions to the design of CMOS tubes and the application of quantum logic functions to the design of quantum bits are significantly and essentially different. The application of classical logic functions to the design of CMOS tubes does not require consideration of the individuality of the CMOS tubes. For example, the representation of CMOS tubes in silicon chips is the individual identification, position, and usable life of each CMOS tube. Therefore, the classical algorithms composed of classical logic functions only express the operational relationships of the algorithms, and do not express the algorithm's dependence on the individual CMOS tubes.

[0056] Quantum logic functions acting on qubits must consider their individuality, such as their position within the quantum chip, their individual identifier, their location, their relationship to surrounding qubits, and the usable lifespan of each qubit. Therefore, quantum algorithms composed of quantum logic functions not only express the algorithm's operational relationships but also its dependence on individual qubits.

[0057] Quantum chips can include qubits and channels that control them. Quantum logic gates are implemented using analog signals. Different combinations of analog signals are applied to qubits through the channels that control them, thereby realizing quantum circuits with different functions and completing data processing. Therefore, the design of quantum logic functions applied to qubits (including whether qubits are used and the efficiency of each qubit's use) is key to improving the computing performance of quantum computers and requires special design. This is also the uniqueness of quantum algorithms based on quantum logic functions, which are fundamentally and significantly different from classical algorithms based on classical logic functions. However, the above-mentioned qubit-specific design is a technical issue that ordinary computing devices do not need to consider or face.

[0058] Quantum computing can be used to solve some problems involving the calculation of probability distributions. For example, asset pricing or risk estimation often requires simulating and predicting future asset prices and their fluctuations, processes that often involve the calculation of probability distributions. Quantum computing can help solve these problems by achieving computations faster than classical computers. The normal distribution, as a widely used probability distribution model, holds important implications for using quantum computing to solve problems involving probability distribution calculations. For example, using normally distributed quantum states to simulate classical random processes can more accurately estimate asset price volatility and predict and evaluate future asset prices. Furthermore, the normal distribution can be used in Monte Carlo methods for quantum simulation to more accurately estimate financial risk and probability. Therefore, preparing normally distributed quantum states can help users process and solve these problems more quickly.

[0059] Therefore, the present invention proposes a method for preparing a normally distributed quantum state and related devices, aiming to reduce the number of quantum logic gates and computational complexity used to prepare the normally distributed quantum state, thereby meeting the demand for efficient preparation of the normally distributed quantum state.

[0060] See also Figure 2 , Figure 2 A method for preparing a normally distributed quantum state provided in an embodiment of the present invention can be applied to a quantum computing unit, which can be a device that uses the properties of quantum mechanics to implement quantum computing. Specifically, the quantum computing unit can use the quantum state of a quantum bit as a data carrier and drive the evolution of the quantum bit based on the linear superposition principle of the quantum state to implement a specified operation process. For example, the quantum computing unit can be a superconducting quantum bit control circuit implemented based on ultra-low temperature technology. Alternatively, the quantum computing unit can be a quantum bit control circuit built using quantum well technology. Of course, the quantum computing unit can also be an optical quantum integrated chip, etc.

[0061] In one embodiment, a quantum computing unit can function as a server. It can provide computing services to connected clients. Clients can communicate with the quantum computing unit and send quantum computing tasks to it for processing. The quantum computing unit then executes these tasks and returns the results to the client. Conversely, the quantum computing unit can also communicate with a basic computing unit. The basic computing unit can be an electronic device with certain computing and display capabilities, such as a computer, smartphone, or smart wearable device.

[0062] The method for preparing a normal distribution quantum state may include the following steps:

[0063] Step 201: Obtain a first preset parameter and a second preset parameter.

[0064] Among them, the first preset parameter is used to represent the preparation accuracy of the normal distribution quantum state, and the second preset parameter is used to represent the distribution law of the normal distribution.

[0065] The normal distribution is a theoretical probability distribution. In the solution provided by the embodiment of the present invention, the preparation process of the normally distributed quantum state is based on the law of large numbers and the central limit theorem of independent and identically distributed approximations of this probability distribution. In this case, the prepared normally distributed quantum state will have a certain degree of error compared to the theoretical normal distribution. The smaller the error, the higher the accuracy of the preparation, and vice versa. Therefore, by obtaining a first preset parameter reflecting the preparation accuracy, the normally distributed quantum state can be prepared according to the accuracy requirements, increasing the preparation flexibility.

[0066] Specifically, for example, the first preset parameter may include preparation accuracy, which may represent a preparation requirement for a normally distributed quantum state. A normally distributed quantum state with high precision can perform quantum calculations more accurately to accurately simulate classical random processes. Correspondingly, the preparation of a normally distributed quantum state with low precision takes less time and does not occupy too many computing resources, and can simply simulate some classical random processes with low precision requirements. For another example, the first preset parameter may include an error parameter, which can represent the difference between the probability value corresponding to each prepared quantum state and the probability value corresponding to the theoretical normal distribution. The difference can also be processed to obtain data having a certain mapping relationship with the difference as an error parameter. Of course, the first preset parameter may also include other data that can reflect the degree of approximation.

[0067] In addition, in some cases, the normal distribution is a commonly used probability distribution, and its distribution law can usually be reflected by the parameters of the normal distribution. Different parameters will result in different characteristics and properties of the normal distribution. Therefore, by obtaining a second preset parameter that can affect the normal distribution law or characteristics, a normal distribution under the influence of different parameters can be prepared. In this embodiment, the second preset parameter can be used to represent the distribution law of the normal distribution to be prepared. The distribution law may include the shape, distribution characteristics, expectation, variance, etc. of the normal distribution to be prepared. The second preset parameter can reflect these characteristics of the normal distribution to be prepared.

[0068] Specifically, for example, the second preset parameter may include the expected value E(x) and variance D(x) of the normal distribution, and the expected value E(x) and variance D(x) can affect the statistical characteristics and shape of the normal distribution. The probability density function of the normal distribution presents a typical bell-shaped curve, which is highest in the middle and gradually decreases on both sides. This is because most of the data is concentrated near the expected value, while the data at the edge gradually decreases. Among them, the expected value E(x) determines the center of the distribution, and the variance D(x) determines the degree of dispersion of the data points around the expected value. The larger the variance, the wider the curve and the more dispersed the data. Accordingly, the first preset parameter may also include other parameters, such as the mean μ and standard deviation σ of the normal distribution, which are not specifically limited here.

[0069] In this embodiment, obtaining the first and second preset parameters can be used to determine the number of quantum bits required to prepare a normally distributed quantum state and the parameters of the required quantum logic gates. The first and second preset parameters can be obtained by directly obtaining the first and second preset parameters preset in the quantum computing unit, or by receiving the first and second preset parameters sent by a classical computer as a basic computing unit to a quantum computing unit. Of course, the quantum computing unit can also be used as a server to receive the first and second preset parameters sent by a client connected to it.

[0070] Step 202: Determine the number n of quantum bits used to prepare the normally distributed quantum state based on the first preset parameters.

[0071] It is understood that the greater the number of qubits used to prepare a normally distributed quantum state, the more accurately the quantum state formed after the subsequent RY gate operation and summation operation with the rotation parameters set will approximate the normal distribution, and the smaller the error. Therefore, before each preparation of a normally distributed quantum state, a first preset parameter representing the preparation accuracy of the normally distributed quantum state can be pre-set, taking into account various factors such as the preparation accuracy requirements, preparation time, and the computing resources required for the preparation. The number of qubits required for the preparation of this normally distributed quantum state can then be determined based on the set first preset parameter.

[0072] As an implementation manner of an embodiment of the present invention, the above-mentioned first preset parameter may include the preparation accuracy ε of the normally distributed quantum state, and the above-mentioned determination of the number of quantum bits n used to prepare the normally distributed quantum state based on the first preset parameter may include:

[0073] The number n of quantum bits used to prepare the normally distributed quantum state is determined based on the preparation accuracy ε of the normally distributed quantum state.

[0074] The preparation accuracy ε and the number of quantum bits (n) raised to the power of 2 are reciprocals of each other.

[0075] Specifically, the number of quantum bits n used to prepare a normally distributed quantum state can be calculated based on the following formula:

[0076] 2 -n =ε

[0077] This formula can accurately calculate the number of qubits n required to prepare a normally distributed quantum state for each preparation precision ε. For example, if the preparation precision of a normally distributed quantum state is 0.125, the above formula can be used to calculate that the number of qubits required to prepare this normally distributed quantum state is 3.

[0078] In one embodiment, when the number of qubits n corresponding to a certain preparation precision ε is not an integer, rounding up can be employed to ensure that the required precision indicated by the preparation precision is met. Accordingly, the number of qubits required to prepare a normally distributed quantum state can also be determined by other methods, without specific limitations here, as long as the normally distributed quantum state prepared from this number of qubits meets the preset preparation precision requirement. This allows the preparation of normally distributed quantum states to be performed according to the required precision, increasing preparation flexibility.

[0079] Step 203: Determine a rotation parameter of each of the qubits based on the second preset parameter, and perform an RY gate operation corresponding to the rotation parameter on each of the n qubits in the initial state.

[0080] Specifically, this embodiment uses amplitude coding to encode the quantum state. The quantum logic gate used in quantum state encoding is the RY gate, which can be expressed as the following unitary matrix form:

[0081]

[0082] The PY gate can realize the following quantum state evolution:

[0083] PY(θ)|0>=cos(θ / 2)|0>+sin(θ / 2)|1>

[0084] Then, based on the second preset parameter representing the distribution law of the normal distribution, the rotation parameters of each of the n qubits determined in step 202 can be calculated. Furthermore, an RY gate can be performed on each qubit in the initial state, where the rotation parameters of the RY gate are calculated based on the second preset parameter representing the distribution law of the normal distribution. The rotation parameters corresponding to different qubits subjected to the RY gate operation can be the same or different.

[0085] In this embodiment, the rotation parameter of the RY gate can be used to control the RY gate to excite the qubit to a specific state. Furthermore, the specific state of the qubit can be used to construct a target quantum state representing a normal distribution. If a sum operation is performed on these n qubits, the probability distribution of the resulting quantum state can satisfy a distribution law similar to the above-mentioned normal distribution.

[0086] As an implementation manner of an embodiment of the present invention, the second preset parameter may include the expected value E(x) of the normal distribution, and the determination of the rotation parameter of each of the qubits based on the second preset parameter may include:

[0087] Based on the expected value E(x) and the number of qubits n, a rotation parameter θ of each qubit is determined; wherein the rotation parameter θ satisfies the following formula:

[0088]

[0089] Specifically, in one embodiment, there is the following idea for preparing a normally distributed quantum state:

[0090] First, a two-point distribution can be prepared using a superposition state of a quantum bit. This two-point distribution can be expressed as: cosθ|0>+sinθ|1>, including the two opposing events of the quantum superposition state collapsing to |0> and collapsing to |1>. Correspondingly, the probability of the superposition state collapsing to |0> is P(|0>)=cos 2 θ, the probability of collapsing to |1> is P(|1>)=sin 2 θ, it can be understood that the expected value of the corresponding two-point distribution is E(X)=sin 2 θ, the variance is D(X) = cos 2 θsin 2 θ.

[0091] Furthermore, the law of large numbers describes that as the sample size increases, the sample average tends to the true mean, that is, the sample mean converges to the expected value, indicating that random phenomena tend to show a stable trend in the case of large samples. The independent and identically distributed central limit theorem describes that when the average values ​​of a large number of independent random variables are extracted from any distribution, no matter what the original distribution is, the distribution of these average values ​​tends to a normal distribution. Therefore, the initial state of n quantum bits can be evolved to prepare n quantum states that are the same as the superposition state above, expressed as Then, the quantum state of these n quantum bits is summed up. If the quantum state obtained by summing up is measured, it can be found that the distribution obeyed by the quantum state is approximately normal distribution, and its expected value is E(∑X)=n sin 2θ, the variance is D(∑X)=n cos 2 θ sin 2 θ.

[0092] Furthermore, if an arbitrary constant α is added to the quantum state obtained by the above summation through a constant adder, N(n sin 2 θ+α,n cos 2 θ sin 2 θ), that is, based on the above preparation ideas, any normally distributed quantum state can be prepared.

[0093] In this embodiment, if the number of quantum bits n and the expected value E(x) of the normal distribution are determined, the rotation parameter θ of each quantum bit can be reversely calculated using the above preparation ideas. Prior to this, it is necessary to first determine the expected value E(x) of the normal distribution. Therefore, in the above step 201, if the second preset parameter obtained is the mean μ, the mean μ can be used as the above expected value E(x); if the second preset parameter obtained is the variance D(x), the expected value E(x) can be expressed as D(x) / sin based on the variance D(x) and the rotation parameter θ. 2 θ; Similarly, when the second preset parameter obtained is the standard deviation σ or other parameters, the expected value E(x) can be calculated by corresponding mathematical processing methods, which will not be repeated here.

[0094] For example, the expected value of the target normal distribution to be prepared If the number of quantum bits n=7 used to prepare the target normally distributed quantum state has been obtained through step 202, then the above formula can be used Calculated That is, the 7 quantum bits need to be rotated with the parameters RY door operation.

[0095] Accordingly, performing the RY gate operation corresponding to the rotation parameter on the n qubits in the initial state may include:

[0096] For each quantum bit in the initial state, the RY(2θ) gate operation is performed separately.

[0097] Specifically, the RY gate in the embodiment of the present invention can realize the quantum state evolution of RY(θ)|0>=cos(θ / 2)|0>+sin(θ / 2)|1>. Then, for each quantum bit in the initial state |0>, the RY(2θ) gate operation is performed respectively, and the quantum state of the quantum bit after the RY(2θ) gate operation is cosθ|0>+sinθ|1>.

[0098] For example, the rotation parameter in the above example is Then execute the following on each of the 7 qubits: Gate operation can obtain 7 identical quantum states: The probability of the quantum state collapsing to |0> or |1> is the same, that is, the probability of the two points on a single quantum bit is evenly distributed. If the quantum states of these 7 quantum bits are summed up, then the quantum state obtained by the sum is measured, and we can get Figure 3 The probability distribution fitting diagram of the quantum state is shown in the figure. Among them, the horizontal axis is the sum value, and the vertical axis is the probability of measuring the corresponding sum value. It can be determined that the distribution obeyed by the quantum state is approximately normal distribution. And in The left and right sides of are evenly symmetrical, where is the expected value of the normal distribution, is the variance of the normal distribution.

[0099] As an implementation manner of an embodiment of the present invention, the second preset parameter may include the variance D(x) of the normal distribution, the number n of qubits is an odd number, and the determination of the rotation parameter of each qubit based on the second preset parameter may include:

[0100] The rotation parameter of one of the qubits is set to θ1, the rotation parameter of half of the other n-1 qubits is set to θ2, and the rotation parameter of the other half of the other n-1 qubits is set to θ3; wherein the rotation parameters θ1, θ2, and θ3 satisfy the following formula:

[0101]

[0102]

[0103]

[0104] In one embodiment, if the above formula is used directly If the rotation parameter θ is calculated, the following situation is very likely to occur: the probability of each quantum bit corresponding to the rotation parameter θ collapsing to |0> or |1> is different, so the two points on a single quantum bit are not evenly distributed. Obviously, the probability distribution of the quantum state obtained by summing at this time is not completely symmetric, so using such a quantum state to simulate classical random processes may result in large errors.

[0105] For example, the target normal distribution to be prepared satisfies If the number of qubits used to prepare the target normally distributed quantum state is n=15, the rotation parameter of each qubit is calculated as Then the rotation parameters for the 15 qubits are of Gate operation, the quantum state of each quantum bit can be obtained as Then, the quantum states of these 15 quantum bits are summed up, and the summed quantum state is measured to obtain Figure 4 The probability distribution fitting diagram of the quantum state is shown in the figure. Among them, the horizontal axis is the sum value, and the vertical axis is the probability of measuring the corresponding sum value. It can be determined that the distribution obeyed by the quantum state is approximately normal distribution. But in the expected value The distribution on both sides is not uniform and symmetrical.

[0106] Therefore, it is necessary to optimize the above scheme to make the probability distribution of the prepared normally distributed quantum state more symmetrical, thereby further improving the accuracy of using normally distributed quantum states to simulate classical random processes. The Lyapunov theorem points out that based on the convergence of the moment and variance of a random variable sequence, the limit and distribution of the limit of the random variable sequence can be determined, so that the rotation parameters of each quantum bit can be obtained by reverse calculation. Therefore, a new scheme for determining the rotation parameters of each quantum bit can be designed. Unlike the previous scheme, the rotation parameters of each quantum bit in this scheme are not exactly the same.

[0107] Specifically, in one embodiment, the variance D(x) of the normal distribution can be obtained, and the number of qubits n used to prepare the normal distribution quantum state is set to an odd number. Then the rotation parameter of one of the qubits is set to The two points on the quantum bit are equally distributed. The rotation parameter of the qubit is set to θ2, and the remaining The rotation parameter of the qubit is set to θ3, and Then compare the rotation parameter θ2 qubits with the rotation parameter set to θ3 The probability of these two types of quantum bits collapsing to |0> or |1> is exactly opposite. If we take one of the quantum bits from each group and make it a group, the probability distribution corresponding to this group of quantum bits can also be regarded as approximately evenly distributed. This can be further explained by the above formula:

[0108]

[0109] The rotation parameters θ2 and θ3 are obtained by solving.

[0110] For example, the target normal distribution to be prepared satisfies The variance of the normal distribution can be obtained If the number of qubits used to prepare the target normally distributed quantum state is n=7, which is an odd number, then by calculating and Can get

[0111] Accordingly, the aforementioned performing the θ gate operation corresponding to the rotation parameter on the n qubits in the initial state may include:

[0112] Perform RY(2θ1) gate operation on one of the qubits, and qubits, respectively perform RY(2θ2) gate operations, and the other group qubits, each performing a RY(2θ3) gate operation.

[0113] Specifically, the RY(2θ1) gate operation can be performed on one of the qubits, and the quantum state of the qubit evolves from |0> to Correspondingly, for one of the groups The qubits perform the RY(2θ2) gate operation and get cosθ2|0>+sinθ2|1> quantum states; for another group The RY(2θ3) gate operation is performed on the quantum bits to obtain cosθ3|0>+sinθ3|1> quantum states.

[0114] For example, the rotation parameter in the above example is Then through the RY gate operation corresponding to the above rotation parameters, we can get 1 Quantum states, 3 Quantum states and 3 Then, by summing the quantum states of these 7 qubits and measuring the summed quantum state, we can get Figure 5 The probability distribution fitting diagram of the quantum state is shown in the figure. Among them, the horizontal axis is the sum value, and the vertical axis is the probability of measuring the corresponding sum value. It can be determined that the distribution obeyed by the quantum state is approximately normal distribution. And in the expected value The distribution on both sides is evenly symmetrical.

[0115] In this embodiment, by obtaining the variance D(x) of the normal distribution and setting the number of quantum bits n for preparing the normally distributed quantum state to an odd number, the rotation parameters of each quantum bit can be further set individually, and the RY gate operation corresponding to the respective rotation parameters is performed on each quantum bit, so that a normal distribution with arbitrary variance can be prepared. The method for preparing a normally distributed quantum state provided by the embodiment of this specification can obtain a quantum state representing a normal distribution by applying only one RY gate on each quantum bit used for quantum state preparation, and its basic gate complexity is only O(n) or O(log2N). Moreover, compared with the general algorithm, the effective preparation of the normally distributed quantum state is achieved by using a smaller number of quantum logic gates, which can also save computing resources to a certain extent and improve the efficiency of the preparation process. In addition, the probability distribution of the prepared quantum state is uniform and symmetrical on both sides of the expected value, which improves the preparation accuracy of the normal quantum state distribution, can better simulate the classical random process, and reduce the error of quantum computing.

[0116] Step 204: performing a summation operation on the n quantum bits to obtain the normally distributed quantum state.

[0117] Specifically, the quantum states of n quantum bits can be summed using a constant adder commonly used in quantum computing, and the quantum state obtained by the sum is the normally distributed quantum state that needs to be prepared.

[0118] As an implementation manner of an embodiment of the present invention, the second preset parameter may include an expected value of the normal distribution. Before determining the number n of quantum bits used to prepare the normally distributed quantum state based on the first preset parameter, the method may further include:

[0119] If the expected value is not within the preset interval, a numerical transformation is performed on the expected value so that the transformed expected value is within the preset interval.

[0120] Specifically, because current quantum computers have a limited number of qubits, and the probability distribution of the quantum states of the qubits in this solution conforms to a two-point distribution of |0> and |1>, without numerical transformation, the sum of the quantum states prepared from n qubits can only reach a maximum of n, with a minimum of 0, which clearly cannot satisfy the requirement for preparing an arbitrary normal distribution. Therefore, a preset range of expected values ​​for the normal distribution can be pre-set. This preset range can be determined based on various factors, such as the number of available qubits, the required preparation accuracy, and the computing resource usage, and is not specifically limited here.

[0121] In this embodiment, when the expected value of the normal distribution is obtained, it can be determined whether the expected value is within the preset interval; if so, the corresponding normal distribution quantum state can be directly prepared based on the normal distribution quantum state preparation method provided in the embodiment of the present invention; if not, the expected value can be processed by numerical transformation so that the expected value after the numerical transformation is within the preset interval. For example, the expected value can be scaled, that is, the expected value is multiplied by a coefficient, and / or the expected value can be translated, that is, a constant is added to the expected value, all of which are feasible.

[0122] Accordingly, after performing the summation operation on the n quantum bits, the method may further include:

[0123] A quantum logic gate operation corresponding to the inverse transformation of the numerical transformation is performed on the quantum state obtained by the summation operation.

[0124] Specifically, when the expected value of the normal distribution is not within the preset interval, since the expected value has been numerically transformed before the preparation process, and the expected value of the quantum state obtained by the above-mentioned method for preparing a normally distributed quantum state is the expected value after the numerical transformation, it is necessary to perform an inverse transformation of the numerical transformation on the quantum state obtained by the summation operation to restore the original expected value. Therefore, the quantum state can be subjected to a quantum logic gate operation corresponding to the inverse transformation of the numerical transformation. For example, the quantum logic gate corresponding to the quantum multiplier or quantum adder can be applied to the quantum bit storing the quantum state, thereby converting the expected value of the probability distribution corresponding to the quantum state into the expected value of the original normally distributed distribution.

[0125] In some embodiments, the normally distributed quantum state can be used to simulate the probability distribution of asset price fluctuations; wherein, the multiple states included in the normally distributed quantum state can represent multiple asset price fluctuations; the determined state obtained after measurement of n quantum bits in the normally distributed quantum state can represent a simulated asset price fluctuation.

[0126] In some cases, since the normal distribution has the characteristic of no memory, this characteristic is consistent with the characteristics of asset price fluctuations, that is, future price changes are not affected by past price changes. Therefore, the normally distributed quantum state prepared in this embodiment can be used as a probability density model of price changes to simulate the probability distribution of asset price fluctuations.

[0127] In this embodiment, for the n quantum bits, the normal distribution quantum state obtained by the normal distribution quantum state preparation process may include 2 nstates and their corresponding probabilities, and further, can represent multiple possible values ​​of price fluctuations and their corresponding probabilities. The determined state obtained by performing a single measurement on n qubits in the normally distributed quantum state can represent the value of the random fluctuation of the asset price that obeys the normal probability distribution under this measurement. Specifically, for example, for a normally distributed quantum state prepared by 3 qubits, the determined state obtained by a single measurement is |010>, then the asset price fluctuation represented by the state |010> can be used as the result data of this measurement. It can be understood that by performing multiple measurements on the n qubits in the normally distributed quantum state, the result data representing the asset price fluctuation under multiple measurements can be obtained as the result of multiple random values ​​of the random change of the asset price that obeys the normal distribution.

[0128] See also Figure 6 , Figure 6 An embodiment of the present invention provides a device for preparing a normal distribution quantum state, the device comprising:

[0129] An acquisition module 601 is configured to acquire a first preset parameter and a second preset parameter; wherein the first preset parameter is used to represent the preparation accuracy of the normally distributed quantum state, and the second preset parameter is used to represent the distribution law of the normally distributed quantum state;

[0130] A determination module 602 is configured to determine the number n of quantum bits used to prepare the normally distributed quantum state based on the first preset parameter;

[0131] a rotation module 603, configured to determine a rotation parameter of each of the qubits based on the second preset parameter, and perform an RY gate operation corresponding to the rotation parameter on each of the n qubits in the initial state;

[0132] The summing module 604 is configured to perform a summing operation on the n quantum bits to obtain the normally distributed quantum state.

[0133] Regarding the specific functions and effects achieved by the normal distribution quantum state preparation device, please refer to the other embodiments of this specification for reference and explanation, and will not be repeated here. The various modules in the normal distribution quantum state preparation device can be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0134] See also Figure 7The embodiment of this specification also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the normal distribution quantum state preparation method in any of the above embodiments when executing the computer program. Figure 7 The computer device may be a classical computer or a quantum computer.

[0135] The embodiments of this specification also provide a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a computer, the computer executes the method for preparing a normally distributed quantum state in any of the above embodiments.

[0136] The embodiments of this specification also provide a computer program product comprising instructions, which, when executed by a computer, causes the computer to execute the method for preparing a normally distributed quantum state in any of the above embodiments.

[0137] It should be understood that the specific examples in this specification are only intended to help those skilled in the art better understand the implementation methods of this specification, rather than to limit the scope of the present invention.

[0138] It can be understood that in the various implementations of this specification, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the implementation methods of this specification.

[0139] It can be understood that the various embodiments described in this specification can be implemented individually or in combination, and the embodiments in this specification are not limited to this.

[0140] Unless otherwise indicated, all technical and scientific terms used in the embodiments of this specification have the same meaning as those commonly understood by those skilled in the art in the technical field of this specification. The terms used in this specification are only for the purpose of describing specific embodiments and are not intended to limit the scope of this specification. The term "and / or" used in this specification includes any and all combinations of one or more related listed items. The singular forms "a", "above", and "the" used in the embodiments of this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise.

[0141] It is understood that the processor in the embodiments of this specification can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method embodiment can be completed by hardware integrated logic circuits in the processor or software instructions. The above processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of this specification can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this specification can be directly implemented as being executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0142] It will be understood that the memory in the embodiments of this specification may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0143] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this specification.

[0144] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, devices and units can refer to the corresponding processes in the aforementioned method implementation methods and will not be repeated here.

[0145] In the several embodiments provided in this specification, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0146] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of this embodiment.

[0147] In addition, each functional unit in each embodiment of this specification may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0148] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this specification, or the part that contributes to the prior art, or the part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of this specification. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0149] The above description is merely a specific embodiment of this specification, but the scope of protection of the present invention is not limited thereto. Any modifications or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this specification should be included within the scope of protection of this specification. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A method for preparing a normally distributed quantum state, characterized in that: The method comprises: Obtaining a first preset parameter and a second preset parameter; wherein the first preset parameter is used to represent the preparation accuracy of the normally distributed quantum state, and the second preset parameter is used to represent the distribution law of the normally distributed quantum state; Determining the number of quantum bits used to prepare the normally distributed quantum state based on the first preset parameter ; The first preset parameter includes the preparation accuracy of the normal distribution quantum state , the preparation precision With the number of qubits 2 Powers are reciprocals of each other; Determine the rotation parameter of each quantum bit based on the second preset parameter, and The quantum bits respectively execute the rotation parameters corresponding to Door operation; right The summation operation is performed on each of the quantum bits to obtain the normally distributed quantum state.

2. The method according to claim 1, wherein The second preset parameter includes the expected value of the normal distribution, and the number of quantum bits used to prepare the normal distribution quantum state is determined based on the first preset parameter. Previously, the method also included: If the expected value is not within the preset interval, a numerical transformation is performed on the expected value so that the transformed expected value is within the preset interval.

3. The method according to claim 2, wherein In the pair After the quantum bits perform the summation operation, the method further includes: A quantum logic gate operation corresponding to the inverse transformation of the numerical transformation is performed on the quantum state obtained by the summation operation.

4. The method according to claim 1, wherein The second preset parameter includes the expected value of the normal distribution , determining the rotation parameter of each of the qubits based on the second preset parameter includes: Based on the expected value and the number of qubits , determine the rotation parameters of each of the quantum bits ; Wherein, the rotation parameter Satisfies the following formula: 。 5. The method according to claim 4, wherein The pair is in the initial state The quantum bits respectively execute the rotation parameters corresponding to Door operations, including: For each qubit in the initial state, execute Door operation.

6. The method according to claim 1, wherein The second preset parameter includes the variance of the normal distribution , the number of qubits is an odd number, and determining the rotation parameter of each of the quantum bits based on the second preset parameter includes: The rotation parameter of one of the qubits is set to ,in addition The rotation parameters of half of the qubits are set to ,in addition The rotation parameters of the other half of the qubits are set to ; Wherein, the rotation parameter 、 as well as Satisfies the following formula: 。 7. The method according to claim 6, wherein The pair is in the initial state The quantum bits respectively execute the rotation parameters corresponding to Door operations, including: Execute on one of the qubits Door operation, for one group qubits, respectively, Door operation, to another group qubits, respectively, Door operation.

8. A device for preparing a normal distribution quantum state, characterized in that: The device comprises: An acquisition module, configured to acquire a first preset parameter and a second preset parameter; wherein the first preset parameter is used to represent the preparation accuracy of the normally distributed quantum state, and the second preset parameter is used to represent the distribution law of the normally distributed quantum state; A determination module for determining the number of quantum bits used to prepare the normally distributed quantum state based on the first preset parameter ; The first preset parameter includes the preparation accuracy of the normal distribution quantum state , the preparation precision With the number of qubits 2 Powers are reciprocals of each other; A rotation module is used to determine the rotation parameters of each of the quantum bits based on the second preset parameters, and to rotate the quantum bits in the initial state. The quantum bits respectively execute the rotation parameters corresponding to Door operation; Summation module, used to The summation operation is performed on each of the quantum bits to obtain the normally distributed quantum state.

9. A storage medium, characterized in that: The storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 7 when executed.

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 perform the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Data processing method and device, equipment and storage medium

    CN114723317A

  • Exponential distribution quantum state preparation method and device, computer equipment and storage medium

    CN116757292A