Open Access
ARTICLE
A Technical Note for a Shor’s Algorithm by Phase Estimation
Université Clermont-Auvergne, Clermont-Auvergne-INP, LIMOS – UMR CNRS 6158, 1 rue de la Chébarde, 63178, Aubière Cedex, France
* Corresponding Author: Philippe Lacomme. Email:
Journal of Quantum Computing 2022, 4(2), 97-111. https://doi.org/10.32604/jqc.2022.032973
Received 03 June 2022; Accepted 23 March 2023; Issue published 16 May 2023
Abstract
The objective of this paper concerns at first the motivation and the method of Shor’s algorithm including remarks on quantum computing introducing an algorithmic description of the method. The corner stone of the Shor’s algorithm is the modular exponentiation that is the most computational component (in time and space). A linear depth unit based on phase estimation is introduced and a description of a generic version of a modular multiplier based on phases is introduced to build block of a gates to efficient modular exponentiation circuit. Our proposal includes numerical experiments achieved on both the IBM simulator using the Qiskit library and on quantum physical optimizers provided by IBM. The shor’s algorithm based on phase estimation succeeds in factoring integer numbers with more than 35 digits using circuits with about 100 qubits.Keywords
The most famous quantum algorithm is the Shor’s algorithms that is dedicated to integer factorization and that received a considerable amount of attention due to its possible application in the cryptanalysis field. The algorithm proposes a super-polynomial execution speedup as regards the classical resolution on classical computers. The RSA encryption method lies on the hypothesis that it is exponentially harder to factor large numbers that achieving a multiplication ensuring secure send of information online. Shor’s factoring algorithm uses an efficient combination of regular and quantum computers, i.e., a hybrid computing approach where the regular computers and the quantum ones are paired into an iterative process [1]. Such approaches received a lot of attention leading to several variational algorithms including but not limited to QAOA [2,3].
Feynman has been the very first researcher considering that quantum mechanics could be more efficient computationally than a Turing machine considering that a computer based on quantum mechanics should avoid the expensive computation required for simulation on a classical computer. The question has been addressed first by [4] proving that some problems can be solved fast to optimality using quantum computers. In 1994 [5] introduced a circuit using an oracle to solve a problem (i.e., a black-box that can be checked) requiring a polynomial time since it requires an exponential time on a classical non quantum computer. Shor [6] introduced a quantum computer algorithm for factoring a integer number
Finding a factor of
If
And the Euclidean algorithm of [8] can be used to compute the
If
Note that the “necessary” conditions at steps 8, 9 and 24 have to be design over considerations of the objective function that could be, but not limited to: 1) computation of one divider only; 2) computation of a fixed number of dividers; 3) computation of all dividers.
2.1 Shor’s Quantum Circuit Based on Phase
Given
The second step is easy since its entails is putting each qubit of the first register into the superposition
The most computational quantum part of the classical Shor’s algorithm is the modular exponentiation
The Hadamard gates on the first
Classical modular exponentiations are based on: 1) controlled multiplier/accumulator [9,10]; 2) quantum divider based on the algorithm introduced by [11].
We propose to replace the modular exponentiation
The Hadamard gates at the first
The classical post-processing of the measurement in the computational basis after the Inverse Quantum Fourier Transform (
During post-processing, all the phases
For all
For all
2.2 Quantum Fourier Transformation
For
By consequence
2.3 Modular Exponentiation of the Phase:
The design uses
The design uses
Definition of
Let us note
The phase of
The modular exponentiation
i.e., the computation of
We note
For example with
We have next:
Definition of
A controlled
Matrix representation of
that is transformed by a simple uncontrolled Inverse Quantum Fourier Transformation into a quantum state
We have:
and the individual
With the following examples, the objective is to illustrate the performances of this phase based Shor’s algorithm on both simulator and physical quantum optimizer. Experiments are achieved considering 5 large numbers (introduced in Table 1) with a number of dividers that varies from 4 to 24.
The number of qubits required depends on both
Experiments have been achieved on the Brooklyn Quantum Physical Optimizers introduced in Table 2 and has been chosen taking into account the individual optimizers availabilities and the total pending jobs involved in experiments with the potential to lead the results in acceptable delays at the particular moment. Note that preliminary experiments achieved on Auckland, Montreal and Washington quantum optimizers push us into considering that very similar results should be obtained. Let us note that the Brooklyn physical quantum optimizer is not the best one in term of number of qubits and it is not the more efficient as regards the quantum volume.
3.1 Numerical Experiments with 1591
For the small
The phases in
3.2 Numerical Experiments on Simulator when Factoring 3 131 759
Execution of the simulator for
3.3 Numerical Experiments for 3 Numbers: Dividers Obtained for 3 Small Numbers
Table 5 gives the observed values of the phase and the dividers obtained when factoring 844 821 with
The last number 1660759 has two non-trivial dividers only (
3.4 Numerical Experiments on IBM Programmable Noisy Quantum Optimizer for Large Number
An attempt for 3 131 759 factorization is achieved with 5 run and
The algorithm succeeds in factoring the large number 327 131 761 and using several run (5 runs are used in the experiments) several dividers are computed including large dividers. Note that the sampling parameters could have to be tune considering a balance between runs and number of sampling efforts.
Half of the dividers of 327 131 767 are computing on a single run for
3.5 Extra Experiments with Very Large Numbers
Experiments have been carried out with the following numbers 298500156599, 23750433609940 4000, 237504336099404013, and 237504336099404017 that require more than 60 qubits.
To conclude, a set of experiments have been achieved on the Washington physical quantum optimizer using
All the results are introduced in Table 7 and confirm the approach efficiency.
Considering the factorization of a large constant is a challenging problem that can be addressed using a modular multiplier based on phases to build block of a modular exponentiation circuit. Such approach is theoretically accurate taking advantages of the well-known phase definition
Because of the effectiveness of our models for modular computation that defines compact circuit in both number of qubits and number of gates, our model has permit successful experimentations on physical quantum optimizer for very large integer numbers requiring circuit with more than 100 qubits. The promise of quantum physical optimizers with more than
Acknowledgement: Thanks to E. Bourreau for constant support and help in quantum computing research activities.
Funding Statement: The authors received no specific funding for this study.
Conflicts of Interest: The authors declare that they have no conflicts of interest to report regarding the present study.
References
1. S. Sahoo, A. Kumar Mandal, P. Kanti Samanta, I. Basu and P. Roy, “A critical overview on quantum computing,” Journal of Quantum Computing, vol. 2, no. 4, pp. 181–192, 2020. [Google Scholar]
2. E. Farhi and J. Goldstone, A Quantum Approximate Optimization Algorithm. Report MIT-CTP/4610. arXiv:1411.4028v1. 2014. [Google Scholar]
3. M. Medvidović and G. Carleo, “Classical variational simulation of the quantum approximate optimization algorithm,” npj Quantum Inf., vol. 7, no. 1, pp. 101, 2021. https://doi.org/10.1038/s41534-021-00440-z [Google Scholar] [CrossRef]
4. D. Deutsch and R. Jozsa, “Rapid solutions of problems by quantum computation,” in Proc. of the Royal Society of London A, vol. 439, pp. 553–558, 1992. https://doi.org/10.1098/rspa.1992.0167 [Google Scholar] [CrossRef]
5. D. R. Simon, “On the power of quantum computation,” in Proc. of the 35th Annual Symp. on Foundations of Computer Science, Santa Fe, pp. 116–123, 1994. https://doi.org/10.1109/SFCS.1994.365701 [Google Scholar] [CrossRef]
6. P. Shor, “Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer,” in Proc. of the 35th Annual Symp. on Foundations of Computer Science, Santa Fe, NM, 1994. https://arXiv:quant-ph/9508027 [Google Scholar]
7. A. Pavlidis and D. Gizopulous, “Fast quantum modular exponentiation architecture for shor’s factoring algorithm,” Quantum Information and Computation, vol. 14, no. 7–8, pp. 649–682, 2014. [Google Scholar]
8. D. E. Knuth, The Art of Computer Programming, Second Edition ed., vol. 2: Semi-numerical Algorithms. Addison-Wesley, 1981. https://www-cs-faculty.stanford.edu/~knuth/taocp.html [Google Scholar]
9. T. G. Draper, “Addition on a quantum computer,” arXiv preprint quant-ph/0008033. 2000. [Google Scholar]
10. S. Beauregard, “Circuit for Shor’s algorithm using 2n+3 qubits,” Quantum Information and Computation, vol. 3, pp. 175–185, 2003. [Google Scholar]
11. T. Granlund and P. L. Montgomery, “Division by invariant integers using multiplication,” in Proc. of the ACM SIGPLAN, Conf. on Programming Language Design and Implementation (PLDI), Orlando Florida USA, vol. 29, pp. 61–72, 1994. [Google Scholar]
Cite This Article
This work is licensed under a Creative Commons Attribution 4.0 International License , which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.