Optimization method of Shor's algorithm based on controlled exchange gate
By replacing the modular exponential operator in Shor's algorithm with a controlled exchange gate and performing group merging processing, the quantum circuit is optimized, the performance limitation of quantum computers in prime factorization is solved, and the computing efficiency and accuracy are improved.
Patent Information
- Application Number
- CN202510861253.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-25
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2045-06-25
AI Technical Summary
Current quantum computers find it difficult to effectively solve the highly complex prime factorization problem. Due to factors such as the limited number of quantum bits, short coherence time, and high gate operation error rate, the calculation results of the Shor algorithm are prone to errors in practical applications.
By replacing the modular exponential operator in Shor's algorithm with a controlled exchange gate and grouping and merging the controlled exchange gates, the quantum circuit is optimized, and the depth of the quantum circuit and the number of required quantum bits are reduced.
The optimized Shor algorithm can operate within the performance limitations of quantum computers, improving the efficiency and accuracy of prime factorization and promoting larger-scale experiments.
Smart Images

Figure CN120354961B_ABST
Abstract
Claims
1. An optimization method of Shor's algorithm based on controlled exchange gate, characterized in that: The method comprises: Based on the Shor algorithm, an initial quantum circuit is determined according to the target problem to be processed; converting a modular exponential operator in the initial quantum circuit into a controlled exchange gate to determine a first quantum circuit; performing grouping and merging processing on the controlled switching gates in the first quantum circuit to determine a first target quantum circuit to optimize the Shor algorithm; The grouping and merging of the controlled switching gates in the first quantum circuit to determine the first target quantum circuit includes: performing grouping processing on the controlled switching gates in the first quantum circuit based on a preset grouping rule to determine a first temporary quantum circuit, wherein the first temporary quantum circuit includes at least one group of target controlled switching gates having different control bits and the same controlled bits; Determining target quantum gate information and a second temporary quantum circuit according to the first temporary quantum circuit; The first target quantum circuit is determined according to the target quantum gate information and the second temporary quantum circuit.
2. The method according to claim 1, characterized in that The method of determining an initial quantum circuit based on the Shor algorithm and the target problem to be processed includes: Based on the Shor algorithm and the target problem, determining a basis, where the basis is coprime to the integer to be decomposed in the target problem and is smaller than the integer to be decomposed; Determining the number of phase qubits according to the target problem, wherein the number of phase qubits is used to record phase information generated by running the Shor algorithm; Determining the number of operation qubits according to the target problem, where the number of operation qubits is used to record quantum state information generated by running the modular exponential operator; The initial quantum circuit is determined according to the basis, the number of phase quantum bits, and the number of operation quantum bits.
3. The method according to claim 2, characterized in that The determining of the initial quantum circuit according to the basis, the number of phase qubits, and the number of operation qubits includes: Determining the modular exponential operator according to the basis, the number of phase qubits, and the integer to be decomposed; The initial quantum circuit is determined according to the basis, the number of phase quantum bits, the number of operation quantum bits, and the modular exponential operator.
4. The method according to claim 1, wherein The determining, according to the first temporary quantum circuit, target quantum gate information and a second temporary quantum circuit includes: Based on a preset merging rule, the target controlled switching gates are merged to determine the target quantum gate information and the second temporary quantum circuit.
5. The method according to claim 1, wherein The determining the first target quantum circuit according to the target quantum gate information and the second temporary quantum circuit includes: Based on a preset decomposition rule, the quantum gate in the target quantum gate information is decomposed to determine the first target quantum circuit.
6. The method according to claim 1, characterized in that The method further comprises: performing identification processing on the first target quantum circuit to determine the existence of a first circuit property of the first target quantum circuit; determining a second quantum circuit based on the existence of the first circuit property; A second target quantum circuit is determined based on the second quantum circuit to optimize the Shor algorithm.
7. The method according to claim 6, characterized in that The first circuit properties include controlled non-gate symmetry, controlled bit reciprocity, operation commutativity, and operation determinism. Determining the second quantum circuit based on the existence of the first circuit properties includes: In a case where the first target quantum circuit has the controlled NOT gate symmetry, the controlled bit reciprocity, and the operational commutativity, adjusting the controlled NOT gate in the first target quantum circuit based on the controlled NOT gate symmetry, the controlled bit reciprocity, and the operational commutativity to determine the second quantum circuit; or In a case where the first target quantum circuit has the operational certainty, the first target quantum circuit is optimized based on the operational certainty to determine the second quantum circuit.
8. The method according to claim 6, characterized in that The determining of the second quantum circuit according to the existence of the first circuit property includes: In a case where the first circuit property does not exist, the first target quantum circuit is determined to be the second target quantum circuit.
9. The method according to claim 6, characterized in that Determining a second target quantum circuit based on the second quantum circuit to optimize the Shor algorithm includes: performing identification processing on the second quantum circuit to determine the existence of the second circuit property of the second quantum circuit; determining a second quantum circuit according to the existence of the second circuit property; A second target quantum circuit is determined based on the second quantum circuit to optimize the Shor algorithm.
Citation Information
Patent Citations
Resource estimation method and system for quantum program
CN117744825A