A method, device, storage medium and electronic device for processing data modulus operation tasks

By using phase rotation logic gates to perform data analog-digital operations on the phase of quantum states and using only one auxiliary qubit, the problem of excessive resource occupation in integer analog-digital operations is solved, and efficient resource utilization is achieved.

CN116720587BActive Publication Date: 2025-08-12ORIGIN QUANTUM COMPUTING TECH (HEFEI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310623040.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-29
Publication Date
2025-08-12
Estimated Expiration
2043-05-29

Smart Images

  • Figure CN116720587B_ABST
    Figure CN116720587B_ABST
Patent Text Reader

Abstract

This application discloses a method, device, storage medium, and electronic device for processing data modulo operation tasks, relating to the field of quantum computing technology. The method includes: receiving target data and a quantum modulo operation circuit sent by a classical processing unit, wherein the quantum modulo operation circuit is determined based on a phase rotation logic gate, and the parameters of the phase rotation logic gate are determined based on the input modulo; exciting a data qubit to a quantum state corresponding to the target data; evolving the quantum state corresponding to the target data and the quantum state of an auxiliary qubit based on the quantum modulo operation circuit; and feeding back the evolved quantum state of the data qubit to the classical processing unit, so that the classical processing unit determines the modulo operation result based on the evolved quantum state of the data qubit. This can save resources used by the quantum computer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of quantum computing technology, and in particular relates to a method, device, storage medium and electronic device for processing data modular arithmetic tasks. Background Art

[0002] A quantum computer is a physical device that follows the laws of quantum mechanics to perform high-speed mathematical and logical operations, and to store and process quantum information. When a device processes and calculates quantum information and runs quantum algorithms, it is considered a quantum computer. Quantum computers are a key technology under research because they can handle mathematical problems more efficiently than conventional computers. For example, they can reduce the time required to crack RSA keys from hundreds of years to just hours.

[0003] Implementing integer modulo operations in a quantum computer requires not only quantum bits for encoding data, but also multiple auxiliary quantum bits for storing carry information. However, the number of quantum bits that a quantum computer can provide is limited. The existing integer modulo operations require the use of more auxiliary quantum bits, which takes up more computing resources of the quantum computer. Summary of the Invention

[0004] The purpose of this application is to provide a method, device, storage medium and electronic device for processing data modular operation tasks, aiming to save resources occupied by quantum computers.

[0005] To achieve the above-mentioned objectives, a first aspect of an embodiment of the present application provides a method for processing a data modulus operation task, which is applied to a quantum processing unit. The data modulus operation task is a task of performing a modulus operation on target data. The method comprises:

[0006] receiving the target data and a quantum modulus operation circuit sent by a classical processing unit, wherein the quantum modulus operation circuit is determined based on a phase rotation logic gate, and a parameter of the phase rotation logic gate is determined based on an input modulus;

[0007] Exciting the data qubit to a quantum state corresponding to the target data;

[0008] Evolving the quantum state corresponding to the target data and the quantum state of the auxiliary quantum bit based on the quantum modular operation circuit;

[0009] The evolved quantum state of the data qubit is fed back to the classical processing unit, so that the classical processing unit determines a modular operation result according to the evolved quantum state of the data qubit.

[0010] Optionally, the phase rotation logic gate includes an uncontrolled phase rotation logic gate; the quantum modular operation circuit includes a quantum Fourier transform unit that acts on the auxiliary quantum bit and the data quantum bit in sequence, the uncontrolled phase rotation logic gate and the quantum inverse Fourier transform unit that act on the data quantum bit and the auxiliary quantum bit.

[0011] Optionally, the phase rotation logic gate also includes a controlled phase rotation logic gate; the quantum modular operation circuit also includes a quantum Fourier transform unit that acts on the data quantum bit in sequence, the controlled phase rotation logic gate that acts on the data quantum bit and the auxiliary quantum bit, and a quantum Fourier inverse transform unit that acts on the data quantum bit; the control bit of the controlled phase rotation logic gate is the auxiliary quantum bit, and the target bit is the data quantum bit.

[0012] Optionally, the quantum modulus operation circuit is a quantum modulus operation circuit, the target data is one, the parameters of the uncontrolled phase rotation logic gate are determined according to the negative number of the input modulus, and the parameters of the controlled phase rotation logic gate are determined according to the modulus.

[0013] Optionally, the quantum modular operation circuit is a quantum modular addition operation circuit, the target data is two, the parameter of the uncontrolled phase rotation logic gate is the difference between one of the target data and the input modulus, and the parameter of the controlled phase rotation logic gate is the modulus.

[0014] Optionally, the Fourier transform unit acts on the data qubit and the auxiliary qubit to obtain a quantum state in the form of a Fourier product, and the product term corresponding to each data qubit is The product term corresponding to the auxiliary quantum bit is

[0015] Among them, 0.0x and 0.x indicate that the quantum state amplitude of the target data x is stored in the phase index of e, n represents the number of data quantum bits, and the value range of m is: [1, n].

[0016] Optionally, the quantum modular addition operation circuit also includes a Fourier transform unit, an uncontrolled phase rotation logic gate and a quantum Fourier inverse transform unit that act on the data quantum bit and the auxiliary quantum bit in sequence, a Fourier transform unit, an uncontrolled phase rotation logic gate and a quantum Fourier inverse transform unit that act on the data quantum bit in sequence, and an X gate that acts on the auxiliary quantum bit.

[0017] A second aspect of the embodiments of the present application further provides a method for processing a data modulus operation task, the method being applied to a classic processing unit, the method comprising:

[0018] Acquire a data modulus operation task, wherein the data modulus operation task is a task of performing a modulus operation on target data;

[0019] Determining a quantum modulus operation circuit based on a phase rotation logic gate, wherein parameters of the phase rotation logic gate are determined based on an input modulus;

[0020] Sending the quantum modular operation circuit and the target data to the quantum processing unit so that the quantum processing unit excites the data qubit to a quantum state corresponding to the target data; evolving the quantum state corresponding to the target data and the quantum state of the auxiliary qubit based on the quantum modular operation circuit;

[0021] Receive the quantum state of the data quantum bit after evolution fed back by the quantum processing unit, and determine the modular operation result according to the quantum state of the data quantum bit after evolution.

[0022] According to a third aspect of the present application, a device for processing a data modulus operation task is provided, which is applied to a quantum processing unit. The data modulus operation task is a task of performing a modulus operation on target data. The device includes:

[0023] a receiving module, configured to receive the target data and a quantum modulus operation circuit sent by a classical processing unit, wherein the quantum modulus operation circuit is determined based on a phase rotation logic gate, and a parameter of the phase rotation logic gate is determined based on an input modulus;

[0024] An excitation module, configured to excite the data qubit to a quantum state corresponding to the target data;

[0025] An evolution module, configured to evolve the quantum state corresponding to the target data and the quantum state of the auxiliary quantum bit based on the quantum modular operation circuit;

[0026] A feedback module is used to feed back the evolved quantum state of the data qubit to the classical processing unit, so that the classical processing unit determines the modular operation result according to the evolved quantum state of the data qubit.

[0027] According to a fourth aspect of the present application, a device for processing a data modulus operation task is provided. The device is applied to a classic processing unit and includes:

[0028] An acquisition module is used to acquire a data modulus operation task, wherein the data modulus operation task is a task of performing a modulus operation on target data;

[0029] a determination module, configured to determine a quantum modulus operation circuit based on a phase rotation logic gate, wherein parameters of the phase rotation logic gate are determined based on an input modulus;

[0030] a sending module, configured to send the quantum modular operation circuit and the target data to the quantum processing unit, so that the quantum processing unit excites the data qubit to the quantum state corresponding to the target data; and evolve the quantum state corresponding to the target data and the quantum state of the auxiliary qubit based on the quantum modular operation circuit;

[0031] The determination module is further configured to receive feedback from the quantum processing unit on the evolved quantum state of the data quantum bit, and determine a modular operation result based on the evolved quantum state of the data quantum bit.

[0032] According to a fifth aspect of an embodiment of the present application, a storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the methods described in the first aspect when run.

[0033] According to a sixth aspect of an embodiment of the present application, an electronic device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps of any one of the methods described in the first aspect above.

[0034] Based on the above technical solution, by receiving the target data and the quantum modulus operation circuit sent by the classical processing unit, the quantum modulus operation circuit is determined based on the phase rotation logic gate, and the parameters of the phase rotation logic gate are determined based on the input modulus; the data quantum bit is excited to the quantum state corresponding to the target data; the quantum state corresponding to the target data and the quantum state of the auxiliary quantum bit are evolved based on the quantum modulus operation circuit; the evolved quantum state of the data quantum bit is fed back to the classical processing unit, so that the classical processing unit determines the modulus operation result according to the evolved quantum state of the data quantum bit. Compared with the use of multiple auxiliary quantum bits to store carry information in the prior art, the processing method of the data modulus operation task provided by the present application realizes modulus calculation on the phase of the quantum state through the phase rotation logic gate. Multiple auxiliary quantum bits are not required to store carry information. Only one auxiliary quantum bit is used, saving the computing resources of the quantum computer. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 is a hardware structure block diagram of a computer terminal illustrating a method for processing a data modulus operation task according to an exemplary embodiment;

[0036] Figure 2 is a flowchart of a method for processing a data modulus operation task according to an exemplary embodiment;

[0037] Figure 3 is an exemplary schematic diagram of a quantum modular operation circuit according to an exemplary embodiment;

[0038] Figure 4 is an exemplary schematic diagram of a quantum modular addition operation circuit according to an exemplary embodiment;

[0039] Figure 5 is an exemplary schematic diagram of another quantum modular addition operation circuit according to an exemplary embodiment;

[0040] Figure 6 is a flow chart of another method for processing a data modulus operation task according to an exemplary embodiment;

[0041] Figure 7 is a block diagram of a device for processing a data modulus operation task according to an exemplary embodiment;

[0042] Figure 8 It is a block diagram of another device for processing data modulus operation tasks according to an exemplary embodiment. DETAILED DESCRIPTION

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

[0044] The embodiment of the present application first provides a method for processing data modulus operation tasks, which can be applied to electronic devices such as computer terminals, specifically ordinary computers, quantum computers, etc.

[0045] The following describes it in detail by taking running on a computer terminal as an example. Figure 1 This is a system network block diagram of a method for processing data modulo arithmetic tasks provided in an embodiment of the present application. The system used for processing data modulo arithmetic tasks may include a network 110, a server 120, a wireless device 130, a client 140, a storage unit 150, a classical processing unit 160, a quantum processing unit 170, and may also include additional memory, classical processors, quantum processors, and other devices not shown.

[0046] The network 110 is a medium that provides a communication link between various devices and computers connected together within a system network of a processing method for data analog-to-digital operation tasks, including but not limited to the Internet, corporate intranets, local area networks, mobile communication networks and combinations thereof. The connection method can be wired, wireless communication links or optical fiber cables, etc.

[0047] Server 120 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.

[0048] The classical processing unit 160 (quantum processing unit 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 162 (application 173). The application 162 (application 173) may be used to implement a quantum algorithm compiled according to the processing method for the data modulus operation task provided in the embodiment of the present application.

[0049] Any data or information stored or generated in the classical processing unit 160 (quantum processing 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.

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

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

[0052] In a classic silicon chip-based processing unit 160, the units of the classic processor 161 are CMOS transistors. These computing units are not constrained by time or coherence, meaning they are available at any time, regardless of their duration of use. Furthermore, the number of these computing units is plentiful within a silicon chip, with a typical classic processor currently containing tens of thousands of them. This abundance of computing units and the fixed selectable computational logic of CMOS transistors, such as AND logic, allow computational efficiency to be achieved through the combination of a large number of CMOS transistors with limited logical functions.

[0053] Unlike the logic unit in the classical processing unit 160, the basic computing unit of the quantum processor 171 in the quantum processing unit 170 is a 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 use 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 logic function configured on demand. Given that the number of qubits is limited, and the logic 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 in combination with a variety of logic functions to achieve the computing effect.

[0054] Based on these differences, the design of the logical functions acting on quantum bits (including the design of whether the quantum bits are used or not and the design of the efficiency of the use of each quantum bit) is the key to improving the computing performance of quantum computers and requires special design. The above-mentioned design for quantum bits is a technical problem that ordinary computing devices do not need to consider or face. Based on this, in order to realize the processing of data modulus operation tasks in quantum computing, this application proposes a method, device, storage medium and electronic device for processing data modulus operation tasks, aiming to reduce the resource occupation of quantum computers.

[0055] See also Figure 2 , Figure 2 This is a flow chart of a method for processing a data modulus operation task according to an exemplary embodiment, which is applied to a quantum processing unit. The data modulus operation task is a task of performing a modulus operation on target data. The method includes:

[0056] S201. Receive target data and quantum modular operation circuit sent by a classical processing unit.

[0057] In an embodiment of the present application, the data modulus operation task can be a data modulus operation task in a variety of scenarios, such as quantum encryption scenarios and quantum finance scenarios.

[0058] The quantum modulus arithmetic circuit is based on a phase rotation logic gate whose parameters are determined based on the input modulus. The target data is less than twice the modulus and can be an integer or quantum state data.

[0059] S202. Excite the data quantum bit to the quantum state corresponding to the target data.

[0060] In an embodiment of the present application, after the quantum computing unit receives the target data and the quantum modulus operation circuit sent by the classical processing unit, it will generate a corresponding analog signal based on the quantum logic gate included in the quantum modulus operation circuit and the target data. The generated analog signal will act on the data quantum bit, so that the data quantum bit is excited to the quantum state corresponding to the target data.

[0061] S203. Evolving the quantum state corresponding to the target data and the quantum state of the auxiliary quantum bit based on the quantum modular operation circuit.

[0062] S204. Feedback the evolved quantum state of the data qubit to the classical processing unit, so that the classical processing unit determines the modular operation result according to the evolved quantum state of the data qubit.

[0063] According to an embodiment of the present application, target data and a quantum modulus operation circuit sent by a classical processing unit are received, and the quantum modulus operation circuit is determined based on a phase rotation logic gate, and the parameters of the phase rotation logic gate are determined based on the input modulus; the data qubit is excited to the quantum state corresponding to the target data; the quantum state corresponding to the target data and the quantum state of the auxiliary qubit are evolved based on the quantum modulus operation circuit; the evolved quantum state of the data qubit is fed back to the classical processing unit, so that the classical processing unit determines the modulus operation result according to the evolved quantum state of the data qubit. Compared with the prior art that uses multiple auxiliary qubits to store carry information, the method for processing data modulus operation tasks provided by the present application realizes modulus calculation on the phase of the quantum state through a phase rotation logic gate. Multiple auxiliary qubits are not required to store carry information, and only one auxiliary qubit is used, thereby saving computing resources of the quantum computer.

[0064] In another embodiment of the present application, the above-mentioned phase rotation logic gate includes an uncontrolled phase rotation logic gate; the quantum modular operation circuit includes a quantum Fourier transform unit that acts on the auxiliary quantum bit and the data quantum bit in sequence, the uncontrolled phase rotation logic gate and the quantum inverse Fourier transform unit that act on the data quantum bit and the auxiliary quantum bit.

[0065] In the embodiments of the present application, the Fourier transform unit acts on the data qubits and the auxiliary qubits to perform quantum state evolution, obtaining a quantum state in the form of a Fourier product, that is, converting the quantum state corresponding to the target data and the quantum state of the auxiliary qubits into a quantum state in the form of a Fourier product.

[0066] For example, the quantum state of the auxiliary qubit is |0>. Suppose the quantum state corresponding to the target data is |x> = |x1x2...x n >, and the conversion formula for converting |0x> into a quantum state in the form of a Fourier product is:

[0067]

[0068] The product term corresponding to each data qubit is The product term corresponding to the auxiliary qubit is

[0069] where 0.0x and 0.x represent storing the quantum state amplitude of the target data x on the phase exponent of e, n represents the number of data qubits, and the value range of m is: [1, n].

[0070] When the uncontrolled phase rotation logic gate determined according to the input modulus acts on the data qubits and the auxiliary qubits, it is equivalent to subtracting the modulus from the phase of each product term of the above-mentioned quantum state in the form of a Fourier product. Furthermore, when the inverse quantum Fourier transform unit acts on the data qubits and the auxiliary qubits, the quantum state of the difference between the target data and the modulus can be obtained.

[0071] Among them, the parameters of the uncontrolled phase rotation logic gate can be determined according to the opposite number of the input modulus.

[0072] Suppose the modulus is M, then the parameters of the uncontrolled phase rotation logic gate can be determined according to the opposite number of the modulus as where n represents the number of excited data qubits, k represents that the phase rotation logic gate acts on the k-th qubit, and the following calculation can be realized for the above-mentioned quantum state in the form of a Fourier product:

[0073]

[0074] Using the inverse quantum Fourier transform for the above result, when x≥M, the quantum state of the auxiliary qubit is the 0 state, and when x<M, the quantum state of the auxiliary qubit is the 1 state. The quantum states of the first n data qubits are:

[0075]

[0076] Since the target data in the embodiment of the present application is less than 2 times the modulus, when the target data is greater than the modulus, the quantum state of the difference between the target data and the modulus is obtained through the evolution of the quantum modulus operation circuit, which is equivalent to obtaining the modulus result. However, when the target data is less than the modulus, the modulus result cannot be obtained through the difference between the target data and the modulus.

[0077] For example, if the target data is 3 and the modulus is 5, then 3-5=-2, and 3mod5=3.

[0078] Therefore, in order to solve the problem that when the target data is smaller than the modulus, the modulus result cannot be obtained according to the difference between the target data and the modulus, in another embodiment of the present application, the phase rotation logic gate also includes a controlled phase rotation logic gate; the quantum modulus operation circuit also includes a quantum Fourier transform unit that acts on the data quantum bit in sequence, a controlled phase rotation logic gate that acts on the data quantum bit and the auxiliary quantum bit, and a quantum Fourier inverse transform unit that acts on the data quantum bit; the control bit of the controlled phase rotation logic gate is the auxiliary quantum bit, and the target bit is the data quantum bit.

[0079] Among them, applying the controlled phase rotation logic gate to the data quantum bit can be specifically implemented as follows: if the evolved quantum state of the auxiliary quantum bit is state 1, applying the phase rotation logic gate to the data quantum bit.

[0080] In an embodiment of the present application, the size relationship between the target data and the modulus can be determined based on the quantum state after the auxiliary quantum bit evolves.

[0081] If the quantum state of the auxiliary quantum bit after evolution is state 0, it is determined that the target data is greater than or equal to the modulus.

[0082] If the quantum state of the auxiliary quantum bit after evolution is 1, it is determined that the target data is smaller than the modulus.

[0083] The controlled phase rotation logic gate is controlled by the evolved quantum state of the auxiliary quantum bit, and the parameters of the controlled phase rotation logic gate are determined according to the modulus.

[0084] Assuming the modulus is M, the parameters of the controlled phase rotation logic gate are

[0085] When the target data is smaller than the modulus, by applying a controlled phase rotation logic gate to the data quantum bit, it is equivalent to adding the subtracted modulus to the phase of the quantum state in the form of Fourier product to obtain the quantum state corresponding to the target data.

[0086] That is, for the quantum state of the first n data qubits mentioned above: Adding M, we get:

[0087] Performing a quantum inverse Fourier transform on the result can get the modulus result:

[0088] |0>|xM> x≥M +|1>|x> x<M .

[0089] It is understood that in the embodiment of the present application, the target data is less than 2 times the modulus. When the target data is less than the modulus, the modulus result of the target data and the modulus is numerically equal to the target data. When the target data is greater than or equal to the modulus, the modulus result of the target data and the modulus is numerically equal to the difference between the target data and the modulus.

[0090] Therefore, after the above-mentioned quantum inverse Fourier transform acts on the data quantum bit, the quantum processing unit can feed back the evolved quantum state of the data quantum bit to the classical processing unit, and the classical processing unit can obtain the modular operation result based on the evolved quantum state of the data quantum bit.

[0091] The quantum modulus operation circuit in the above embodiment is a modulus operation circuit, the target data is one, the parameters of the uncontrolled phase rotation logic gate are determined according to the inverse of the input modulus, and the parameters of the controlled phase rotation logic gate are determined according to the modulus.

[0092] In another embodiment of the present application, the quantum modulus operation circuit provided in the embodiment of the present application can also realize modular addition operation. The quantum modulus operation circuit is a modular addition operation circuit. There are two target data. The parameter of the uncontrolled phase rotation logic gate is the difference between one of the target data and the input modulus, and the parameter of the controlled phase rotation logic gate is the modulus.

[0093] Assume that the target data are integers a and x, the modulus is M, and the data qubit is excited to the quantum state corresponding to the target data x. Then the parameters of the uncontrolled phase rotation logic gate are The parameters of the controlled phase rotation logic gate controlled by the quantum state after the evolution of the auxiliary quantum bit are This allows the modular addition operation to be performed: (a+c) mod M.

[0094] like Figure 3 As shown, Figure 3 This is an exemplary schematic diagram of a quantum modular operation circuit provided in an embodiment of the present application. Figure 3The quantum modular operation circuit shown includes a quantum state of |0> and an auxiliary quantum bit, as well as n data quantum bits excited to the quantum state corresponding to the target data x, and also includes a quantum Fourier transform unit (Quantum Fourier Transform, QFT), an uncontrolled phase rotation logic gate U(aM) and a quantum Fourier inverse transform unit that act on the n data quantum bits and the auxiliary quantum bits in sequence, and also includes a quantum Fourier transform unit, a controlled phase rotation logic gate U(M) and a quantum Fourier inverse transform unit that act on the data quantum bits in sequence.

[0095] In another embodiment of the present application, in order to restore the quantum state of the auxiliary quantum bit so that the auxiliary quantum bit can be used repeatedly, the above-mentioned quantum modular addition operation circuit also includes a Fourier transform unit, an uncontrolled phase rotation logic gate and a quantum Fourier inverse transform unit that act on the data quantum bit and the auxiliary quantum bit in sequence, a Fourier transform unit, an uncontrolled phase rotation logic gate and a quantum Fourier inverse transform unit that act on the data quantum bit in sequence, and an X gate that acts on the auxiliary quantum bit.

[0096] like Figure 4 As shown, Figure 4 A quantum modular addition circuit is provided in the embodiment of the present application. Figure 3 On the basis of Figure 4 The quantum modular addition circuit shown also includes a Fourier transform unit, an uncontrolled phase rotation logic gate, and a quantum Fourier inverse transform unit that act on the data quantum bit and the auxiliary quantum bit in sequence, a Fourier transform unit, an uncontrolled phase rotation logic gate, and a quantum Fourier inverse transform unit that act on the data quantum bit in sequence, and an X gate that acts on the auxiliary quantum bit, which can restore the quantum state of the auxiliary quantum bit. Figure 4 The parameters of the two uncontrolled phase rotation logic gates shown are determined according to the negative of the modulus and the modulus, respectively.

[0097] It is understandable that through Figure 3 The quantum modular addition circuit shown can obtain the following calculation results:

[0098] |0>|x-M+a> x+a≥M +|1>|x+a> x+a<M

[0099]

[0100] When the value range of x is [0, M), Figure 4 The quantum modular addition circuit can Figure 3 The calculation results are calculated as follows:

[0101] First of all, Figure 3Add -a to the result and you get:

[0102]

[0103] After performing the inverse quantum Fourier transform, we can obtain:

[0104]

[0105] Then use the X gate on the auxiliary qubit to get:

[0106]

[0107] Re-add a to the quantum state of the first n data qubits and perform an inverse quantum Fourier transform to obtain:

[0108] |0>|x-M+a> x+a≥M +|0>|x+a> x+a<M

[0109] The above calculation process can restore the quantum state of the auxiliary quantum bit, so that the auxiliary quantum bit can be reused.

[0110] In another embodiment of the present application, the quantum modular operation circuit includes two auxiliary quantum bits.

[0111] like Figure 5 As shown, Figure 5 Another quantum modular addition circuit provided in the embodiment of the present application is: Figure 5 The ADD module shown includes the quantum Fourier transform unit, the uncontrolled phase rotation logic gate or the controlled phase rotation logic gate and the quantum Fourier inverse transform unit in the above embodiment. Figure 3 and Figure 4 The quantum modular operation circuit shown, Figure 5 The quantum modular addition circuit shown includes two auxiliary quantum bits. It is not necessary to limit the input x to the range [0, M), and the quantum state of one of the auxiliary quantum bits can be restored to the 0 state.

[0112] The present application also provides a method for processing data modulus operation tasks, which is applied to a classic processing unit, such as Figure 6 As shown, the method includes:

[0113] S601: Obtain data modulus operation task.

[0114] Among them, the data modulus operation task is a task of performing a modulus operation on the target data.

[0115] S602: Determine a quantum modular operation circuit based on a phase rotation logic gate.

[0116] The parameters of the phase rotation logic gate are determined based on the input modulus. The specific method for determining the parameters of the phase rotation logic gate can refer to the relevant description in the above embodiment and will not be repeated here.

[0117] S603. Send a quantum modular operation circuit and target data to the quantum processing unit, so that the quantum processing unit excites the data qubit to a quantum state corresponding to the target data; and evolve the quantum state corresponding to the target data and the quantum state of the auxiliary qubit based on the quantum modular operation circuit.

[0118] S604: Receive the quantum state of the evolved data qubit fed back by the quantum processing unit, and determine the modular operation result according to the quantum state of the evolved data qubit.

[0119] In the embodiments of the present application, a classical processing unit receives a data modulo operation task and determines a quantum modulo operation circuit based on a phase rotation logic gate, where the parameters of the phase rotation logic gate are determined based on the input modulo. The quantum modulo operation circuit and target data are sent to the quantum processing unit, causing the quantum processing unit to excite the data qubit to the quantum state corresponding to the target data. The quantum modulo operation circuit evolves the quantum state corresponding to the target data and the quantum state of the auxiliary qubit, receives feedback from the quantum processing unit on the evolved quantum state of the data qubit, and determines the modulo operation result based on the evolved quantum state of the data qubit. Compared to the prior art method of using multiple auxiliary qubits to store carry information, the method for processing data modulo operation tasks provided by the present application uses a phase rotation logic gate to implement modulo calculation on the phase of the quantum state. This eliminates the need for multiple auxiliary qubits to store carry information, and only uses a single auxiliary qubit, thus saving the computing resources of the quantum computer.

[0120] Based on the same inventive concept, the embodiment of the present application also provides a data modulus operation task processing device, which is applied to a quantum processing unit. The data modulus operation task is a task of performing a modulus operation on target data, such as Figure 7 As shown, the device includes:

[0121] A receiving module 701 is configured to receive target data and a quantum modulus operation circuit sent by a classical processing unit, wherein the quantum modulus operation circuit is determined based on a phase rotation logic gate, and a parameter of the phase rotation logic gate is determined based on an input modulus;

[0122] An excitation module 702 is used to excite the data qubit to a quantum state corresponding to the target data;

[0123] An evolution module 703 is configured to evolve the quantum state corresponding to the target data and the quantum state of the auxiliary qubit based on the quantum modular operation circuit;

[0124] The feedback module 704 is used to feed back the evolved quantum state of the data qubit to the classical processing unit, so that the classical processing unit determines the modular operation result according to the evolved quantum state of the data qubit.

[0125] Optionally, the phase rotation logic gate includes an uncontrolled phase rotation logic gate; the quantum modular operation circuit includes a quantum Fourier transform unit that acts on the auxiliary quantum bit and the data quantum bit in sequence, the uncontrolled phase rotation logic gate and the quantum inverse Fourier transform unit that act on the data quantum bit and the auxiliary quantum bit.

[0126] Optionally, the phase rotation logic gate also includes a controlled phase rotation logic gate; the quantum modular operation circuit also includes a quantum Fourier transform unit that acts on the data quantum bit in sequence, the controlled phase rotation logic gate that acts on the data quantum bit and the auxiliary quantum bit, and a quantum Fourier inverse transform unit that acts on the data quantum bit; the control bit of the controlled phase rotation logic gate is the auxiliary quantum bit, and the target bit is the data quantum bit.

[0127] Optionally, the quantum modulus operation circuit is a quantum modulus operation circuit, the target data is one, the parameters of the uncontrolled phase rotation logic gate are determined according to the negative number of the input modulus, and the parameters of the controlled phase rotation logic gate are determined according to the modulus.

[0128] Optionally, the quantum modular operation circuit is a quantum modular addition operation circuit, the target data is two, the parameter of the uncontrolled phase rotation logic gate is the difference between one of the target data and the input modulus, and the parameter of the controlled phase rotation logic gate is the modulus.

[0129] Optionally, the Fourier transform unit acts on the data qubit and the auxiliary qubit to obtain a quantum state in the form of a Fourier product, and the product term corresponding to each data qubit is The product term corresponding to the auxiliary quantum bit is

[0130] Among them, 0.0x and 0.x indicate that the quantum state amplitude of the target data x is stored in the phase index of e, n represents the number of data quantum bits, and the value range of m is: [1, n].

[0131] Optionally, the quantum modular addition operation circuit also includes a Fourier transform unit, an uncontrolled phase rotation logic gate and a quantum Fourier inverse transform unit that act on the data quantum bit and the auxiliary quantum bit in sequence, a Fourier transform unit, an uncontrolled phase rotation logic gate and a quantum Fourier inverse transform unit that act on the data quantum bit in sequence, and an X gate that acts on the auxiliary quantum bit.

[0132] Based on the same inventive concept, the embodiment of the present application also provides a processing device for data modulus operation tasks, which is applied to a classic processing unit, such as Figure 8 As shown, the device includes:

[0133] An acquisition module 801 is used to acquire a data modulus operation task, where the data modulus operation task is a task of performing a modulus operation on target data;

[0134] A determination module 802 is configured to determine a quantum modulus operation circuit based on a phase rotation logic gate, wherein parameters of the phase rotation logic gate are determined based on an input modulus;

[0135] A sending module 803 is configured to send a quantum modular operation circuit and target data to the quantum processing unit, so that the quantum processing unit excites the data qubit to a quantum state corresponding to the target data; and evolve the quantum state corresponding to the target data and the quantum state of the auxiliary qubit based on the quantum modular operation circuit;

[0136] The determination module 802 is further configured to receive the quantum state of the evolved data qubit fed back by the quantum processing unit, and determine the modular operation result according to the quantum state of the evolved data qubit.

[0137] Regarding the apparatus in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0138] Yet another embodiment of the present application provides a storage medium storing a computer program, wherein the computer program is configured to execute the steps in the embodiment of the processing method for the above-mentioned data modulus operation task when running.

[0139] Specifically, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.

[0140] Another embodiment of the present application further 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 the steps in the embodiment of the processing method for the above-mentioned data modulus operation task.

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

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

[0143] Step 1: Receive target data and quantum modular operation circuit sent by the classical processing unit.

[0144] Step 2: Excite the data quantum bit to the quantum state corresponding to the target data.

[0145] Step 3: Evolve the quantum state corresponding to the target data and the quantum state of the auxiliary quantum bit based on the quantum modular operation circuit.

[0146] Step 4: Feedback the evolved quantum state of the data qubit to the classical processing unit, so that the classical processing unit determines the modular operation result based on the evolved quantum state of the data qubit.

[0147] The above describes in detail the structure, features and effects of the present application based on the embodiments shown in the drawings. The above is only a preferred embodiment of the present application, but the present application does not limit the scope of implementation to what is shown in the drawings. Any changes made in accordance with the concept of the present application, or modifications to equivalent embodiments with equivalent changes, which still do not exceed the spirit covered by the description and drawings, should be within the scope of protection of the present application.

Claims

1. A method for processing a data modulus operation task, characterized in that: Applied to a quantum processing unit, the data modulus operation task is a task of performing a modulus operation on target data; the method includes: receiving the target data and a quantum modulus operation circuit sent by a classical processing unit, wherein the quantum modulus operation circuit comprises at least a quantum Fourier transform unit acting on an auxiliary qubit and a data qubit in sequence, an uncontrolled phase rotation logic gate acting on the data qubit and the auxiliary qubit, and a quantum inverse Fourier transform unit, wherein parameters of the phase rotation logic gate are determined based on an input modulus; Exciting the data qubit to a quantum state corresponding to the target data; Evolving the quantum state corresponding to the target data and the quantum state of the auxiliary quantum bit based on the quantum modular operation circuit; The evolved quantum state of the data qubit is fed back to the classical processing unit, so that the classical processing unit determines a modular operation result according to the evolved quantum state of the data qubit.

2. The method according to claim 1, characterized in that The phase rotation logic gate also includes a controlled phase rotation logic gate; the quantum modular operation circuit also includes a quantum Fourier transform unit that acts on the data quantum bit in sequence, the controlled phase rotation logic gate that acts on the data quantum bit and the auxiliary quantum bit, and a quantum Fourier inverse transform unit that acts on the data quantum bit; the control bit of the controlled phase rotation logic gate is the auxiliary quantum bit, and the target bit is the data quantum bit.

3. The method according to claim 2, characterized in that The quantum modulus operation circuit is a quantum modulus operation circuit, the target data is one, the parameters of the uncontrolled phase rotation logic gate are determined according to the inverse of the input modulus, and the parameters of the controlled phase rotation logic gate are determined according to the modulus.

4. The method according to claim 2, characterized in that The quantum modular operation circuit is a quantum modular addition operation circuit, the target data is two, the parameter of the uncontrolled phase rotation logic gate is the difference between one of the target data and the input modulus, and the parameter of the controlled phase rotation logic gate is the modulus.

5. The method according to claim 1, wherein The Fourier transform unit acts on the data qubit and the auxiliary qubit to obtain a quantum state in the form of a Fourier product. The product term corresponding to each data qubit is , the product term corresponding to the auxiliary quantum bit is ]; Among them, 0.0x and 0.x indicate that the quantum state amplitude of the target data x is stored in the phase index of e, n represents the number of data quantum bits, and the value range of m is: [1, n].

6. The method according to claim 4, characterized in that The quantum modular addition operation circuit also includes a Fourier transform unit, an uncontrolled phase rotation logic gate, and a quantum Fourier inverse transform unit that act on the data quantum bit and the auxiliary quantum bit in sequence, a Fourier transform unit, an uncontrolled phase rotation logic gate, and a quantum Fourier inverse transform unit that act on the data quantum bit in sequence, and an X gate that acts on the auxiliary quantum bit.

7. A method for processing a data modulus operation task, characterized in that: The method is applied to a classic processing unit, and the method comprises: Acquire a data modulus operation task, wherein the data modulus operation task is a task of performing a modulus operation on target data; Determining a quantum modulus operation circuit based on a phase rotation logic gate, wherein parameters of the phase rotation logic gate are determined based on an input modulus, and the quantum modulus operation circuit includes at least a quantum Fourier transform unit that acts on an auxiliary qubit and a data qubit in sequence, an uncontrolled phase rotation logic gate that acts on the data qubit and the auxiliary qubit, and a quantum Fourier inverse transform unit; sending the quantum modular arithmetic circuit and the target data to a quantum processing unit so that the quantum processing unit excites the data qubit to a quantum state corresponding to the target data; evolving the quantum state corresponding to the target data and the quantum state of the auxiliary qubit based on the quantum modular arithmetic circuit; Receive the quantum state of the data quantum bit after evolution fed back by the quantum processing unit, and determine the modular operation result according to the quantum state of the data quantum bit after evolution.

8. A data modulus operation task processing device, characterized in that: Applied to a quantum processing unit, the data modulus operation task is a task of performing a modulus operation on target data, and the device includes: a receiving module, configured to receive the target data and a quantum modulus operation circuit sent by a classical processing unit, wherein the quantum modulus operation circuit is determined based on a phase rotation logic gate, a parameter of which is determined based on an input modulus, and the quantum modulus operation circuit includes at least a quantum Fourier transform unit that acts on an auxiliary qubit and a data qubit in sequence, an uncontrolled phase rotation logic gate that acts on the data qubit and the auxiliary qubit, and a quantum Fourier inverse transform unit; An excitation module, configured to excite the data qubit to a quantum state corresponding to the target data; An evolution module, configured to evolve the quantum state corresponding to the target data and the quantum state of the auxiliary quantum bit based on the quantum modular operation circuit; A feedback module is used to feed back the evolved quantum state of the data qubit to the classical processing unit, so that the classical processing unit determines the modular operation result according to the evolved quantum state of the data qubit.

9. A processing device for data modulus operation tasks, characterized in that: The device is applied to a classic processing unit, and comprises: An acquisition module is used to acquire a data modulus operation task, wherein the data modulus operation task is a task of performing a modulus operation on target data; a determination module, configured to determine a quantum modulus operation circuit based on a phase rotation logic gate, wherein parameters of the phase rotation logic gate are determined based on an input modulus, and the quantum modulus operation circuit includes at least a quantum Fourier transform unit that acts on an auxiliary qubit and a data qubit in sequence, an uncontrolled phase rotation logic gate that acts on the data qubit and the auxiliary qubit, and a quantum Fourier inverse transform unit; a sending module, configured to send the quantum modular operation circuit and the target data to a quantum processing unit, so that the quantum processing unit excites the data qubit to a quantum state corresponding to the target data; and evolve the quantum state corresponding to the target data and the quantum state of the auxiliary qubit based on the quantum modular operation circuit; The determination module is further configured to receive feedback from the quantum processing unit on the evolved quantum state of the data quantum bit, and determine a modular operation result based on the evolved quantum state of the data quantum bit.

10. 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 6 or 7 when executed.

11. 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 6 or 7.

Citation Information

Patent Citations

  • Fast Fourier transform system based on residue number system

    CN102184160A

  • Quantum additive operation method and device, electronic device and storage medium

    CN112162723A