Data decomposition task processing method and apparatus, storage medium, and electronic device
Patent Information
- Application Number
- CN202311117105.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-31
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2043-08-31
AI Technical Summary
[0003]Shor算法是一种用来分解整数的算法,又叫质因数分解算法,目前,对于整数分解是基于GPU或CPU模拟器构建实现shor算法的量子线路,shor算法的量子线路主要是基于基础运算器实现,例如模加运算器和模乘运算器等,所以构建得到的量子线路的线路深度较深,运行效率较低,大规模整数分解效率较低
[0021]基于上述技术方案,通过接收经典处理单元发送的随机数和量子相位估计QPE电路,所述QPE电路的相位旋转逻辑门参数基于所述待分解数据和所述随机数确定,所述随机数基于所述待分解数据确定;将所述QPE电路第一寄存器的量子比特激发至表示所述随机数的第一初始量子态,将所述QPE电路运行第一预设数量次,测量所述QPE电路的第二寄存器的量子比特的最终量子态,得到第一预设数量个测量结果;将所述第一预设数量个测量结果发送到经典处理单元,以使得所述经典处理单元根据所述第一预设数量个测量结果确定所述待分解数据的整数分解结果。本发明通过QPE电路实现对待分解数据进行整数分解运算,QPE电路中不包括模加运算器和模乘运算器等基础运算器,与现有技术相比,本发明提供的数据分解任务处理方法所需的QPE电路深度较浅,运行效率高,提高了大规模整数的分解效率。
Smart Images

Figure CN117075844B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of quantum computing technology, and in particular relates to a method, apparatus, storage medium and electronic device for data decomposition tasks. Background Technology
[0002] A quantum computer is a physical device that performs high-speed mathematical and logical operations, stores and processes quantum information in accordance with the laws of quantum mechanics. When a device processes and computes quantum information and runs quantum algorithms, it is a quantum computer. Because of its ability to process mathematical problems more efficiently than ordinary computers—for example, reducing the time to crack RSA keys from hundreds of years to hours—quantum computers have become a key technology under research.
[0003] Shor's algorithm is an algorithm for factoring integers, also known as prime factorization. Currently, integer factorization is implemented by building quantum circuits for Shor's algorithm based on GPU or CPU simulators. The quantum circuits for Shor's algorithm are mainly based on basic arithmetic units, such as modular addition and modular multiplication units. Therefore, the constructed quantum circuits are deep and have low running efficiency, resulting in low efficiency for large-scale integer factorization. Summary of the Invention
[0004] The purpose of this invention is to provide a method, apparatus, storage medium, and electronic device for processing data decomposition tasks, aiming to improve the efficiency of large-scale integer decomposition.
[0005] To achieve the above objectives, a first aspect of the present invention provides a method for processing a data decomposition task, applied to a quantum processing unit, wherein the data decomposition task is a task of performing integer decomposition on data to be decomposed, comprising:
[0006] The system receives random numbers and a quantum phase estimation (QPE) circuit sent by a classical processing unit. The phase rotation logic gate parameters of the QPE circuit are determined based on the data to be decomposed and the random numbers. The qubits of the first register of the QPE circuit are excited to the first initial quantum state representing the random number. The QPE circuit is run a first preset number of times. The final quantum state of the qubits of the second register of the QPE circuit is measured to obtain a first preset number of measurement results. The first preset number of measurement results are sent to the classical processing unit so that the classical processing unit can determine the integer decomposition result of the data to be decomposed based on the first preset number of measurement results.
[0007] In one possible implementation, the QPE circuit includes n phase-rotation logic gates, and the second register includes n qubits that correspond one-to-one with the n phase-rotation logic gates. The n qubits are used to sequentially control the corresponding phase-rotation logic gates to act on the first register in order from the most significant bit to the least significant bit.
[0008] In one possible implementation, the matrix form of the i-th phase-rotation logic gate is: , , ; in, The parameters of the phase-rotation logic gate are given, and N represents the data to be decomposed. When the random number is not 1, the value of b is equal to the random number. When the random number is 1, b is greater than or equal to 2 and less than N.
[0009] In one possible implementation, the QPE circuit further includes an H gate, which is used to evolve the n qubits in the second register into a second initial quantum state. Each qubit in the second initial quantum state is used to control a corresponding phase rotation logic gate to perform a phase rotation on the qubit in the first initial quantum state.
[0010] In one possible implementation, the QPE circuit further includes a quantum Fourier transform unit, and before measuring the final quantum state of the qubits in the second register of the QPE circuit to obtain a first preset number of measurement results, the following is also included: The quantum state evolution of the qubits in the second register is performed based on the quantum Fourier transform unit.
[0011] In one possible implementation, the random number is coprime to the data to be decomposed, and the random number is greater than or equal to 1 and less than the data to be decomposed.
[0012] A second aspect of this invention provides a method for processing a data decomposition task, applied to a classical processing unit, wherein the data decomposition task is an integer decomposition task of data to be decomposed, and the method includes: Obtain the data decomposition task and determine random numbers based on the data to be decomposed; Based on the data to be decomposed and the random number, determine the parameters of the phase-rotation logic gate of the quantum phase estimation (QPE) circuit, and construct the QPE circuit. The quantum processing unit sends the QPE circuit and the random number to the quantum processing unit so that the quantum processing unit excites the qubits of the first register of the QPE circuit to the first initial quantum state representing the random number, runs the QPE circuit a first preset number of times, measures the final quantum state of the qubits of the second register of the QPE circuit, and obtains a first preset number of measurement results. The quantum processing unit receives the first preset number of measurement results and determines the integer decomposition result of the data to be decomposed based on the first preset number of measurement results.
[0013] In one possible implementation, determining the integer decomposition result of the data to be decomposed based on the first preset number of measurement results includes: From the first preset number of measurement results, select a second preset number of target measurement results according to the probability of the measurement results; Each target measurement result is converted into a decimal number, and the order of the random number in the multiplicative group formed by modulo the data to be decomposed is calculated based on each decimal number.
[0014] The integer decomposition result is obtained by calculating the order of the random number in the multiplicative group formed by modulo the data to be decomposed and the data to be decomposed.
[0015] In one possible implementation, calculating the order of the random number in the multiplicative group formed by modulo the data to be decomposed based on each decimal number includes: The quotient of each decimal number and 2^n is determined as the phase value, thus obtaining the phase value corresponding to each decimal number, where n is the number of qubits included in the second register; Multiply each phase value by the data to be decomposed to obtain the order corresponding to each decimal number.
[0016] In one possible implementation, the step of calculating the integer factorization result based on the order of the random number in the multiplicative group formed by modulo the data to be factored and the data to be factored includes: If the order is even, calculate The greatest common divisor of the sum and the data to be decomposed; if the order is odd, calculate... The greatest common divisor of the data to be decomposed; where, Let be the order corresponding to the m-th decimal number, and a be the random number; Each calculated greatest common divisor is incorporated into the factorization set to obtain the integer factorization result.
[0017] A third aspect of the present invention provides a processing apparatus for a data decomposition task, applied to a quantum processing unit, wherein the data decomposition task is an integer decomposition task of data to be decomposed, and the apparatus includes: A receiving module is used to receive random numbers and quantum phase estimation (QPE) circuits sent by a classical processing unit. The phase rotation logic gate parameters of the QPE circuit are determined based on the data to be decomposed and the random numbers. The running module is used to excite the qubits of the first register of the QPE circuit to the first initial quantum state representing the random number, run the QPE circuit a first preset number of times, measure the final quantum state of the qubits of the second register of the QPE circuit, and obtain a first preset number of measurement results; The sending module is used to send the first preset number of measurement results to the classical processing unit, so that the classical processing unit can determine the integer decomposition result of the data to be decomposed based on the first preset number of measurement results.
[0018] A fourth aspect of the present invention provides a processing apparatus for a data decomposition task, applied to a classical processing unit, wherein the data decomposition task is an integer decomposition task of data to be decomposed, and the apparatus includes: The acquisition module is used to acquire the data decomposition task and determine random numbers based on the data to be decomposed; A construction module is used to determine the parameters of the phase-rotation logic gate of the quantum phase estimation (QPE) circuit based on the data to be decomposed and the random number, and to construct the QPE circuit. The transmitting module is used to transmit the QPE circuit and the random number to the quantum processing unit, so that the quantum processing unit excites the qubits of the first register of the QPE circuit to the first initial quantum state representing the random number, runs the QPE circuit a first preset number of times, measures the final quantum state of the qubits of the second register of the QPE circuit, and obtains a first preset number of measurement results. The determining module is used to receive the first preset number of measurement results sent by the quantum processing unit, and determine the integer decomposition result of the data to be decomposed based on the first preset number of measurement results.
[0019] A fifth aspect of the present invention provides a storage medium storing a computer program, wherein the computer program is configured to execute the steps of the method described in any one of the first or second aspects above when running.
[0020] A sixth aspect of the present invention provides an electronic device including 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 of the method described in any one of the first or second aspects above.
[0021] Based on the above technical solution, the method receives random numbers and a quantum phase estimation (QPE) circuit from a classical processing unit. The phase rotation logic gate parameters of the QPE circuit are determined based on the data to be decomposed and the random numbers, with the random numbers determined based on the data to be decomposed. The qubits of the first register of the QPE circuit are excited to a first initial quantum state representing the random numbers. The QPE circuit is run a first preset number of times, and the final quantum state of the qubits of the second register of the QPE circuit is measured to obtain a first preset number of measurement results. These first preset number of measurement results are sent to the classical processing unit, so that the classical processing unit determines the integer decomposition result of the data to be decomposed based on the first preset number of measurement results. This invention uses a QPE circuit to perform integer decomposition operations on the data to be decomposed. The QPE circuit does not include basic arithmetic units such as modular addition and modular multiplication units. Compared with existing technologies, the data decomposition task processing method provided by this invention requires a shallower QPE circuit, resulting in higher operating efficiency and improved efficiency for large-scale integer decomposition. Attached Figure Description
[0022] Figure 1 This is a hardware structure block diagram of a computer terminal illustrating a data decomposition task processing method according to an exemplary embodiment.
[0023] Figure 2 This is a flowchart illustrating a data decomposition task processing method according to an exemplary embodiment.
[0024] Figure 3 This is a structural diagram of a quantum data decomposition circuit according to an exemplary embodiment.
[0025] Figure 4 This is a structural diagram of another quantum data decomposition circuit according to an exemplary embodiment.
[0026] Figure 5 This is a flowchart illustrating another method for processing a data decomposition task according to an exemplary embodiment.
[0027] Figure 6 This is a structural diagram of a data decomposition task processing apparatus according to an exemplary embodiment.
[0028] Figure 7 This is a structural diagram of a processing apparatus for another data decomposition task, according to an exemplary embodiment.
[0029] Figure 8 This is a structural diagram of a computer device according to an exemplary embodiment. Detailed Implementation
[0030] The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0031] Figure 1 This is a network block diagram of a data decomposition task processing system provided in an embodiment of the present invention. The data decomposition task processing system may include a network 110, a server 120, a wireless device 130, a client 140, storage 150, a classical processing unit 160, a quantum processing unit 170, and may also include additional memory, a classical processor, a quantum processor, and other devices not shown.
[0032] Network 110 is a medium used to provide communication links between various devices and computers connected together within a data decomposition task processing system, 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 fiber optic cables.
[0033] Server 120, wireless device 130, and client 140 are conventional data processing systems that may contain data and application programs or software tools that perform conventional computational 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 can be configured to store data such as qubit parameters, quantum logic gate parameters, quantum circuits, and quantum programs.
[0034] 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 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 program 163 (application program 173). The application program 163 (application program 173) may be used to implement a quantum algorithm compiled by the data decomposition task processing method provided in the embodiments of the present invention.
[0035] 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 any application executed therein can also be configured to be executed in another classical (quantum) processing system in a similar manner.
[0036] It should be noted that a true quantum computer has a hybrid structure, which includes at least... Figure 1 The system consists of two main 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 to achieve quantum computing.
[0037] The aforementioned 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, providing quantum application development tools and services, as well as the storage and network services required for quantum applications. Users develop quantum programs using the quantum application development tools and services on the second device, and send these programs to a second device including the quantum processing unit 170 via the network services. The second device runs a quantum computer operating system, which parses and compiles the quantum program's code into instructions that the quantum processor 170 can recognize and execute. The quantum processor 170 then implements the quantum algorithm corresponding to the quantum program based on these instructions.
[0038] The computational units of the classic processor 161 in the classic processing unit 160 are based on silicon-based CMOS transistors. These computational units are not limited by time or coherence; that is, they are available at any time without time constraints. Furthermore, the number of such computational units in a silicon chip is sufficient; currently, a single classic processor 161 contains tens of thousands of computational units. Given this sufficient number of computational units and the fixed computational logic selectable by the CMOS transistors (e.g., AND logic), computational performance is achieved by combining a large number of CMOS transistors with a limited set of logic functions during operation.
[0039] In the quantum processing unit 170, the basic computing unit of the quantum processor 171 is the qubit. The input of a qubit is limited by coherence and coherence time; that is, a qubit is limited by its available usage time and is not always readily available. Making full use of qubits within their available usage time is a key challenge in quantum computing. Furthermore, the number of qubits in a quantum computer is one of the representative indicators of its performance. Each qubit performs computational functions through on-demand configured logical functions. Given the limited number of qubits and the diverse logical functions available in quantum computing, such as Hadamard gates (H gates), Pauli-X gates (X gates), Pauli-Y gates (Y gates), Pauli-Z gates (Z gates), X gates, RY gates, RZ gates, CNOT gates, CR gates, iSWAP gates, Tofoli gates, etc., quantum computing requires combining a limited number of qubits with diverse logical function combinations to achieve computational effects.
[0040] Based on these differences, the design of classical logic functions applied to CMOS transistors and the design of quantum logic functions applied to qubits are significantly and fundamentally different. The design of classical logic functions applied to CMOS transistors does not need to consider the individuality of CMOS transistors. For example, the representation of a CMOS transistor in a silicon chip is its individual identifier, location, and usable time of each CMOS transistor. Therefore, classical algorithms composed of classical logic functions only express the operational relationship of the algorithm, not the algorithm's dependence on individual CMOS transistors.
[0041] Quantum logic functions applied to qubits need to consider the individuality of each qubit, such as its position within the quantum chip, its relationship with surrounding qubits, and the duration of its usable time. Therefore, quantum algorithms composed of quantum logic functions not only express the computational relationships within the algorithm but also its dependence on the individual qubits.
[0042] For example: Quantum Algorithm 1: H1, H2, CNOT(1,3), H3, CNOT(2,3); Quantum Algorithm 2: H1, H2, CNOT(1,2), H3, CNOT(2,3); Where 1 / 2 / 3 represent three sequentially connected qubits Q1, Q2, Q3 or interconnected qubits Q1, Q2, Q3, respectively; An exemplary explanation of how quantum algorithms are affected by the coherence time of qubits is as follows: Define the execution time of a single-qubit logic gate as t, and the execution time of two single-qubit logic gates operating on adjacent qubits as 2t; then: When Q1, Q2, and Q3 are interconnected, the computation of Quantum Algorithm 1 requires 6t, which is divided into 4 time periods. The duration of each time period is t, 2t, t, and 2t, respectively. The operations performed in each time period are: H1, H2; CNOT(1,3); H3; CNOT(2,3); The computation of Quantum Algorithm 1 requires 5t, which is divided into 3 time periods. The duration of each time period is t, 2t, and 2t respectively. The operations performed in each time period are: H1, H2, H3; CNOT(1,2); CNOT(2,3); When Q1, Q2, and Q3 are connected sequentially, Quantum Algorithm 1 needs to be equivalent to: H1, H2; swap(1,2), CNOT(2,3), swap(1,2); H3; CNOT(2,3). The computation of the equivalent Quantum Algorithm 1 requires 10t, divided into 4 time periods, with each time period requiring durations of t, 6t, t, and 2t respectively. The operations performed in each time period are: H1, H2; swap(1,2), CNOT(2,3), swap(1,2); H3; CNOT(2,3).
[0043] Therefore, the application of quantum logic functions in the design of qubits (including the design of whether qubits are used and the design of the efficiency of each qubit's use) is key to improving the computational performance of quantum computers and requires special design. This is the unique characteristic of quantum algorithms implemented based on quantum logic functions, and is fundamentally and significantly different from classical algorithms implemented based on classical logic functions. The aforementioned design considerations for qubits are technical problems that ordinary computing devices do not need to consider or address. This invention proposes a method for processing data decomposition tasks to improve the efficiency of large-scale integer decomposition.
[0044] See Figure 2 , Figure 2 This is a flowchart illustrating a data decomposition task processing method according to an exemplary embodiment, applied to a quantum processing unit, wherein the data decomposition task is an integer decomposition task of data to be decomposed, and the method includes the following steps: S201, receiving random numbers and quantum phase estimation (QPE) circuits sent by the classical processing unit.
[0045] In this embodiment of the invention, the data decomposition task is a task in the encryption algorithm scenario that requires integer decomposition of the data to be decomposed. The encryption algorithm can be RSA, Elliptic Curve Cryptography (ECC), and Elliptic Curve Digital Signature Algorithm (ECDSA), etc.
[0046] The QPE algorithm is an important algorithm in quantum computing used to efficiently estimate the phase value of a quantum state. The goal of phase estimation is to determine the phase value of a given quantum state. The core idea of the QPE algorithm is to perform phase estimation using the quantum Fourier transform (QFT).
[0047] The basic steps of the QPE algorithm typically include: Step 1: Prepare a quantum state containing a phase value by operating on Hadamard gates and phase-rotation logic gates.
[0048] Step 2: Apply inverse QFT or QFT operation to return the quantum state, including the phase value, from the frequency domain back to the computational basis, and obtain a set of binary qubits.
[0049] Step 3: Measure the binary qubits to obtain the binary representation of the estimated phase value.
[0050] Step 4: Convert the binary representation to the corresponding decimal phase value.
[0051] The QPE algorithm can efficiently achieve phase estimation through appropriate quantum gate operations and inverse QFT or QFT operations.
[0052] In this embodiment of the invention, the phase rotation logic gate parameters of the QPE circuit are determined based on the data to be decomposed and the random number, wherein the random number is determined based on the data to be decomposed.
[0053] In this embodiment of the invention, the random number is coprime to the data to be decomposed, and the random number is greater than or equal to 1 and less than the data to be decomposed.
[0054] For example, if the data to be decomposed is an integer N and the random number is a, then the range of values for a is [1, N-1], and gcd(a, N) = 1. gcd() is a function that finds the greatest common divisor.
[0055] The method for determining the parameters of the phase-rotating logic gate and the specific structure of the QPE circuit will be described in detail in the following examples. Please refer to the relevant descriptions below.
[0056] S202. Excite the qubits of the first register of the QPE circuit to the first initial quantum state representing the random number, run the QPE circuit a first preset number of times, measure the final quantum state of the qubits of the second register of the QPE circuit, and obtain a first preset number of measurement results.
[0057] In this embodiment of the invention, the quantum processing unit running the QPE circuit can be a quantum computer or a quantum virtual machine.
[0058] After receiving the random number and QPE circuit sent by the classical processing unit, the quantum processing unit generates an analog signal based on the random number and applies the analog signal to the qubits in the first register, thereby exciting the qubits in the first register to the first initial quantum state representing the random number.
[0059] The quantum processing unit operates a QPE circuit, applying corresponding analog signals to the qubits of the second register based on the quantum logic gates in the QPE circuit to evolve the quantum state and output the desired final quantum state. Due to the superposition property of quantum states, a single measurement cannot obtain all the information of the final quantum state, and the measurement operation will also affect the final quantum state. Therefore, to measure the final quantum state of the second register, the QPE circuit needs to be run a first number of times. After each run of the QPE circuit, the final quantum state of the second register is measured to obtain a first preset number of measurement results.
[0060] The first preset quantity can be set by technicians. For example, the first preset quantity can be set to 1000, so that the QPE circuit is run 1000 times to obtain 1000 measurement results.
[0061] For example, if the second register has 2 qubits and the QPE circuit runs 1000 times, assuming that the number of times the measurement result is 00 is 100, the number of times the measurement result is 01 is 200, the number of times the measurement result is 10 is 300, and the number of times the measurement result is 11 is 400, then 100, 200, 300, and 400 are the corresponding times of the superposition states of the final quantum states of the qubits in the second register.
[0062] It is understood that, through the evolution of the QPE circuit, the measurement result obtained in this embodiment of the invention is a binary representation of the phase value of the final quantum state of the qubit in the second register.
[0063] S203. Send the first preset number of measurement results to the classical processing unit so that the classical processing unit determines the integer decomposition result of the data to be decomposed based on the first preset number of measurement results.
[0064] The data to be decomposed is an integer N, and the integer decomposition result is the prime factorization result of the integer N.
[0065] In this embodiment of the invention, the period of the shor algorithm for solving a mod N is transformed into the phase value of a mod N by using a QPE circuit.
[0066] The quantum processing unit sends the first preset number of measurement results to the classical processing unit. The classical processing unit calculates the period of a mod N based on the measurement results, and finally realizes the prime factorization of the data N to be decomposed.
[0067] In this embodiment of the invention, a random number and a quantum phase estimation (QPE) circuit are received from a classical processing unit. The phase rotation logic gate parameters of the QPE circuit are determined based on the data to be decomposed and the random number, with the random number determined based on the data to be decomposed. The qubits of the first register of the QPE circuit are excited to a first initial quantum state representing the random number. The QPE circuit is run a first preset number of times, and the final quantum state of the qubits of the second register of the QPE circuit is measured to obtain a first preset number of measurement results. The first preset number of measurement results are sent to the classical processing unit so that the classical processing unit determines the integer decomposition result of the data to be decomposed based on the first preset number of measurement results. This invention uses a QPE circuit to perform integer decomposition operations on the data to be decomposed. The QPE circuit does not include basic arithmetic units such as modular addition and modular multiplication units. Compared with the prior art, the data decomposition task processing method provided by this invention requires a shallower QPE circuit, has higher operating efficiency, and improves the decomposition efficiency of large-scale integers.
[0068] The specific structure of the QPE circuit provided in the above embodiments and the method for determining the parameters of the phase-rotating logic gates will be described below.
[0069] In another embodiment of the present invention, the QPE circuit in the above embodiment includes n phase-rotation logic gates, and the second register includes n qubits corresponding one-to-one with the n phase-rotation logic gates. The n qubits are used to sequentially control the corresponding phase-rotation logic gates to act on the first register in order from the most significant bit to the least significant bit.
[0070] The quantum state of the qubits in the second register is 0. The QPE circuit also includes an H gate, which is used to evolve the n qubits in the second register into a second initial quantum state. Each qubit in the second initial quantum state is used to control the corresponding phase rotation logic gate to perform phase rotation on the qubit in the first initial quantum state.
[0071] The aforementioned QPE circuit also includes a quantum Fourier transform unit. Before obtaining the measurement result by measuring the final quantum state of the qubits in the second register of the QPE circuit, the method further includes: The quantum state evolution of the qubits in the second register is performed based on the quantum Fourier transform unit.
[0072] The number of qubits n in the second register is determined based on the integer N to be factored. .
[0073] The matrix form of the i-th phase-rotation logic gate is: , , .
[0074] in, Here, b is the parameter of the phase-rotation logic gate, and N represents the data to be decomposed. When the random number is not 1, the value of b is equal to the random number. When the random number is 1, b is greater than or equal to 2 and less than the data to be decomposed, N.
[0075] In one implementation, if the random number is greater than or equal to 2 and less than the random number N, then the first register includes n+1 qubits for loading the random number, and the value of b is equal to the random number.
[0076] like Figure 3 As shown, Figure 3 This is a schematic diagram of a QPE quantum circuit provided in an embodiment of the present invention. Figure 3 The diagram illustrates a first register and a second register. The first register includes n+1 qubits for loading a random number 'a', and its first initial quantum state is |a>. The second register includes n qubits in the 0 state. An H-gate operates on each qubit in the second register, converting its quantum state to the second initial quantum state. Each qubit in the second register corresponds to a phase rotation logic gate. The n qubits in the second register, in descending order of their bit positions, sequentially control the corresponding phase rotation logic gates that operate on the qubits in the first register. , After the n qubits in the second register control the phase rotation logic gate to act on the qubits in the first register, the quantum Fourier transform unit acts on the qubits in the second register. Finally, by measuring the final quantum state of the second register, the measurement result is obtained, which is the binary representation of the phase value of the final quantum state.
[0077] Figure 3 The QPE circuit shown requires a total of 2n+1 qubits.
[0078] In another implementation, when the random number is 1, the first register includes only 1 qubit for storing the random number. At the same time, b in the above formula for calculating the phase rotation logic gate parameters needs to be randomly selected again between [2, N-1].
[0079] like Figure 4 As shown, Figure 4 This is a schematic diagram of another QPE quantum circuit provided in an embodiment of the present invention. Figure 4 The diagram illustrates a first register and a second register. The first register includes one qubit for loading the random number 1, and its first initial quantum state is |1>. The second register includes n qubits, each with a quantum state of 0. An H-gate operates on each qubit in the second register, converting its quantum state to the second initial quantum state. Each qubit in the second register corresponds to a phase rotation logic gate. The n qubits in the second register, in descending order of their bit positions, sequentially control the corresponding phase rotation logic gates that operate on the qubits in the first register. , After the n qubits in the second register control the phase rotation logic gate to act on the qubits in the first register, the quantum Fourier transform unit acts on the qubits in the second register. Finally, by measuring the final quantum state of the second register, the measurement result is obtained, which is the binary representation of the phase value of the final quantum state.
[0080] Figure 4 The QPE circuit shown requires a total of n+1 qubits.
[0081] By combining Figure 3 and Figure 4 It can be seen that when the random number a is 1, the QPE circuit provided in this embodiment of the invention requires a total of n+1 qubits. When the random number a is greater than or equal to 2 and less than the data to be decomposed N, the QPE circuit provided in this embodiment of the invention requires a total of 2n+1 qubits. Therefore, the QPE circuit provided in this embodiment of the invention requires a maximum of 2n+1 qubits and a minimum of n+1 qubits, requiring a relatively small number of qubits, thus saving computational resources.
[0082] Furthermore, since the QPE circuit in this embodiment of the invention does not require a basic arithmetic unit and has a shallow circuit depth, it runs quickly, taking only 30 minutes to factor integers up to 24 bits.
[0083] This invention also provides a method for processing a data decomposition task, applied to a classic processing unit, wherein the data decomposition task is a task of performing integer decomposition on the data to be decomposed, such as... Figure 5 As shown, the method includes the following steps: S501. Obtain the data decomposition task and determine random numbers based on the data to be decomposed.
[0084] In this embodiment of the invention, the data decomposition task is a task in the encryption algorithm scenario that requires integer decomposition of the data to be decomposed. The encryption algorithm can be RSA, Elliptic Curve Cryptography (ECC), and Elliptic Curve Digital Signature Algorithm (ECDSA), etc.
[0085] The QPE algorithm is an important algorithm in quantum computing used to efficiently estimate the phase value of a quantum state. The goal of phase estimation is to determine the phase value of a given quantum state. The core idea of the QPE algorithm is to perform phase estimation using the quantum Fourier transform (QFT).
[0086] The basic steps of the QPE algorithm typically include: Step 1: Prepare a quantum state containing a phase value by operating on Hadamard gates and phase-rotation logic gates.
[0087] Step 2: Apply inverse QFT or QFT operation to return the quantum state, including the phase value, from the frequency domain back to the computational basis, and obtain a set of binary qubits.
[0088] Step 3: Measure the binary qubits to obtain the binary representation of the estimated phase value.
[0089] Step 4: Convert the binary representation to the corresponding decimal phase value.
[0090] The QPE algorithm can efficiently achieve phase estimation through appropriate quantum gate operations and inverse QFT or QFT operations.
[0091] In this embodiment of the invention, the random number is coprime to the data to be decomposed, and the random number is greater than or equal to 1 and less than the data to be decomposed.
[0092] For example, if the data to be decomposed is an integer N and the random number is a, then the range of values for a is [1, N-1], and gcd(a, N) = 1. gcd() is a function that finds the greatest common divisor.
[0093] S502. Based on the data to be decomposed and the random number, determine the parameters of the phase rotation logic gate of the quantum phase estimation (QPE) circuit, and construct the QPE circuit.
[0094] The QPE circuit includes n phase-rotation logic gates, and the second register includes n qubits that correspond one-to-one with the n phase-rotation logic gates. The n qubits are used to control the corresponding phase-rotation logic gates to act on the first register in order from the most significant bit to the least significant bit.
[0095] The structure of the QPE circuit and the method for determining the parameters of the phase-rotating logic gates can be found in the descriptions in the above embodiments, and will not be repeated here.
[0096] S503. The quantum processing unit sends the QPE circuit and the random number to the quantum processing unit so that the quantum processing unit excites the qubits of the first register of the QPE circuit to the first initial quantum state representing the random number, runs the QPE circuit a first preset number of times, measures the final quantum state of the qubits of the second register of the QPE circuit, and obtains a first preset number of measurement results.
[0097] In this embodiment of the invention, the second register includes n qubits. The final quantum state of the qubits in the second register is measured, and the measurement result is an n-bit binary number, which is the binary representation of the phase value of the final quantum state of the second register.
[0098] By running the QPE circuit a first preset number of times and measuring the final quantum state of the qubits in the second register of the QPE circuit, a first preset number of measurement results can be obtained, that is, a first preset number of binary numbers can be obtained.
[0099] S504. Receive the first preset number of measurement results sent by the quantum processing unit, and determine the integer decomposition result of the data to be decomposed based on the first preset number of measurement results.
[0100] In this embodiment of the invention, the period of the shor algorithm for solving a mod N is transformed into the phase value of a mod N by the QPE circuit.
[0101] The quantum processing unit sends the first preset number of measurement results to the classical processing unit. The classical processing unit calculates the period of a mod N based on the measurement results, and finally realizes the prime factorization of the data N to be decomposed.
[0102] In this embodiment of the invention, the classical processing unit acquires the data decomposition task and determines random numbers based on the data to be decomposed; it determines the parameters of the phase rotation logic gate of the quantum phase estimation (QPE) circuit based on the data to be decomposed and the random numbers, and constructs the QPE circuit; it sends the QPE circuit and the random numbers to the quantum processing unit, causing the quantum processing unit to excite the qubits of the first register of the QPE circuit to a first initial quantum state representing the random numbers, runs the QPE circuit a first preset number of times, measures the final quantum state of the qubits of the second register of the QPE circuit, and obtains a first preset number of measurement results; it receives the first preset number of measurement results sent by the quantum processing unit, and determines the integer decomposition result of the data to be decomposed based on the first preset number of measurement results. This invention implements integer decomposition operations on the data to be decomposed using a QPE circuit. The QPE circuit does not include basic arithmetic units such as modular addition and modular multiplication units. Compared with the prior art, the data decomposition task processing method provided by this invention requires a shallower QPE circuit, has higher operating efficiency, and improves the decomposition efficiency of large-scale integers.
[0103] In another embodiment of the present invention, determining the integer decomposition result of the data to be decomposed based on the first preset number of measurement results in S504 can be specifically implemented as follows: Step 1: Select a second preset number of target measurement results from the first preset number of measurement results according to the probability of the measurement results.
[0104] In this embodiment of the invention, the second register includes n qubits, and the measurement result is an n-bit binary number. Therefore, the measurement result has 2... n Different binary numbers.
[0105] For example, if n=3, the measurement results can be: 000, 001, 010, 011, 100, 101, 110, and 111, for a total of 2... 3 =8 different possible outcomes.
[0106] Assuming the first preset quantity is set to 1000, the number of measurements corresponding to measurement result 000 is 50, the number of measurements corresponding to measurement result 001 is 200, the number of measurements corresponding to measurement result 010 is 100, the number of measurements corresponding to measurement result 011 is 100, the number of measurements corresponding to measurement result 100 is 300, the number of measurements corresponding to measurement result 101 is 50, the number of measurements corresponding to measurement result 110 is 150, and the number of measurements corresponding to measurement result 111 is 50.
[0107] Therefore, the probability of measurement result 100 is the highest: 300 / 1000=0.3, the probability of measurement result 001 is 200 / 1000=0.2, the probability of measurement result 110 is 150 / 1000=0.15, the probability of measurement results 010 and 001 is 100 / 1000=0.1, and the probability of measurement results 000, 101 and 111 is 50 / 1000=0.05.
[0108] Then, technicians can determine the second preset number of target measurement results based on the probability of each measurement result.
[0109] For example, if the second preset quantity is set to 1, then the measurement result 100 with a probability of 0.3 can be selected as the target measurement result.
[0110] Alternatively, if the second preset quantity is set to 2, then the measurement results 100 and 001 with probabilities of 0.3 and 0.2 can be selected as the target measurement results.
[0111] Alternatively, if the second preset quantity is set to 5, then the measurement results 100, 001, 110, 010 and 001 with probabilities of 0.3, 0.2, 0.15 and 0.1 can be selected as the target measurement results.
[0112] It should be noted that the above example is for illustrative purposes only, and the value of n is relatively small. In practical applications, the value of n may be larger, and the measurement result may have 2... n The second preset quantity will be set to a fixed value, such as 50 or 100, that is, the top 50 or 100 measurement results with higher probability will be selected as the target measurement results.
[0113] Step 2: Convert the measurement result of each target into a decimal number, and calculate the order of the random number in the multiplicative group formed by modulo the data to be decomposed based on each decimal number.
[0114] Specifically: the quotient of each decimal number and 2^n is determined as the phase value, and the phase value corresponding to each decimal number is obtained. Each phase value is multiplied by the data to be decomposed to obtain the order corresponding to each decimal number, where n is the number of qubits included in the second register.
[0115]
[0116]
[0117] Where t is the decimal conversion result of the measurement. Let N represent the phase value, N represent the data to be decomposed, and l represent the order of the random number in the multiplicative group formed by modulo the data to be decomposed.
[0118] Step 3: Based on the order of the random number in the multiplicative group formed by modulo the data to be decomposed and the data to be decomposed, calculate to obtain the integer decomposition result.
[0119] Specifically, if the order is even, calculate The greatest common divisor of the sum and the data to be decomposed; if the order is odd, calculate... The greatest common divisor of the data to be decomposed; where, Let a be the order corresponding to the m-th decimal number, and let a be the random number. Then, incorporate each calculated greatest common divisor into the factorization set to obtain the integer factorization result.
[0120] In this embodiment of the invention, since there are a second preset number of target measurement results, it is necessary to perform a decimal conversion for each target measurement result and calculate the corresponding order. Therefore, when the order is used to calculate the greatest common divisor, multiple greatest common divisors will be obtained. These multiple greatest common divisors constitute a factorization set, which yields the integer factorization result.
[0121] In one implementation, the greatest common divisor (GCD) can be found using the gcd() function, where gcd() is the function for finding the GCD.
[0122] When l m When the number is odd, calculate the greatest common divisor using the following formula:
[0123] When, l m When the number is even, calculate the greatest common divisor using the following formula:
[0124]
[0125] The embodiments of the present invention do not impose specific limitations on the method of finding the greatest common divisor. The greatest common divisor can also be found by means of Euclidean algorithm (also known as the Euclidean method) or subtraction method.
[0126] This invention calculates the parity of each order calculated based on the target measurement results. and the data to be decomposed or calculated The greatest common divisor of the sum and the data to be decomposed is used to incorporate each greatest common divisor into the factorization set to obtain the integer decomposition result. The data decomposition task processing method based on the QPE circuit of this invention can perform integer decomposition on any data to be decomposed, and is not limited to the decomposition of semiprime numbers (prime numbers with only two prime factors), and has a wider range of applications.
[0127] Based on the same inventive concept, embodiments of the present invention provide a processing apparatus for a data decomposition task, applied to a quantum processing unit, wherein the data decomposition task is a task of integer decomposing data to be decomposed, such as... Figure 6 As shown, the device includes: The receiving module 601 is used to receive random numbers and quantum phase estimation (QPE) circuits sent by the classical processing unit. The phase rotation logic gate parameters of the QPE circuit are determined based on the data to be decomposed and the random numbers. The running module 602 is used to excite the qubits of the first register of the QPE circuit to the first initial quantum state representing the random number, run the QPE circuit a first preset number of times, measure the final quantum state of the qubits of the second register of the QPE circuit, and obtain a first preset number of measurement results. The sending module 603 is used to send the first preset number of measurement results to the classical processing unit, so that the classical processing unit determines the integer decomposition result of the data to be decomposed based on the first preset number of measurement results.
[0128] Based on the same inventive concept, embodiments of the present invention provide a processing apparatus for a data decomposition task, applied to a classic processing unit, wherein the data decomposition task is a task of integer decomposing data to be decomposed, such as... Figure 7 As shown, the device includes: The acquisition module 701 is used to acquire the data decomposition task and determine random numbers based on the data to be decomposed; The construction module 702 is used to determine the parameters of the phase rotation logic gate of the quantum phase estimation (QPE) circuit based on the data to be decomposed and the random number, and to construct the QPE circuit. The transmitting module 703 is used to transmit the QPE circuit and the random number to the quantum processing unit, so that the quantum processing unit excites the qubits of the first register of the QPE circuit to the first initial quantum state representing the random number, runs the QPE circuit a first preset number of times, measures the final quantum state of the qubits of the second register of the QPE circuit, and obtains a first preset number of measurement results. The determining module 704 is used to receive the first preset number of measurement results sent by the quantum processing unit, and determine the integer decomposition result of the data to be decomposed based on the first preset number of measurement results.
[0129] The specific functions and effects of the data decomposition task processing device can be explained by referring to other embodiments in this specification, and will not be repeated here. Each module in the data decomposition task processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0130] Please see Figure 8 This specification also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor, when executing the computer program, implements a processing method for the data decomposition task in any of the above embodiments. Please refer to... Figure 8 The computer device can be a classical computer or a quantum computer.
[0131] This specification also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a computer, causes the computer to perform the data decomposition task processing method described in any of the above embodiments.
[0132] This specification also provides a computer program product containing instructions that, when executed by a computer, cause the computer to perform a data decomposition task processing method according to any of the above embodiments.
[0133] It is understood that the specific examples in this specification are only intended to help those skilled in the art better understand the implementation methods described herein, and are not intended to limit the scope of the invention.
[0134] It is understood that in the various embodiments of this specification, the sequence number of each process does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not limit the implementation process of the embodiments of this specification in any way.
[0135] It is understood that the various implementation methods described in this specification can be implemented individually or in combination, and the implementation methods in this specification are not limited in this respect.
[0136] Unless otherwise stated, all technical and scientific terms used in the embodiments of this specification have the same meaning as commonly understood by one of ordinary skill in the art. The terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of this specification. The term "and / or" as used in this specification includes any and all combinations of one or more of the associated listed items. The singular forms "a," "the," and "the" as used in the embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0137] It is understood that the processor in the embodiments of this specification can be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method embodiments can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The 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. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this specification. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this specification can be directly implemented by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory; the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above methods.
[0138] It is understood that the memory in the embodiments of this specification may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM). It should be noted that the memory in the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0139] Those skilled in the art will recognize that the units and algorithm steps of the various examples 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 implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art 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.
[0140] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the aforementioned method implementations, and will not be repeated here.
[0141] In the several embodiments provided in this specification, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0142] The units described as separate components may or may not be physically separate. 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 can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0143] In addition, the functional units in the various embodiments of this specification can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0144] If the aforementioned functions are implemented as 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 solutions of this specification, in essence, or the parts that contribute to the prior art, or parts of the technical solutions, can be embodied in the form of software products. These computer software products are stored in a storage medium and include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this specification. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0145] The above description is merely a specific embodiment of this specification, but the scope of protection of this invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this specification should be included within the scope of protection of this specification. Therefore, the scope of protection of this invention should be determined by the scope of the claims.
Claims
1. A method for processing data decomposition tasks, characterized in that, Applied to quantum processing units, the data decomposition task is a task of performing integer decomposition on the data to be decomposed, including: The system receives random numbers and a quantum phase estimation (QPE) circuit from a classical processing unit. The phase-rotation logic gate parameters of the QPE circuit are determined based on the data to be decomposed and the random numbers, where the random numbers are determined based on the data to be decomposed. The QPE circuit includes n phase-rotation logic gates, and the matrix form of the i-th phase-rotation logic gate is: , , ;in, The parameters of the phase-rotation logic gate are N, which represents the data to be decomposed; when the random number is not 1, the value of b is equal to the random number; when the random number is 1, b is greater than or equal to 2 and less than N. The qubits of the first register of the QPE circuit are excited to the first initial quantum state representing the random number. The QPE circuit is run a first preset number of times. The final quantum state of the qubits of the second register of the QPE circuit is measured to obtain a first preset number of measurement results. The first preset number of measurement results are sent to the classical processing unit so that the classical processing unit can determine the integer decomposition result of the data to be decomposed based on the first preset number of measurement results.
2. The method according to claim 1, characterized in that, The second register includes n qubits that correspond one-to-one with the n phase rotation logic gates. The n qubits are used to control the corresponding phase rotation logic gates to act on the first register in order from the most significant bit to the least significant bit.
3. The method according to claim 2, characterized in that, The QPE circuit further includes an H gate, which is used to evolve the n qubits in the second register into a second initial quantum state. Each qubit in the second initial quantum state is used to control the corresponding phase rotation logic gate to perform a phase rotation on the qubit in the first initial quantum state.
4. The method according to claim 2, characterized in that, The QPE circuit further includes a quantum Fourier transform unit. Before measuring the final quantum state of the qubits in the second register of the QPE circuit to obtain a first preset number of measurement results, the following steps are also included: The quantum state evolution of the qubits in the second register is performed based on the quantum Fourier transform unit.
5. The method according to any one of claims 1-4, characterized in that, The random number is coprime to the data to be decomposed, and the random number is greater than or equal to 1 and less than the data to be decomposed.
6. A method for processing a data decomposition task, characterized in that, Applied to a classic processing unit, the data decomposition task is to perform integer decomposition on the data to be decomposed, and the method includes: Obtain the data decomposition task and determine random numbers based on the data to be decomposed; Based on the data to be decomposed and the random numbers, the parameters of the phase-rotation logic gates of the quantum phase estimation (QPE) circuit are determined, and the QPE circuit is constructed. The QPE circuit includes n phase-rotation logic gates, and the matrix form of the i-th phase-rotation logic gate is: , , ;in, The parameters of the phase-rotation logic gate are N, which represents the data to be decomposed; when the random number is not 1, the value of b is equal to the random number; when the random number is 1, b is greater than or equal to 2 and less than N. The quantum processing unit sends the QPE circuit and the random number to the quantum processing unit so that the quantum processing unit excites the qubits of the first register of the QPE circuit to the first initial quantum state representing the random number, runs the QPE circuit a first preset number of times, measures the final quantum state of the qubits of the second register of the QPE circuit, and obtains a first preset number of measurement results. The quantum processing unit receives the first preset number of measurement results and determines the integer decomposition result of the data to be decomposed based on the first preset number of measurement results.
7. The method according to claim 6, characterized in that, The step of determining the integer decomposition result of the data to be decomposed based on the first preset number of measurement results includes: From the first preset number of measurement results, select a second preset number of target measurement results according to the probability of the measurement results; Each target measurement result is converted into a decimal number, and the order of the random number in the multiplication group formed by modulo the data to be decomposed is calculated based on each decimal number. The integer decomposition result is obtained by calculating the order of the random number in the multiplicative group formed by modulo the data to be decomposed and the data to be decomposed.
8. The method according to claim 7, characterized in that, The step of calculating the order of the random number in the multiplicative group formed by modulo the data to be decomposed based on each decimal number includes: The quotient of each decimal number and 2^n is determined as the phase value, thus obtaining the phase value corresponding to each decimal number, where n is the number of qubits included in the second register; Multiply each phase value by the data to be decomposed to obtain the order corresponding to each decimal number.
9. The method according to claim 8, characterized in that, The process of calculating the integer factorization result based on the order of the random number in the multiplicative group formed by modulo the data to be factored and the data to be factored includes: If the order is even, calculate The greatest common divisor of the sum and the data to be decomposed; if the order is odd, calculate... The greatest common divisor of the data to be decomposed; where, Let be the order corresponding to the m-th decimal number, and a be the random number; Each calculated greatest common divisor is incorporated into the factorization set to obtain the integer factorization result.
10. A processing apparatus for a data decomposition task, characterized in that, Applied to a quantum processing unit, the data decomposition task is the task of performing integer decomposition on the data to be decomposed, and the apparatus includes: The receiving module is used to receive random numbers and a quantum phase estimation (QPE) circuit sent by the classical processing unit. The phase-rotation logic gate parameters of the QPE circuit are determined based on the data to be decomposed and the random numbers, wherein the random numbers are determined based on the data to be decomposed. The QPE circuit includes n phase-rotation logic gates, and the matrix form of the i-th phase-rotation logic gate is: , , ;in, The parameters of the phase-rotation logic gate are N, which represents the data to be decomposed; when the random number is not 1, the value of b is equal to the random number; when the random number is 1, b is greater than or equal to 2 and less than N. The running module is used to excite the qubits of the first register of the QPE circuit to the first initial quantum state representing the random number, run the QPE circuit a first preset number of times, measure the final quantum state of the qubits of the second register of the QPE circuit, and obtain a first preset number of measurement results; The sending module is used to send the first preset number of measurement results to the classical processing unit, so that the classical processing unit can determine the integer decomposition result of the data to be decomposed based on the first preset number of measurement results.
11. A processing apparatus for a data decomposition task, characterized in that, Applied to a classic processing unit, the data decomposition task is the task of performing integer decomposition on the data to be decomposed, and the apparatus includes: The acquisition module is used to acquire the data decomposition task and determine random numbers based on the data to be decomposed; A construction module is used to determine the parameters of the phase-rotation logic gates of the quantum phase estimation (QPE) circuit based on the data to be decomposed and the random numbers, and to construct the QPE circuit; the QPE circuit includes n phase-rotation logic gates, and the matrix form of the i-th phase-rotation logic gate is: , , ;in, The parameters of the phase-rotation logic gate are N, which represents the data to be decomposed; when the random number is not 1, the value of b is equal to the random number; when the random number is 1, b is greater than or equal to 2 and less than N. The transmitting module is used to transmit the QPE circuit and the random number to the quantum processing unit, so that the quantum processing unit excites the qubits of the first register of the QPE circuit to the first initial quantum state representing the random number, runs the QPE circuit a first preset number of times, measures the final quantum state of the qubits of the second register of the QPE circuit, and obtains a first preset number of measurement results. The determining module is used to receive the first preset number of measurement results sent by the quantum processing unit, and determine the integer decomposition result of the data to be decomposed based on the first preset number of measurement results.
12. A storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to execute the method described in any one of claims 1 to 5 or 6-9 when it is run.
13. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the method as described in any one of claims 1 to 5 or 6-9.
Citation Information
Patent Citations
Quantum computer quantum processing unit, quantum circuit and quantum circuit quantum algorithm
CN110490327A
Method and device for determining size relationship between quantum data and classical floating point type data
CN116090568A