Skip to main content
QUICK REVIEW

[Paper Review] Optimizing Quantum Circuits for Arithmetic

Thomas Häner, Martin Roetteler|arXiv (Cornell University)|May 31, 2018
Quantum Computing Algorithms and Architecture35 citations
TL;DR

This paper presents optimized, reversible quantum circuits for evaluating essential arithmetic functions—such as arcsin(x), 1/√x, Gaussians, and trigonometric functions—using piecewise polynomial approximations and classical high-performance computing insights. By leveraging a parallelized Horner scheme and optimized Newton-Raphson iterations for inverse square roots, the authors achieve significant reductions in Toffoli gate count and qubit usage, enabling more accurate cost analysis of quantum algorithms like HHL and quantum rejection sampling.

ABSTRACT

Many quantum algorithms make use of oracles which evaluate classical functions on a superposition of inputs. In order to facilitate implementation, testing, and resource estimation of such algorithms, we present quantum circuits for evaluating functions that are often encountered in the quantum algorithm literature. This includes Gaussians, hyperbolic tangent, sine/cosine, inverse square root, arcsine, and exponentials. We use insights from classical high-performance computing in order to optimize our circuits and implement a quantum software stack module which allows to automatically generate circuits for evaluating piecewise smooth functions in the computational basis. Our circuits enable more detailed cost analyses of various quantum algorithms, allowing to identify concrete applications of future quantum computing devices. Furthermore, our resource estimates may guide future research aiming to reduce the costs or even the need for arithmetic in the computational basis altogether.

Motivation & Objective

  • Address the lack of detailed resource estimates for quantum arithmetic functions, which critically affect crossover points between classical and quantum algorithms.
  • Reduce the high constant overheads in quantum algorithms caused by inefficient implementations of functions like 1/√x, arcsin(x), and Gaussians.
  • Enable precise cost analysis of quantum algorithms such as HHL, Quantum Metropolis sampling, and quantum machine learning by providing reusable, reversible quantum circuits.
  • Minimize resource costs (Toffoli gates, qubits) for evaluating smooth and piecewise smooth functions in the computational basis using insights from classical high-performance computing.

Proposed method

  • Implement piecewise polynomial approximation for smooth functions using a parallelized Horner scheme to evaluate multiple polynomials simultaneously and conditionally.
  • Adapt the fast inverse square root algorithm from Quake III Arena using a tuned initial guess to reduce Newton iterations by 20–25%, minimizing Toffoli count.
  • Use reversible arithmetic circuits—such as in-place constant adders and controlled swaps—for low-level operations, ensuring full reversibility at the Toffoli gate level.
  • Apply minimax polynomial approximation over subintervals of the domain to achieve high accuracy with low-degree polynomials, reducing gate count.
  • Integrate subroutines for square root, inverse square root, and polynomial evaluation into a modular quantum software stack compatible with languages like LiQUi|⟩ and Q#.
  • Validate circuits via reversible simulation using a Toffoli circuit simulator, testing up to several hundred qubits.

Experimental results

Research questions

  • RQ1How can piecewise polynomial approximation be efficiently implemented in a reversible quantum setting to minimize Toffoli gate and qubit costs?
  • RQ2What is the optimal initial guess strategy for Newton-Raphson iteration in the quantum domain to reduce the number of iterations for inverse square root computation?
  • RQ3To what extent can classical high-performance computing techniques, such as those in the Cephes library or Quake III’s fast inverse square root, be adapted to quantum arithmetic?
  • RQ4What are the precise resource costs (Toffoli gates, qubits) for implementing key functions like arcsin(x), 1/√x, and Gaussians in a reversible quantum circuit?
  • RQ5How does the choice of polynomial degree and subinterval partitioning affect the accuracy and resource cost of quantum function evaluation?

Key findings

  • The authors achieve a 20–25% reduction in Newton iterations for inverse square root by optimizing the initial guess, directly reducing Toffoli gate count.
  • The arcsin(x) implementation requires only one invocation of sin(x) for x ∈ [−0.5, 0.5], with total Toffoli count scaling as O(dn²) for degree-d polynomial approximation.
  • For 10⁻⁵ accuracy on [−0.5, 0.5], arcsin(x) requires 8,370 Toffoli gates with 6 subintervals and 232 qubits, while sin(x) at 10⁻⁵ error uses 10,661 Toffoli gates with 2 qubits per coefficient.
  • The reversible fast inverse square root converges reliably with 3–5 Newton iterations, achieving L∞ error below 10⁻⁵ for n = 50 bits and p = 5 fractional bits.
  • The piecewise polynomial evaluation scheme reduces the need for high-degree polynomials by partitioning the domain, enabling high accuracy with low-degree approximations.
  • Resource estimates show that the cost of evaluating arcsin(x) is dominated by the inverse square root and polynomial evaluation subroutines, with the latter contributing significantly to the Toffoli count.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.