Search

CN-117035103-B - Processing method and device of data decomposition task, storage medium and electronic device

CN117035103BCN 117035103 BCN117035103 BCN 117035103BCN-117035103-B

Abstract

The application discloses a processing method, a device, a storage medium and an electronic device for a data decomposition task, and relates to the technical field of quantum computation, wherein the method comprises the steps of receiving data to be decomposed, random numbers and a quantum data decomposition circuit sent by a classical processing unit, wherein the quantum data decomposition circuit comprises a plurality of cascaded modular multiplication units and control bits, and the control bits are used for sequentially controlling each modular multiplication unit to calculate preset exponent power of the random numbers and the modulus of the data to be decomposed; the method comprises the steps of operating a quantum data decomposition circuit, aiming at each modular multiplication unit, measuring the quantum state of a control bit after the control bit controls the current modular multiplication unit to carry out modular multiplication operation, setting the quantum state of the control bit as zero state for controlling the next modular multiplication unit to carry out modular multiplication operation to obtain a measurement result sequence, and sending the measurement result sequence to a classical processing unit so that the classical processing unit determines an integer decomposition result of data to be decomposed according to the measurement result sequence. The occupation of qubits can be reduced.

Inventors

  • Dou Menghan
  • Request for anonymity
  • Request for anonymity

Assignees

  • 本源量子计算科技(合肥)股份有限公司

Dates

Publication Date
20260512
Application Date
20230629

Claims (12)

  1. 1. The method is applied to a quantum processing unit, and the data decomposition task is a task for performing integer decomposition on data to be decomposed and comprises the following steps: The method comprises the steps of receiving data to be decomposed, random numbers and a quantum data decomposition circuit sent by a classical processing unit, wherein the quantum data decomposition circuit comprises a plurality of cascaded modular multiplication units, control bits, a first H gate, a phase rotation logic gate and a second H gate which sequentially act on the control bits, and the control bits are used for sequentially controlling each modular multiplication unit to calculate preset exponent power of the random numbers and the modulus of the data to be decomposed; the quantum data decomposition circuit is operated, after the control bit controls the current modular multiplication unit to carry out modular multiplication operation, the quantum state of the control bit is measured, and the quantum state of the control bit is set to be zero state to control the next modular multiplication unit to carry out modular multiplication operation, so that a measurement result sequence is obtained; the first H gate acts on the control bit after the quantum state is set to be zero, the phase rotation logic gate acts on the control bit after the control bit controls the modular multiplication unit to carry out modular multiplication operation, and the second H gate acts on the control bit and then measures the quantum state of the control bit; and sending the measurement result sequence to the classical processing unit so that the classical processing unit determines an integer decomposition result of the data to be decomposed according to the measurement result sequence.
  2. 2. The method of claim 1, wherein the matrix form of the phase rotation logic gate R K is: = parameters of the phase rotation logic gate Calculated according to the following formula: =- / Where k represents the kth time the rotary logic gate acts on the control bit, and m j represents the measurement result obtained by the jth measurement of the control bit.
  3. 3. The method according to any one of claims 1-2, wherein the random number has a value in the range of [1, n-1], said random number being mutually compatible with the data to be decomposed.
  4. 4. A method for processing a data decomposition task, wherein the method is applied to a classical processing unit and comprises the following steps: The data decomposition task is obtained and is a task for carrying out integer decomposition on data to be decomposed; Determining a random number according to the data to be decomposed, and constructing a quantum data decomposition circuit comprising a plurality of cascaded modular multiplication units, control bits and a first H gate, a phase rotation logic gate and a second H gate which sequentially act on the control bits, wherein the control bits are used for sequentially controlling each modular multiplication unit to calculate a preset exponent power of the random number and a module of the data to be decomposed; The data to be decomposed, the random number and the quantum data decomposition circuit are sent to a quantum processing unit, so that the quantum processing unit runs the quantum data decomposition circuit, after the control bit controls the current modular multiplication unit to carry out modular multiplication operation, the quantum state of the control bit is measured for each modular multiplication unit, and the quantum state of the control bit is set to be zero for controlling the next modular multiplication unit to carry out modular multiplication operation, and a measurement result sequence is obtained; the first H gate acts on the control bit after the quantum state is set to be zero, the phase rotation logic gate acts on the control bit after the control bit controls the modular multiplication unit to carry out modular multiplication operation, and the second H gate acts on the control bit and then measures the quantum state of the control bit; and receiving a measurement result sequence sent by the quantum processing unit, and determining an integer decomposition result of the data to be decomposed according to the measurement result sequence.
  5. 5. The method of claim 4, wherein determining the integer decomposition result of the data to be decomposed based on the sequence of measurement results comprises: converting the measurement result sequence into decimal numbers, and performing continuous fraction expansion on the decimal numbers to obtain the orders of the random numbers in a multiplication group formed by modeling the data to be decomposed; And if the order of the random number is even, solving an integer decomposition result of the data to be decomposed according to the order of the random number, the data to be decomposed and a greatest common divisor function.
  6. 6. The method of claim 5, wherein the method further comprises: And if the order of the random number is odd, re-determining the random number according to the data to be decomposed, and returning to the step of executing the quantum data decomposition circuit comprising a plurality of cascaded modular multiplication units and control bits until the order of the random number is even.
  7. 7. The method according to claim 5 or 6, characterized in that the integer decomposition result of the data to be decomposed is solved according to the following formula: Wherein, the A is the random number, N is the data to be decomposed, and r is the order of the data to be decomposed and the random number of the random number.
  8. 8. The method according to any one of claims 4-7, wherein the random number has a value in the range of [1, n-1], the random number being compatible with the data to be decomposed.
  9. 9. A processing device for a data decomposition task, wherein the device is applied to a quantum processing unit, and the data decomposition task is a task for performing integer decomposition on data to be decomposed, and the processing device comprises: The receiving module is used for receiving the data to be decomposed, the random number and the quantum data decomposition circuit sent by the classical processing unit, the quantum data decomposition circuit comprises a plurality of cascaded modular multiplication units, control bits, a first H gate, a phase rotation logic gate and a second H gate, wherein the first H gate, the phase rotation logic gate and the second H gate sequentially act on the control bits, and the control bits are used for sequentially controlling each modular multiplication unit to calculate the preset exponent power of the random number and the modulus of the data to be decomposed; The operation module is used for operating the quantum data decomposition circuit, measuring the quantum state of the control bit after the control bit controls the current modular multiplication unit to carry out modular multiplication operation aiming at each modular multiplication unit, and setting the quantum state of the control bit as zero state for controlling the next modular multiplication unit to carry out modular multiplication operation so as to obtain a measurement result sequence; the first H gate acts on the control bit after the quantum state is set to be zero, the phase rotation logic gate acts on the control bit after the control bit controls the modular multiplication unit to carry out modular multiplication operation, and the second H gate acts on the control bit and then measures the quantum state of the control bit; And the sending module is used for sending the measurement result sequence to the classical processing unit so that the classical processing unit determines an integer decomposition result of the data to be decomposed according to the measurement result sequence.
  10. 10. A processing device for data decomposition tasks, said device being applied to a classical processing unit, comprising: The acquisition module is used for acquiring the data decomposition task, wherein the data decomposition task is a task for carrying out integer decomposition on data to be decomposed; The construction module is used for determining a random number according to the data to be decomposed, constructing a quantum data decomposition circuit comprising a plurality of cascaded modular multiplication units, control bits and a first H gate, a phase rotation logic gate and a second H gate which sequentially act on the control bits, wherein the control bits are used for sequentially controlling each modular multiplication unit to calculate a preset exponent of the random number and a module of the data to be decomposed; the sending module is used for sending the data to be decomposed, the random number and the quantum data decomposition circuit to a quantum processing unit, so that the quantum processing unit runs the quantum data decomposition circuit, after the control bit controls the current modular multiplication unit to carry out modular multiplication operation, the quantum state of the control bit is measured, and the quantum state of the control bit is set to be zero state to control the next modular multiplication unit to carry out modular multiplication operation, and a measurement result sequence is obtained; the first H gate acts on the control bit after the quantum state is set to be zero, the phase rotation logic gate acts on the control bit after the control bit controls the modular multiplication unit to carry out modular multiplication operation, and the second H gate acts on the control bit and then measures the quantum state of the control bit; And the receiving module is used for receiving the measurement result sequence sent by the quantum processing unit and determining an integer decomposition result of the data to be decomposed according to the measurement result sequence.
  11. 11. A storage medium having a computer program stored therein, wherein the computer program is arranged to perform the method of any of claims 1 to 3 or 4 to 8 when run.
  12. 12. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to run the computer program to perform the method of any of claims 1 to 3 or 4 to 8.

Description

Processing method and device of data decomposition task, storage medium and electronic device Technical Field The application belongs to the technical field of quantum computing, and particularly relates to a processing method and device of a data decomposition task, a storage medium and an electronic device. Background The quantum computer is a kind of physical device which performs high-speed mathematical and logical operation, stores and processes quantum information according to the law of quantum mechanics. When a device processes and calculates quantum information and operates on a quantum algorithm, the device is a quantum computer. Quantum computers are a key technology under investigation because of their ability to handle mathematical problems more efficiently than ordinary computers, for example, to accelerate the time to crack RSA keys from hundreds of years to hours. The Shor algorithm is an algorithm for decomposing integers, at present, for integer decomposition, a quantum circuit for realizing Shor algorithm is constructed based on a GPU or a CPU simulator, hundreds of quantum bits are usually needed for constructing a simulated quantum circuit, the dimension increase of Hilbert space and the number of the quantum bits are exponentially increased, so that the GPU or the CPU simulator cannot simulate the quantum circuit with more than 100 quantum bits, and therefore, the prior technical scheme needs more quantum bits for decomposing large-scale integers. Disclosure of Invention The application aims to provide a processing method and device for a data decomposition task, a storage medium and an electronic device, and aims to realize large-scale integer decomposition and reduce occupation of quantum bits. In order to achieve the above object, according to a first aspect of the embodiments of the present application, there is provided a method for processing a data decomposition task, which is applied to a quantum processing unit, the data decomposition task being a task for performing integer decomposition on data to be decomposed, including: The method comprises the steps of receiving data to be decomposed, random numbers and a quantum data decomposition circuit sent by a classical processing unit, wherein the quantum data decomposition circuit comprises a plurality of cascaded modular multiplication units and control bits, and the control bits are used for sequentially controlling each modular multiplication unit to calculate preset exponent power of the random numbers and the modulus of the data to be decomposed; the quantum data decomposition circuit is operated, after the control bit controls the current modular multiplication unit to carry out modular multiplication operation, the quantum state of the control bit is measured, and the quantum state of the control bit is set to be zero state to control the next modular multiplication unit to carry out modular multiplication operation, so that a measurement result sequence is obtained; and sending the measurement result sequence to the classical processing unit so that the classical processing unit determines an integer decomposition result of the data to be decomposed according to the measurement result sequence. Optionally, the quantum data decomposition circuit further includes a first H gate, a phase rotation logic gate, and a second H gate that sequentially act on the control bit, where the first H gate acts on the control bit after the quantum state is set to a zero state, the phase rotation logic gate acts on the control bit after the control bit controls the modular multiplication unit to perform modular multiplication operation, and the second H gate acts on the control bit, and measures the quantum state of the control bit. Optionally, the matrix form of the phase rotation logic gate R K is: The parameter θ k of the phase rotation logic gate is calculated according to the following formula: Where k represents the kth time the rotary logic gate acts on the control bit, and m j represents the measurement result obtained by the jth measurement of the control bit. Optionally, the value range of the random number is [1, N-1], and the random number and the data to be decomposed are mutually prime. According to a second aspect of the embodiment of the present application, there is provided a method for processing a data decomposition task, where the method is applied to a classical processing unit, and includes: The data decomposition task is obtained and is a task for carrying out integer decomposition on data to be decomposed; Determining a random number according to the data to be decomposed, and constructing a quantum data decomposition circuit comprising a plurality of cascaded modular multiplication units and control bits, wherein the control bits are used for sequentially controlling each modular multiplication unit to calculate a preset exponent power of the random number and a module of the data to be decomposed; The data to be d