Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Log inSign up
Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Blog
Job Board
Q3AS

© 2026 Aqora Quantum S.A.S.

TermsPrivacyLegal Notice

Optimizing Shor’s algorithm through approximate fractions for quantum factorization

Pablo Fernández-Alegre, Luis de Pedro, Jorge E. López de Vergara

Published Oct 8, 2024• 0 citations
Publisher

Abstract

Abstract This paper presents a way to increase the success of Shor's algorithm by applying a well-known procedure to the results. The work leverages the continued fractions algorithm, a key component of Shor’s algorithm, to find close approximations when the initial estimation is insufficient. Factorization may still be achieved with these close fractions if their denominators are multiples of the exact fraction denominator. By implementing this approach with Qiskit and Beauregard’s version of Shor’s algorithm, we demonstrate a significant enhancement in its success rate in a quantum computer.

DOI
10.21203/rs.3.rs-5031635/v1

Related papers

Enhanced Security Algorithm for Integer Factorization in Quantum Computing: Optimizing Shor’s Algorithm

Rashmi Kuksal, Sumit Chaudhary, Ashish Bhatt

With the rise of large-scale quantum computers, it becomes difficult to sustain the security principles of popular public-key encryption systems, including RSA, which is based on the classical problem of integer factorization. Shor’s algorithm suggests that a large enough quantum computer may find factors of an n-bit integer in polynomial time, thus becoming a threat to RSA and similar encryption techniques once the technology of fault-tolerant hardware reaches maturity. However, current implementation is subject to several limitations regarding the number of qubits available, circuit depth, and the vulnerability to decoherence in NISQ computing. The proposed algorithm in this work provides an improved version of Shor’s algorithm that implements classical pre-processing heuristics, adaptive choice of bases, a low-depth circuit for modular exponentiation, and a compressed approximate quantum Fourier transform (AQFT) step to minimize qubit usage and depth while preserving the accuracy of period finding. The simulation results performed for different modulus sizes from 8 to 256 bits show that the suggested approach allows for reducing the number of logical qubits by about 29% and increases the success rate of the algorithm from 41% to 63%. The security considerations of such optimizations concerning the timelines of migrating from existing cryptographic systems to post-quantum systems will be addressed, as well as the possible approaches to hybrid classical and quantum factorization pipelines.

International Conference on Innovative Mechanisms for Industry Applications•Oct 1, 2026•0 citations

Continued Fractions and Probability Estimations in Shor’s Algorithm: A Detailed and Self-Contained Treatise

Johanna Barzen, Frank Leymann

Shor’s algorithm for prime factorization is a hybrid algorithm consisting of a quantum part and a classical part. The main focus of the classical part is a continued fraction analysis. The presentation of this is often short, pointing to text books on number theory. In this contribution, we present the relevant results and proofs from the theory of continued fractions in detail (even in more detail than in text books), filling the gap to allow a complete comprehension of Shor’s algorithm. Similarly, we provide a detailed computation of the estimation of the probability that convergents will provide the period required for determining a prime factor.

arXiv:2205.01925•AppliedMath•Jul 18, 2022•4 citations

Analyze Shor Algorithm Optimization Trends and Suggest Optimization Directions

Jaehan Cho, Dawit Shin, Yeonjeong Hwang +1 more

Quantum computers leverage the principles of quantum mechanics to solve complex problems beyond the capabilities of classical computers, such as prime factorization, which poses a significant threat to cryptographic algorithms like RSA and ECC. Although current quantum resources are insufficient for effective decryption, ongoing research focuses on optimizing Shor's algorithm to overcome these limitations. Shor's algorithm, a quantum algorithm designed for efficient integer factorization, exploits quantum parallelism and entanglement to perform prime factorization exponentially faster than classical algorithms. This paper reviews recent trends in Shor algorithm optimization, particularly in enhancing the efficiency of ripple-carry operators and the Karatsuba algorithm in multiplication and proposes a multiplication method that applies the Strassen algorithm to constant adders

International Conference on Platform Technology and Service•Aug 26, 2024•2 citations

Implementing Shor’s algorithm in a quantum computing simulation environment for educational purposes

Syed Muhammad Muneeb Ali, Monika Wolfmayr

This article presents a detailed implementation of Shor’s quantum factoring algorithm, which served as the cornerstone for a pilot project at Jamk University of Applied Sciences. The primary goal was to leverage this significant algorithm to establish and validate a reusable quantum simulation environment on a high-performance computing (HPC) platform. We report the successful factorization of the integer 15, executed on the Finnish CSC’s MAHTI supercomputer using a 9-qubit quantum circuit developed in the Qiskit framework. This work provides a comprehensive overview of the principles behind Shor’s algorithm and a methodical breakdown of its simulation. Furthermore, it documents the practical software challenges faced during the environment’s configuration, focusing on library versioning and dependencies. The purpose of this work is to provide a systematic introduction to implement Shor’s algorithm at computer science or applied mathematics classes in institutions of higher education such as universities of applied sciences. The successful factorization provides an initial validation of the simulation workflow for this benchmark case, while the detailed account of implementing Shor’s algorithm offers a practical guide and valuable insights for future quantum computing initiatives at educational institutions with a focus on computer science or scientific computing.

Discover Education•Aug 6, 2026•0 citations

Circuit implementation of Shor's algorithm for the factorization of small integers in Qiskit

Iheb Eddine Gharbi, Amor Gueddana, Hichem Eleuch +1 more

To factor an integer N into a product of two other numbers N1 and N2, Shor’s algorithm uses the Quantum Fourier Transform on n qubits, denoted QFTn, to determine the period r of a Modular Exponentiation Function (MEF), which is later used to compute a factor of N. In this work, we present Shor’s algorithm for factoring an integer of n qubits and illustrate an example with n=4. We implement our algorithm using Qiskit and IBM quantum computers, which also can be adapted on other quantum computing platforms with minor adjustments. We discuss the IBM quantum computer limitations for running our circuit and show the impact of device imperfections on the factored result.

Quantum Communications and Quantum Imaging•Aug 13, 2024•3 citations

Near term implementation of Shor's Algorithm using Qiskit

Casimer M. DeCusatis, Emily Mcgettrick

Although the fundamental principles of quantum computing have been known for decades, it is only within the past few years that practical quantum computers have become available. Since these systems are limited to a small number of qubits, they cannot demonstrate quantum advantage for many practical problems. Accordingly, there has been an effort to develop near term implementations of algorithms purely for research and education. In this paper, we discuss a near term implementation of Shor's Algorithm using the Qiskit language on an IBM Q System One quantum computer. We extend currently available documentation by providing a full circuit diagram for Shor's Algorithm including gates specific to the implementation using Qiskit. We present an implementation capable of factoring small two-digit prime numbers, and discuss the limitations of noise when using real quantum computers vs. simulations.

IEEE Annual Computing and Communication Workshop and Conference (CCWC)•Jan 27, 2021•9 citations
Abstract This paper presents a way to increase the success of Shor's algorithm by applying a well-known procedure to the results. The work leverages the continued fractions algorithm, a key component of Shor’s algorithm, to find close approximations when the initial estimation is insufficient. Factorization may still be achieved with these close fractions if their denominators are multiples of the exact fraction denominator. By implementing this approach with Qiskit and Beauregard’s version of Shor’s algorithm, we demonstrate a significant enhancement in its success rate in a quantum computer.
With the rise of large-scale quantum computers, it becomes difficult to sustain the security principles of popular public-key encryption systems, including RSA, which is based on the classical problem of integer factorization. Shor’s algorithm suggests that a large enough quantum computer may find factors of an n-bit integer in polynomial time, thus becoming a threat to RSA and similar encryption techniques once the technology of fault-tolerant hardware reaches maturity. However, current implementation is subject to several limitations regarding the number of qubits available, circuit depth, and the vulnerability to decoherence in NISQ computing. The proposed algorithm in this work provides an improved version of Shor’s algorithm that implements classical pre-processing heuristics, adaptive choice of bases, a low-depth circuit for modular exponentiation, and a compressed approximate quantum Fourier transform (AQFT) step to minimize qubit usage and depth while preserving the accuracy of period finding. The simulation results performed for different modulus sizes from 8 to 256 bits show that the suggested approach allows for reducing the number of logical qubits by about 29% and increases the success rate of the algorithm from 41% to 63%. The security considerations of such optimizations concerning the timelines of migrating from existing cryptographic systems to post-quantum systems will be addressed, as well as the possible approaches to hybrid classical and quantum factorization pipelines.
Shor’s algorithm for prime factorization is a hybrid algorithm consisting of a quantum part and a classical part. The main focus of the classical part is a continued fraction analysis. The presentation of this is often short, pointing to text books on number theory. In this contribution, we present the relevant results and proofs from the theory of continued fractions in detail (even in more detail than in text books), filling the gap to allow a complete comprehension of Shor’s algorithm. Similarly, we provide a detailed computation of the estimation of the probability that convergents will provide the period required for determining a prime factor.
Quantum computers leverage the principles of quantum mechanics to solve complex problems beyond the capabilities of classical computers, such as prime factorization, which poses a significant threat to cryptographic algorithms like RSA and ECC. Although current quantum resources are insufficient for effective decryption, ongoing research focuses on optimizing Shor's algorithm to overcome these limitations. Shor's algorithm, a quantum algorithm designed for efficient integer factorization, exploits quantum parallelism and entanglement to perform prime factorization exponentially faster than classical algorithms. This paper reviews recent trends in Shor algorithm optimization, particularly in enhancing the efficiency of ripple-carry operators and the Karatsuba algorithm in multiplication and proposes a multiplication method that applies the Strassen algorithm to constant adders
This article presents a detailed implementation of Shor’s quantum factoring algorithm, which served as the cornerstone for a pilot project at Jamk University of Applied Sciences. The primary goal was to leverage this significant algorithm to establish and validate a reusable quantum simulation environment on a high-performance computing (HPC) platform. We report the successful factorization of the integer 15, executed on the Finnish CSC’s MAHTI supercomputer using a 9-qubit quantum circuit developed in the Qiskit framework. This work provides a comprehensive overview of the principles behind Shor’s algorithm and a methodical breakdown of its simulation. Furthermore, it documents the practical software challenges faced during the environment’s configuration, focusing on library versioning and dependencies. The purpose of this work is to provide a systematic introduction to implement Shor’s algorithm at computer science or applied mathematics classes in institutions of higher education such as universities of applied sciences. The successful factorization provides an initial validation of the simulation workflow for this benchmark case, while the detailed account of implementing Shor’s algorithm offers a practical guide and valuable insights for future quantum computing initiatives at educational institutions with a focus on computer science or scientific computing.
To factor an integer N into a product of two other numbers N1 and N2, Shor’s algorithm uses the Quantum Fourier Transform on n qubits, denoted QFTn, to determine the period r of a Modular Exponentiation Function (MEF), which is later used to compute a factor of N. In this work, we present Shor’s algorithm for factoring an integer of n qubits and illustrate an example with n=4. We implement our algorithm using Qiskit and IBM quantum computers, which also can be adapted on other quantum computing platforms with minor adjustments. We discuss the IBM quantum computer limitations for running our circuit and show the impact of device imperfections on the factored result.
Although the fundamental principles of quantum computing have been known for decades, it is only within the past few years that practical quantum computers have become available. Since these systems are limited to a small number of qubits, they cannot demonstrate quantum advantage for many practical problems. Accordingly, there has been an effort to develop near term implementations of algorithms purely for research and education. In this paper, we discuss a near term implementation of Shor's Algorithm using the Qiskit language on an IBM Q System One quantum computer. We extend currently available documentation by providing a full circuit diagram for Shor's Algorithm including gates specific to the implementation using Qiskit. We present an implementation capable of factoring small two-digit prime numbers, and discuss the limitations of noise when using real quantum computers vs. simulations.