Journal of Machine and Computing


Performance Evaluation of Shor Algorithm on Simulated Quantum Hardware with Circuit Level Analysis



Journal of Machine and Computing

Received On : 28 March 2025

Revised On : 10 May 2025

Accepted On : 19 June 2025

Published On : 05 July 2025

Volume 05, Issue 03

Pages : 1944-1957


Abstract


Shor’s algorithm stands as a breakthrough in quantum computing due to its potential to factor large integers exponentially quicker than classical algorithms. However, implementing and evaluating this algorithm on real quantum computer hardware remains exciting due to qubit limitations, gate noise, and hardware constraints. This research presents a comprehensive performance evaluation of Shor’s algorithm using simulated quantum backends provided by Qiskit. A flexible and generic implementation is proposed, allowing dynamic input of integers to be factored, with randomized co-prime selection and automated circuit generation. The algorithm is tested on various semiprime numbers, such as 15, 21, and 35, using IBM’s Aer simulator. A major contribution of this work is the circuit-level analysis conducted both before and after transpilation. Metrics such as gate counts, circuit depth, and simulator runtime are extracted to assess scalability and resource requirements. High-resolution plots of the pre-transpiled circuits are saved to visualize algorithmic complexity, while post-transpilation metrics inform future quantum hardware feasibility. The output measurement distributions are analyzed to estimate periodicity and derive correct factors. The proposed implementation is compared with existing fixed-instance Shor demonstrations to highlight its flexibility and extensibility. Experimental results show consistent success in factor retrieval and provide valuable insight into circuit growth and complexity under realistic constraints. This analysis lays the groundwork for future adaptation to NISQ hardware and contributes to understanding Shor’s algorithm from both computational and architectural perspectives.


Keywords


Shor’s Algorithm, Qiskit Simulation, Quantum Circuit Analysis, Quantum-Classical Comparison.


  1. B. Ilkhom, A. Khan, R. Das, and B. Abdurakhimov, “A Novel Approach to Integer Factorization: A Paradigm in Cryptography,” Concurrency and Computation: Practice and Experience, vol. 37, no. 3, Jan. 2025, doi: 10.1002/cpe.8365.
  2. T. Thamaraimanalan, B. Singh, M. Mohankumar, and S. K. Korada, “Performance Analysis of Shor’s Algorithm for Integer Factorization Using Quantum and Classical Approaches,” 2024 10th International Conference on Advanced Computing and Communication Systems (ICACCS), pp. 2591–2595, Mar. 2024, doi: 10.1109/icaccs60874.2024.10717174.
  3. P. Pallab and A. Das, “AVX-512-based Parallelization of Block Sieving and Bucket Sieving for the General Number Field Sieve Method,” Proceedings of the 18th International Conference on Security and Cryptography, pp. 653–658, 2021, doi: 10.5220/0010515200002998.
  4. A. Wichert, “Quantum Fourier Transform,” Quantum Artificial Intelligence with Qiskit, pp. 246–254, Nov. 2023, doi: 10.1201/9781003374404-19.
  5. https://www.nist.gov/quantum-information-science/quantum-computing-explained.
  6. A. Bnouhachem, “A hybrid iterative method for a combination of equilibria problem, a combination of variational inequality problems and a hierarchical fixed point problem,” Fixed Point Theory and Applications, vol. 2014, no. 1, Jul. 2014, doi: 10.1186/1687-1812-2014-163.
  7. P. W. Shor, “Algorithms for quantum computation: discrete logarithms and factoring,” Proceedings 35th Annual Symposium on Foundations of Computer Science, pp. 124–134, doi: 10.1109/sfcs.1994.365700.
  8. C. Gidney and M. Ekerå, “How to factor 2048 bit RSA integers in 8 hours using 20 million noisy qubits,” Quantum, vol. 5, p. 433, Apr. 2021, doi: 10.22331/q-2021-04-15-433.
  9. C. Yi, C. Zhou, and J. Takahashi, “Quantum Phase Estimation by Compressed Sensing,” Quantum, vol. 8, p. 1579, Dec. 2024, doi: 10.22331/q-2024-12-27-1579.
  10. T. Haner, M. Roetteler, and K. M. Svore, “Factoring using 2n+2 qubits with Toffoli based modular multiplication,” Quantum Information and Computation, vol. 17, no. 7 & 8, pp. 673–684, May 2017, doi: 10.26421/qic17.7-8-7.
  11. Z.-Y. Han, J. Wang, H. Fan, L. Wang, and P. Zhang, “Unsupervised Generative Modeling Using Matrix Product States,” Physical Review X, vol. 8, no. 3, Jul. 2018, doi: 10.1103/physrevx.8.031012.
  12. D. Willsch, M. Willsch, F. Jin, H. De Raedt, and K. Michielsen, “Large-Scale Simulation of Shor’s Quantum Factoring Algorithm,” Mathematics, vol. 11, no. 19, p. 4222, Oct. 2023, doi: 10.3390/math11194222.
  13. V. Silva, “Qiskit, Awesome SDK for Quantum Programming in Python,” Quantum Computing by Practice, pp. 189–228, Dec. 2023, doi: 10.1007/978-1-4842-9991-3_6.
  14. T. Lawson, “Odd orders in Shor’s factoring algorithm,” Quantum Information Processing, vol. 14, no. 3, pp. 831–838, Jan. 2015, doi: 10.1007/s11128-014-0910-z.
  15. W. Tan, X. Wang, X. Lou, and M. Pan, “Analysis of RSA based on Quantitating Key Security Strength,” Procedia Engineering, vol. 15, pp. 1340–1344, 2011, doi: 10.1016/j.proeng.2011.08.248.
  16. M. MohanKumar, B. Singh, T. Thamaraimanalan, S. K. Korada, P. Yuvaraj, and S. Jyothikamalesh, “Quantum Key Recovery Attack on Simplified Grain 4-Bit Cipher Using Grover’s Algorithm,” 2024 10th International Conference on Advanced Computing and Communication Systems (ICACCS), pp. 2596–2601, Mar. 2024, doi: 10.1109/icaccs60874.2024.10716920.

CRediT Author Statement


The authors confirm contribution to the paper as follows:

Conceptualization:Thamaraimanalan T, Anandakumar Haldorai; Methodology: Thamaraimanalan T and Anandakumar Haldorai; Software: Mariyappan K and Arulmurugan Ramu; Data Curation: Thamaraimanalan T and Anandakumar Haldorai; Writing- Original Draft Preparation: Thamaraimanalan T, Anandakumar Haldorai; Visualization: Thamaraimanalan T and Anandakumar Haldorai; Investigation: Mariyappan K and Arulmurugan Ramu; Supervision: Thamaraimanalan T and Anandakumar Haldorai; Validation: Mariyappan K and Arulmurugan Ramu; Writing- Reviewing and Editing: Thamaraimanalan T, Anandakumar Haldorai, Mariyappan K and Arulmurugan Ramu; All authors reviewed the results and approved the final version of the manuscript.


Acknowledgements


Authors thank Reviewers for taking the time and effort necessary to review the manuscript.


Funding


No funding was received to assist with the preparation of this manuscript.


Ethics declarations


Conflict of interest

The authors have no conflicts of interest to declare that are relevant to the content of this article.


Availability of data and materials


Data sharing is not applicable to this article as no new data were created or analysed in this study.


Author information


Contributions

All authors have equal contribution in the paper and all authors have read and agreed to the published version of the manuscript.


Corresponding author


Rights and permissions


Open Access This article is licensed under a Creative Commons Attribution NoDerivs is a more restrictive license. It allows you to redistribute the material commercially or non-commercially but the user cannot make any changes whatsoever to the original, i.e. no derivatives of the original work. To view a copy of this license, visit https://creativecommons.org/licenses/by-nc-nd/4.0/


Cite this article


Thamaraimanalan T, Anandakumar Haldorai, Arulmurugan Ramu and Mariyappan K, “Performance Evaluation of Shor Algorithm on Simulated Quantum Hardware with Circuit Level Analysis”, Journal of Machine and Computing, vol.5, no.3, pp. 1944-1957, July 2025, doi: 10.53759/7669/jmc202505152.


Copyright


© 2025 Thamaraimanalan T, Anandakumar Haldorai, Arulmurugan Ramu and Mariyappan K. This is an open access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.