Skip to main content
Log in

An improved circuit for Shor’s factoring algorithm using \(2n+2\) qubits

  • Published:
Quantum Information Processing Aims and scope Submit manuscript

Abstract

Due to the existence of decoherence, researchers are limited in controlling large-scale qubits, which also prevents the application of Shor’s factoring algorithm in the case of large-scale qubits for the time being. To reduce the number of qubits required when using Shor’s factoring algorithm, by using borrowed ancilla qubits and reducing the number of gates in the constant addition circuit, a new quantum circuit for Shor’s factoring algorithm is proposed. The designed circuit works on \(2n+2\) qubits, in practice is about 35% and 40% less than the best circuit of Takahashi et al. (Quantum Inf Comput 5(6):440–448, 2005) and Haner et al. (Quantum Inf Comput 17(7 &8):673–684, 2017) in terms of depth and size, respectively. Also, the designed circuit is completely general, and it does not depend on any property of the composite number to be factorized. Finally, we use Python with Qiskit to implement and simulate our circuit.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Algorithm 1
Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12

Similar content being viewed by others

Data availability

All data generated or analyzed during this study are included in this published article.

References

  1. Haner, T., Roetteler, M., Svore, K.M.: Factoring using 2n+2 qubits with Toffoli based modular multiplication. Quantum Inf. Comput. 17(7 &8), 673–684 (2017). https://doi.org/10.26421/QIC17.7-8-7

    Article  MathSciNet  Google Scholar 

  2. Takahashi, Y., Kunihiro, N.: A quantum circuit for Shors factoring algorithm using 2n+2 qubits. Quantum Inf. Comput. 5(6), 440–448 (2005). https://doi.org/10.26421/QIC5.6-2

    Article  MathSciNet  MATH  Google Scholar 

  3. Liu, J., Wang, H., Ma, Z.: Optimization for Shors integer factorization algorithm circuit. Comput. Sci. (2022). https://doi.org/10.11896/jsjkx.210600149

    Article  Google Scholar 

  4. Cuccaro, S.A., Draper, T.G., Moulton, D.P., Kutin, S.A.: A new quantum ripple-carry addition circuit. Quantum Phys. (2004). https://doi.org/10.48550/arXiv.quant-ph/0410184

    Article  Google Scholar 

  5. Beauregard, S.: Circuit for Shors algorithm using 2n+3 qubits. Quantum Inf. Comput. 3(2), 175–185 (2003). https://doi.org/10.26421/QIC3.2-9

    Article  MathSciNet  MATH  Google Scholar 

  6. Draper, T.G.: Addition on a quantum computer. arXiv:quant-ph/0008033 (2000). Accessed 21 June 2023

  7. Parker, S., Plenio, M.B.: Efficient factorization with a single pure qubit and \(log\)N mixed qubits. Phys. Rev. Lett. 85(14), 3049–3052 (2000). https://doi.org/10.1103/PhysRevLett.85.3049. arXiv:quant-ph/0001066

    Article  ADS  Google Scholar 

  8. Fu, X., Bao, W., Zhou, C.: Speeding up implementation for Shors factorization quantum algorithm. Chin. Sci. Bull 55(32), 3648–3653 (2010). https://doi.org/10.1007/s11434-010-3039-1

    Article  Google Scholar 

  9. Monz, T., Nigg, D., Martinez, E.A., Brandl, M.F., Schindler, P., Rines, R., Wang, S.X., Chuang, I.L., Blatt, R.: Realization of a scalable Shor algorithm. Science 351(6277), 1068–1070 (2016). https://doi.org/10.1126/science.aad9480

    Article  MathSciNet  MATH  ADS  Google Scholar 

  10. Kitaev, A.Y.: Quantum measurements and the Abelian stabilizer problem. arXiv:quant-ph/9511026 (1995). Accessed 01 June 2023

  11. Nielsen, M.A., Chuang, I.L.: Quantum Computation and Quantum Information, 10th anniversary, ed Cambridge University Press, Cambridge; New York (2010)

  12. Cheung, D.: Improved bounds for the approximate QFT. arXiv:quant-ph/0403071 (2004). Accessed 20 April 2023

  13. Coppersmith, D.: An approximate Fourier transform useful in quantum factoring. arXiv:quant-ph/0201067 (2002). Accessed 20 June 2023

  14. Barenco, A., Ekert, A., Suominen, K.-A., Trm, P.: Approximate quantum Fourier transform and decoherence. Phys. Rev. A 54(1), 139–146 (1996). https://doi.org/10.1103/PhysRevA.54.139

    Article  MathSciNet  ADS  Google Scholar 

  15. Fowler, A.G., Hollenberg, L.C.L.: Scalability of Shors algorithm with a limited set of rotation gates. Phys. Rev. A 70(3), 032329 (2004). https://doi.org/10.1103/PhysRevA.70.032329

    Article  MathSciNet  MATH  ADS  Google Scholar 

  16. Nam, Y.S., Blümel, R.: Robustness and performance scaling of a quantum computer with respect to a class of static defects. Phys. Rev. A 88(6), 062310 (2013). https://doi.org/10.1103/PhysRevA.88.062310

    Article  ADS  Google Scholar 

  17. Nam, Y.S., Blümel, R.: Analytical formulas for the performance scaling of quantum processors with a large number of defective gates. Phys. Rev. A 92(4), 042301 (2015). https://doi.org/10.1103/PhysRevA.92.042301

    Article  ADS  Google Scholar 

  18. Maslov, D.: Linear depth stabilizer and quantum Fourier transformation circuits with no auxiliary qubits in finite neighbor quantum architectures. Phys. Rev. A 76(5), 052310 (2007). https://doi.org/10.1103/PhysRevA.76.052310. arXiv:quant-ph/0703211

    Article  ADS  Google Scholar 

  19. Takahashi, Y., Kunihiro, N., Ohta, K.: The quantum Fourier transform on a linear nearest neighbor architecture. Quantum Inf. Comput. 7(4), 383–391 (2007). https://doi.org/10.26421/QIC7.4-7

    Article  MathSciNet  MATH  Google Scholar 

  20. Maslov, D., Nam, Y.: Use of global interactions in efficient quantum circuit constructions. New J. Phys 20(3), 033018 (2018). https://doi.org/10.1088/1367-2630/aaa398

    Article  ADS  Google Scholar 

  21. Nam, Y., Su, Y., Maslov, D.: Approximate quantum Fourier transform with O(n log(n)) T gates. NPJ Quantum Inf 6(1), 26 (2020). https://doi.org/10.1038/s41534-020-0257-5

    Article  ADS  Google Scholar 

  22. Nam, Y.S., Blümel, R.: Scaling laws for shor’s algorithm with a banded quantum Fourier transform. Phys. Rev. A 87, 032333 (2013). https://doi.org/10.1103/PhysRevA.87.032333

    Article  ADS  Google Scholar 

  23. Ruiz-Perez, L., Garcia-Escartin, J.C.: Quantum arithmetic with the Quantum Fourier Transform. Quantum Information Processing 16(6), 152 (2017). https://doi.org/10.1007/s11128-017-1603-1. arXiv:1411.5949 [quant-ph]

    Article  MathSciNet  MATH  ADS  Google Scholar 

  24. Dobsicek, M., Johansson, G., Shumeiko, V.S., Wendin, G.: Arbitrary accuracy iterative phase estimation algorithm as a two qubit benchmark. Phys. Rev. A 76(3), 030306 (2007). https://doi.org/10.1103/PhysRevA.76.030306. arXiv:quant-ph/0610214

    Article  ADS  Google Scholar 

Download references

Acknowledgements

This work was partially supported by the National Natural Science Foundation of China under Grant No. 62376047, Henan Key Laboratory of Network Cryptography Technology under Grant No. LNCT2022-A15, Natural Science Foundation of Chongqing under Grant No. CSTB2023NSCQ-MSX1093.

Author information

Authors and Affiliations

Authors

Contributions

In fact, the contributions of all the authors of this article are significant. Their specific contributions are enumerated below. The first author played a pivotal role in directing the study and provided assistance with language issues encountered during the writing of the manuscript. The second author refined the study, including designing simulation experiments and conducting data analysis, as well as writing the main body of the manuscript. All authors reviewed the manuscript.

Corresponding author

Correspondence to Song Xiuli.

Ethics declarations

Conflict of interest

The authors declare no competing interests.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Xiuli, S., Liangsen, W. An improved circuit for Shor’s factoring algorithm using \(2n+2\) qubits. Quantum Inf Process 22, 402 (2023). https://doi.org/10.1007/s11128-023-04159-y

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s11128-023-04159-y

Keywords

Navigation