English

Quantum Algorithms for Modular Factorials

Quantum Physics 2026-07-31 v1 Computational Complexity

Abstract

We give a bounded-error quantum algorithm that, given a prime pp, a divisor q(p1)q\mid(p-1), and an integer 0<n<p0<n<p, computes n!modpn!\bmod p in expected time O~(qc+p/q)\widetilde{O}(q^c+\sqrt{p/q}) for some absolute constant c1c\ge 1. When p1p-1 has a divisor of size qp1/(2c+1)q\approx p^{1/(2c+1)}, this gives the exponent c/(2c+1)<1/2c/(2c+1)<1/2. To our knowledge, this is the first algorithm to break the exponent 1/21/2 barrier for modular factorials under such a divisor promise. The main technical ingredient is a quantum algorithm that reconstructs the relevant Jacobi sum exactly in compact algebraic form, with polynomial dependence on qq and logp\log p. We further extend the same asymptotic bound to the computation of n!modp2n!\bmod p^2, uniformly over 0n<p20\le n<p^2. At n=p1n=p-1, this determines the Wilson quotient (p1)!+1p(modp)\frac{(p-1)!+1}{p}\pmod p. We conjecture that the condition q(p1)q\mid(p-1) is a technical limitation of the present method rather than an inherent obstruction, and that a uniform quantum algorithm exists for all primes.

Cite

@article{arxiv.2607.29453,
  title  = {Quantum Algorithms for Modular Factorials},
  author = {Yann Tal},
  journal= {arXiv preprint arXiv:2607.29453},
  year   = {2026}
}

Comments

41 pages