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

arXiv:1711.02616 · Quantum Information and Computation

A quantum primality test with order finding

A. Donís Vela, Juan Carlos García-Escartín

Published Nov 1, 2018• 4 citations
arXivHTMLPDF

Abstract

Determining whether a given integer is prime or composite is a basic task in number theory. We present a primality test based on quantum order finding and the converse of Fermat's theorem. For an integer N, the test tries to find an element of the multiplicative group of integers modulo N with order N-1. If one is found, the number is known to be prime. During the test, we can also show most of the times N is composite with certainty (and a witness) or, after \log\log N unsuccessful attempts to find an element of order N-1, declare it composite with high probability. The algorithm requires O((\log n)^2 n^3) operations for a number N with n bits, which can be reduced to O(\log\log n (\log n)^3 n^2) operations in the asymptotic limit if we use fast multiplication.

DOI
10.26421/qic18.13-14-5

Related papers

A quantum algorithm for computing multiplicative order of integers modulo a prime

Maheswara Rao Valluri

One of the challenging problems in number theory is to compute efficiently multiplicative order of integers modulo a prime. This problem was listed under open problems in the number theoretic complexity II proposed by Leonard M. Adleman and Kevin S.McCurley in 1994. This paper offers a polynomial-time quantum algorithm for computing the order k = min {x|x∈, ax ≡ 1(modp)}, if p∈ Primes and gcd(a,p) = 1, where a, p∈, and it requires 2 (1) 2 ((log p) +O )  quantum operations.

Journal of Discrete Mathematical Sciences and Cryptography•Jan 1, 2023•0 citations

A quantum algorithm for computing the Carmichael function

Juan Carlos García-Escartín

Quantum computers can solve many number theory problems efficiently. Using the efficient quantum algorithm for order finding as an oracle, this paper presents an algorithm that computes the Carmichael function for any integer $N$ with a probability as close to 1 as desired. The algorithm requires $O((\log n )^3n^3)$ quantum operations, or $O(\log\log n (\log n)^4 n^2)$ operations using fast multiplication. Verification, quantum optimizations and applications to RSA and primality tests are also discussed.

arXiv:2111.02488•Nov 3, 2021•0 citations

Primality Test Via Quantum Factorization

H. F. Chau, Hoi‐Kwong Lo

We consider a probabilistic quantum implementation of a variation of the Pocklington–Lehmer N - 1 primality test using Shor's algorithm. O ( log 3 N log log N log log log N) elementary q-bit operations are required to determine the primality of a number N, making it (asymptotically) the fastest known primality test. Thus, the potential power of quantum mechanical computers is once again revealed.

arXiv:quant-ph/9508005•International Journal of Modern Physics C•Apr 1, 1997•9 citations

Taxonomy and Practical Evaluation of Primality Testing Algorithms

Anas Ahmad Abudaqa, Nujud Alyami, Mostefa Kara +2 more

Abstract Many modern asymmetric encryption methods rely on prime numbers, as they have distinctive properties. For instance, the security of RSA cryptosystem relies on the computational difficulty of factoring a large composite number in its prime factors, a problem that remains challenging for classical computers but potentially solvable using quantum algorithms. On the other hand, generating large prime numbers is also challenging due to their irregular distribution among integers, necessitat- ing the use of primality testing algorithms to verify candidate primes. In this paper, we intensively review and classify various classical and quantum algorithms for factorization and primality testing, highlighting their advantages, limitations, speed/accuracy tradeoffs, time complexities, along with a brief summary. Furthermore, we apply and compare these algorithms to gain practical insights and conduct a comprehensive performance comparison. The insights from this paper show that while quantum factoring algorithms, particularly Shor’s algorithm and its refinements, have introduced significant advancements over their classical counterparts, quantum primality testing algorithms have not demonstrated comparable advantages.

arXiv:2006.08444•Jun 15, 2020•1 citation

Quantum Versions of Classical Randomized Algorithms

A. Carlini, Akio Hosoya

We present a quantum version of the classical probabilistic algorithms a' la Rabin for the test of primality of a given integer. Our quantum algorithm is based on the use of Grover's unitary operator for searching an unstructured database and of Shor's Fourier transform for extracting the periodicity of a function, and their combined use in the quantum counting algorithm by Brassard et al. Our quantum probabilistic algorithm is fully unitary and reversible, and can be used as part of larger and more complicated quantum networks. Polynomial time algorithms for testing the primality of an integer, the ‘prime number theorem’ and a conjecture about the asymptotic number of representations of an even integer as a sum of two primes are also discussed.

Progress of Theoretical Physics Supplement•Jan 1, 2000•0 citations

Prime Number Primality Testing via Quantum Lattice-Based Search

Jincheng Zhang

This paper introduces a novel quantum algorithm for efficient primality testing, aiming to surpass the limitations of classical methods through the application of lattice-based search. We detail the design of a quantum circuit that explores the prime number space, leveraging superposition and entanglement to achieve significantly reduced computational complexity. The core mechanism centers around quantum search, allowing for parallel exploration of the vast space of possible prime factors. We present a comprehensive analysis of the algorithm's performance, including a detailed mathematical justification of its efficiency gains compared to established techniques. The paper concludes with a discussion of the potential implications of this quantum approach for cryptography and other applications requiring prime number verification.

•Aug 31, 2026•0 citations
Determining whether a given integer is prime or composite is a basic task in number theory. We present a primality test based on quantum order finding and the converse of Fermat's theorem. For an integer N, the test tries to find an element of the multiplicative group of integers modulo N with order N-1. If one is found, the number is known to be prime. During the test, we can also show most of the times N is composite with certainty (and a witness) or, after \log\log N unsuccessful attempts to find an element of order N-1, declare it composite with high probability. The algorithm requires O((\log n)^2 n^3) operations for a number N with n bits, which can be reduced to O(\log\log n (\log n)^3 n^2) operations in the asymptotic limit if we use fast multiplication.
Quantum computers can solve many number theory problems efficiently. Using the efficient quantum algorithm for order finding as an oracle, this paper presents an algorithm that computes the Carmichael function for any integer NNN with a probability as close to 1 as desired. The algorithm requires O((log⁡n)3n3)O((\log n )^3n^3)O((logn)3n3) quantum operations, or O(log⁡log⁡n(log⁡n)4n2)O(\log\log n (\log n)^4 n^2)O(loglogn(logn)4n2) operations using fast multiplication. Verification, quantum optimizations and applications to RSA and primality tests are also discussed.
Abstract Many modern asymmetric encryption methods rely on prime numbers, as they have distinctive properties. For instance, the security of RSA cryptosystem relies on the computational difficulty of factoring a large composite number in its prime factors, a problem that remains challenging for classical computers but potentially solvable using quantum algorithms. On the other hand, generating large prime numbers is also challenging due to their irregular distribution among integers, necessitat- ing the use of primality testing algorithms to verify candidate primes. In this paper, we intensively review and classify various classical and quantum algorithms for factorization and primality testing, highlighting their advantages, limitations, speed/accuracy tradeoffs, time complexities, along with a brief summary. Furthermore, we apply and compare these algorithms to gain practical insights and conduct a comprehensive performance comparison. The insights from this paper show that while quantum factoring algorithms, particularly Shor’s algorithm and its refinements, have introduced significant advancements over their classical counterparts, quantum primality testing algorithms have not demonstrated comparable advantages.
We present a quantum version of the classical probabilistic algorithms a' la Rabin for the test of primality of a given integer. Our quantum algorithm is based on the use of Grover's unitary operator for searching an unstructured database and of Shor's Fourier transform for extracting the periodicity of a function, and their combined use in the quantum counting algorithm by Brassard et al. Our quantum probabilistic algorithm is fully unitary and reversible, and can be used as part of larger and more complicated quantum networks. Polynomial time algorithms for testing the primality of an integer, the ‘prime number theorem’ and a conjecture about the asymptotic number of representations of an even integer as a sum of two primes are also discussed.
This paper introduces a novel quantum algorithm for efficient primality testing, aiming to surpass the limitations of classical methods through the application of lattice-based search. We detail the design of a quantum circuit that explores the prime number space, leveraging superposition and entanglement to achieve significantly reduced computational complexity. The core mechanism centers around quantum search, allowing for parallel exploration of the vast space of possible prime factors. We present a comprehensive analysis of the algorithm's performance, including a detailed mathematical justification of its efficiency gains compared to established techniques. The paper concludes with a discussion of the potential implications of this quantum approach for cryptography and other applications requiring prime number verification.