Table of Contents
Fetching ...

Exact gradient for general cost functions in variational quantum algorithms

Jesus Urbaneja, Le Bin Ho

Abstract

We present a unitary-based gradient formulation for variational quantum algorithms (VQAs) that applies to general differentiable cost function defined by a parameterized quantum circuit composed of Pauli-generated rotations. The gradient is obtained directly from the underlying unitary evolution, without assuming a specific expectation-value form of the cost function. The resulting expressions can be accessed on quantum hardware using the Hadamard and Hilbert-Schmidt tests. We demonstrate the method in variational quantum compilation, where it yields stable and accurate gradient estimates. This unitary-based framework therefore provides a broadly applicable and hardware-compatible tool for gradient evaluation in VQAs.

Exact gradient for general cost functions in variational quantum algorithms

Abstract

We present a unitary-based gradient formulation for variational quantum algorithms (VQAs) that applies to general differentiable cost function defined by a parameterized quantum circuit composed of Pauli-generated rotations. The gradient is obtained directly from the underlying unitary evolution, without assuming a specific expectation-value form of the cost function. The resulting expressions can be accessed on quantum hardware using the Hadamard and Hilbert-Schmidt tests. We demonstrate the method in variational quantum compilation, where it yields stable and accurate gradient estimates. This unitary-based framework therefore provides a broadly applicable and hardware-compatible tool for gradient evaluation in VQAs.

Paper Structure

This paper contains 23 sections, 54 equations, 6 figures.

Figures (6)

  • Figure 1: Schematic representation of the computational graph employed to compute the exact gradient of the cost function.
  • Figure 2: Quantum circuits for HT (a,b) and HST (c).
  • Figure 3: Quantum circuit diagram: The circuit starts by applying $\mathcal{U}(\bm\theta)$, followed by $\mathcal{V}^\dagger$, and then measuring the final circuit.
  • Figure 4: Derivatives estimation results. (a, b) show the derivatives $\partial C(\theta)/\partial \theta_y$ and $\partial C(\theta)/\partial \theta_z$ as functions of $\theta_y$ and $\theta_z$, respectively. The unitary-based derivatives obtained using HT and HST are compared with the finite-difference two-point method, the standard PSR, and the exact analytical results. (c, d) present the average error of the derivative estimates as a function of the step size, highlighting the trade-off between accuracy and computational cost for the different methods.
  • Figure 5: (a) Quantum circuit used for Toffoli gate synthesis. (b, c) Cost versus iteration for 3-qubit and 4-qubit Toffoli gate synthesis, respectively. Gradient descent is used with learning rate $1.5$ and HEA depth $L=8$ and $L=14$, respectively. The unitary-based PSR implemented through the HT matches the theoretical JAX gradients, whereas the standard PSR deviates from the theory. In the 4-qubit case, all methods converge to a local minimum due to the limited expressibility of the chosen ansatz.
  • ...and 1 more figures