Skip to main content

Experiments and Resource Analysis of Shor’s Factorization Using a Quantum Simulator

  • Conference paper
  • First Online:
Information Security and Cryptology – ICISC 2023 (ICISC 2023)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 14561))

Included in the following conference series:

  • 70 Accesses

Abstract

Shor’s algorithm on actual quantum computers has succeeded only in factoring small composite numbers such as 15 and 21, and simplified quantum circuits to factor the specific integers are used in these experiments. In this paper, we factor 96 RSA-type composite numbers up to 9-bit using a quantum computer simulator. The largest composite number \(N=511\) was factored in approximately 2 h on the simulator. In our experiments, we implement Shor’s algorithm with basic circuit construction, which does not require complex tricks to reduce the number of qubits, and we give some improvements to reduce the number of gates, including MIX-ADD method. This is a flexible method for selecting the optimal ADD circuit which minimizes the number of gates from the existing ADD circuits for each of the many ADD circuits required in Shor’s algorithm. Based on our experiments, we estimate the resources required to factor 2048-bit integers. We estimate that the Shor’s basic circuit requires \(2.19 \times 10^{12}\) gates and \(1.76 \times 10^{12}\) depth when 10241 qubits are available, and \(2.37 \times 10^{14}\) gates and \(2.00 \times 10^{14}\) depth when 8194 qubits are available.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 59.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 74.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Very recently, Yan et al. proposed a new quantum factoring algorithm which requires a fewer number of qubits [21] and gave a new estimation for factoring 2048-bit integers. However, the validity of the algorithm and the correctness of the estimation are under the analysis.

References

  1. Amico, M., Saleem, Z.H., Kumph, M.: Experimental study of Shor’s factoring algorithm using the IBM Q Experience. Phys. Rev. A 100(1), 012305 (2019). https://doi.org/10.1103/PhysRevA.100.012305

    Article  Google Scholar 

  2. Arute, F., Arya, K., Babbush, R., Bacon, D., Bardin, J.C., Barends, R., et al.: Quantum supremacy using a programmable superconducting processor. Nature 574(7779), 505–510 (2019). https://doi.org/10.1038/s41586-019-1666-5

    Article  Google Scholar 

  3. Barenco, A., Bennett, C.H., Cleve, R., DiVincenzo, D.P., Margolus, N., Shor, P., et al.: Elementary gates for quantum computation. Phys. Rev. A 52(5), 3457 (1995). https://doi.org/10.1103/PhysRevA.52.3457

    Article  Google Scholar 

  4. Beauregard, S.: Circuit for Shor’s algorithm using 2n+3 qubits. arXiv preprint quant-ph/0205095 (2002). https://doi.org/10.48550/arXiv.quant-ph/0205095

  5. Beckman, D., Chari, A.N., Devabhaktuni, S., Preskill, J.: Efficient networks for quantum factoring. Phys. Rev. A 54(2), 1034 (1996). https://doi.org/10.1103/PhysRevA.54.1034

    Article  MathSciNet  Google Scholar 

  6. Boudot, F., Gaudry, P., Guillevic, A., Heninger, N., Thomé, E., Zimmermann, P.: Factorization of RSA-250 (2020). https://web.archive.org/web/20200228234716/. https://lists.gforge.inria.fr/pipermail/cado-nfs-discuss/2020-February/001166.html

  7. Draper, T.G.: Addition on a quantum computer. arXiv preprint quant-ph/0008033 (2000). https://doi.org/10.48550/arXiv.quant-ph/0008033

  8. Gidney, C., Ekerå, M.: How to factor 2048 bit RSA integers in 8 hours using 20 million noisy qubits. Quantum 5, 433 (2021). https://doi.org/10.22331/q-2021-04-15-433

    Article  Google Scholar 

  9. Gouzien, E., Sangouard, N.: Factoring 2048-bit RSA integers in 177 days with 13 436 qubits and a multimode memory. Phys. Rev. Lett. 127(14), 140503 (2021). https://doi.org/10.1103/PhysRevLett.127.140503

    Article  Google Scholar 

  10. IBM: 433-qubits quantum processor, Osprey. https://research.ibm.com/blog/next-wave-quantum-centric-supercomputing

  11. Imamura, S., Yamazaki, M., Honda, T., Kasagi, A., Tabuchi, A., Nakao, H., et al.: mpiqulacs: a distributed quantum computer simulator for A64FX-based cluster systems. arXiv preprint arXiv:2203.16044 (2022). https://doi.org/10.48550/arXiv.2203.16044

  12. Kunihiro, N.: Exact analyses of computational time for factoring in quantum computers. IEICE Trans. Fundam. Electron. Commun. Comput. Sci. 88(1), 105–111 (2005). https://doi.org/10.1093/ietfec/e88-a.1.105

    Article  Google Scholar 

  13. Lanyon, B.P., Weinhold, T.J., Langford, N.K., Barbieri, M., James, D.F., Gilchrist, A., et al.: Experimental demonstration of a compiled version of Shor’s algorithm with quantum entanglement. Phys. Rev. Lett. 99(25), 250505 (2007). https://doi.org/10.1103/PhysRevLett.99.250505

    Article  Google Scholar 

  14. Lu, C.Y., Browne, D.E., Yang, T., Pan, J.W.: Demonstration of a compiled version of Shor’s quantum factoring algorithm using photonic qubits. Phys. Rev. Lett. 99(25), 250504 (2007). https://doi.org/10.1103/PhysRevLett.99.250504

    Article  Google Scholar 

  15. Lucero, E., Barends, R., Chen, Y., Kelly, J., Mariantoni, M., Megrant, A., et al.: Computing prime factors with a Josephson phase qubit quantum processor. Nat. Phys. 8(10), 719–723 (2012). https://doi.org/10.1038/nphys2385

    Article  Google Scholar 

  16. Martin-Lopez, E., Laing, A., Lawson, T., Alvarez, R., Zhou, X.Q., O’brien, J.L.: Experimental realization of Shor’s quantum factoring algorithm using qubit recycling. Nat. Photonics 6(11), 773–776 (2012). https://doi.org/10.1038/nphoton.2012.259

    Article  Google Scholar 

  17. Politi, A., Matthews, J.C., O’brien, J.L.: Shor’s quantum factoring algorithm on a photonic chip. Science 325(5945), 1221–1221 (2009). https://doi.org/10.1126/science.1173731

    Article  MathSciNet  Google Scholar 

  18. Shor, P.W.: Algorithms for quantum computation: discrete logarithms and factoring. In: 35th FOCS, pp. 124–134. IEEE Computer Society Press (1994). https://doi.org/10.1109/SFCS.1994.365700

  19. Suzuki, Y., Kawase, Y., Masumura, Y., Hiraga, Y., Nakadai, M., Chen, J., et al.: Qulacs: a fast and versatile quantum circuit simulator for research purpose. Quantum 5, 559 (2021). https://doi.org/10.22331/q-2021-10-06-559

    Article  Google Scholar 

  20. Vedral, V., Barenco, A., Ekert, A.: Quantum networks for elementary arithmetic operations. Phys. Rev. A 54(1), 147 (1996). https://doi.org/10.1103/PhysRevA.54.147

    Article  MathSciNet  Google Scholar 

  21. Yan, B., Tan, Z., Wei, S., Jiang, H., Wang, W., Wang, H., et al.: Factoring integers with sublinear resources on a superconducting quantum processor. arXiv preprint arXiv:2212.12372 (2022). https://doi.org/10.48550/arXiv.2212.12372

Download references

Acknowledgments

We would like to thank Shintaro Sato, Hirotaka Oshima, Kazunori Maruyama, Masayoshi Hashima and Kohta Nakashima from Fujitsu for their efforts in using the quantum computer simulator. The sixth author conducted the research supported by JST CREST JPMJCR2113 and JPSP KAKENHI Grant Number JP21H03440.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Junpei Yamaguchi .

Editor information

Editors and Affiliations

Appendices

Appendix 1. Examples of Greedy Method

Figure 6 shows an example of our greedy method for \(k=4, c=1\), and Fig. 7 for \(k=5, c=1, 2\). The number of Toffoli gates is 6 for \(k=4, c=1\), 8 for \(k=5, c=2\), and 10 for \(k=5, c=1\), which matches \(4k-8-2c\).

Appendix 2. Effectiveness of Greedy Method

In order to show the superiority of our greedy method, we factored RSA-type composite numbers up to 7-bit with 1-node, without and with the greedy method for GT-ADD. Results are summarized in Table 5, where results in the ‘Greedy’ column coincide with the results shown at ‘GT-ADD’ column in Table 2. As shown in the table, the greedy method reduces the number of gates to about 66–71%, and the depth to about 45–56%. Since the generated Toffoli gates by the greedy method can be parallelized easily, the effect on the depth is much larger than that on the number of gates. Our analysis in Sect. 3.2 shows that the greedy method reduces the number of gates to about \(56.25\%\) (calculated as \(3/(16/3) \times 100\)) when n is sufficiently large.

Appendix 3. Data for Circuit Estimation in Sect. 4.3

Figure 8 shows the average values and the approximation polynomials described in Sect. 4.3. Table 6 summarizes the average values, lowest values, and highest values for the R-ADD case. There is virtually no difference between them.

Fig. 6.
figure 6

Conversion from a C\(^4\)-NOT to C\(^2\)-NOTs with 1 clean qubit

Fig. 7.
figure 7

Conversion from a C\(^5\)-NOT to C\(^2\)-NOTs

Table 5. Factorization of N with GT-ADD without and with the greedy method
Fig. 8.
figure 8

Average values of the number of gates and the depth of Shor’s circuit for n-bit integers. The dashed lines represent approximation polynomials.

Table 6. Resources of optimized Shor’s circuit with R-ADD

Rights and permissions

Reprints and permissions

Copyright information

© 2024 The Author(s), under exclusive license to Springer Nature Singapore Pte Ltd.

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Yamaguchi, J., Yamazaki, M., Tabuchi, A., Honda, T., Izu, T., Kunihiro, N. (2024). Experiments and Resource Analysis of Shor’s Factorization Using a Quantum Simulator. In: Seo, H., Kim, S. (eds) Information Security and Cryptology – ICISC 2023. ICISC 2023. Lecture Notes in Computer Science, vol 14561. Springer, Singapore. https://doi.org/10.1007/978-981-97-1235-9_7

Download citation

  • DOI: https://doi.org/10.1007/978-981-97-1235-9_7

  • Published:

  • Publisher Name: Springer, Singapore

  • Print ISBN: 978-981-97-1234-2

  • Online ISBN: 978-981-97-1235-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics