Skip to main content
QUICK REVIEW

[Paper Review] Efficient calculation of gradients in classical simulations of variational quantum algorithms

Tyson Jones, Julien Gacon|arXiv (Cornell University)|Sep 6, 2020
Quantum Computing Algorithms and ArchitectureComputer Science24 references22 citations
TL;DR

This paper presents a novel algorithm for efficiently computing gradients in classical simulations of variational quantum algorithms, achieving O(P) runtime and O(1) memory usage by leveraging a recurrent structure in quantum operators. The method enables exact gradient computation using only standard simulator primitives—apply gate, clone state, and inner product—without caching or finite-difference approximations, significantly outperforming traditional O(P²) approaches.

ABSTRACT

Calculating the energy gradient in parameter space has become an almost ubiquitous subroutine of variational near-term quantum algorithms. "Faithful" classical emulation of this subroutine mimics its quantum evaluation, and scales as O(P^2) gate operations for P variational parameters. This is often the bottleneck for the moderately-sized simulations, and has attracted HPC strategies like "batch-circuit" evaluation. We here present a novel derivation of an emulation strategy to precisely calculate the gradient in O(P) time and using O(1) state-vectors, compatible with "full-state" state-vector simulators. The prescribed algorithm resembles the optimised technique for automatic differentiation of reversible cost functions, often used in classical machine learning, and first employed in quantum simulators like Yao.jl. In contrast, our scheme derives directly from a recurrent form of quantum operators, and may be more familiar to a quantum computing community. Our strategy is very simple, uses only 'apply gate', 'clone state' and 'inner product' primitives and is hence straightforward to implement and integrate with existing simulators. It is compatible with gate parallelisation schemes, and hardware accelerated and distributed simulators. We describe the scheme in an instructive way, including details of how common gate derivatives can be performed, to clearly guide implementation in existing quantum simulators. We furthermore demonstrate the scheme by implementing it in Qiskit, and perform some comparative benchmarking with faithful simulation. Finally, we remark upon the difficulty of extending the scheme to density-matrix simulation of noisy channels.

Motivation & Objective

  • To address the performance bottleneck in classical simulations of variational quantum algorithms caused by O(P²) gradient computation.
  • To develop a method that computes gradients in O(P) time and O(1) memory, avoiding costly caching or finite-difference approximations.
  • To provide a simple, integrable algorithm using only basic simulator operations: apply gate, clone state, and inner product.
  • To extend the method to support multi-parameter gates, non-unique parameters, and non-Hermitian cost operators.
  • To demonstrate feasibility and performance gains via integration into Qiskit and benchmarking against faithful simulation.

Proposed method

  • The method derives from a recurrent analytic form of the gradient, enabling iterative evaluation without re-simulating gates.
  • It uses a reverse-order application of gate derivatives, analogous to reverse-mode automatic differentiation in classical ML.
  • The algorithm applies gates in reverse order, maintaining a single state vector and computing inner products to accumulate gradient contributions.
  • Each gradient component is computed via a sequence of state cloning, gate application, and inner product operations, avoiding explicit state caching.
  • The approach is compatible with gate parallelization, hardware acceleration, and distributed simulators.
  • The method is extended to handle non-unitary circuits and non-Hermitian cost operators via formalism extensions detailed in Appendix B.

Experimental results

Research questions

  • RQ1Can the gradient computation in variational quantum algorithms be accelerated beyond the standard O(P²) scaling using classical simulation?
  • RQ2Is it possible to compute the full gradient in O(P) time and O(1) memory using only standard quantum simulator primitives?
  • RQ3How can the reverse-mode automatic differentiation technique be adapted to unitary quantum circuits in a way that is intuitive and implementable for quantum computing researchers?
  • RQ4What are the limitations of extending this method to noisy, non-unitary quantum channels?
  • RQ5Can the proposed algorithm be efficiently integrated into existing quantum simulators like Qiskit?

Key findings

  • The proposed algorithm computes the full gradient in O(P) time and O(1) memory, representing a significant improvement over the standard O(P²) scaling.
  • The method is compatible with full-state simulators and can be efficiently parallelized using existing hardware acceleration and distributed computing frameworks.
  • Benchmarking in Qiskit shows substantial performance gains over faithful simulation, with the O(P) scaling enabling faster simulation of moderately-sized variational circuits.
  • The algorithm avoids finite-difference approximations and does not require caching intermediate states, reducing memory overhead and improving numerical stability.
  • Extending the method to density-matrix simulations of noisy channels is infeasible with the same efficiency due to the exponential growth in the number of Kraus operator terms.
  • The Choi-Jamiolkowski isomorphism was considered as an alternative, but leads to a higher O(P·2⁴ᴺ) cost, making it less efficient than naive O(P²·2²ᴺ) evaluation.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.