Exact gradient for general cost functions in variational quantum algorithms
Phys. Rev. A 113, 042435 – Published 15 April, 2026
DOI: https://doi.org/10.1103/6s2c-mxgx
Abstract
We present a unitary-based gradient formulation for variational quantum algorithms (VQAs) that applies to general differentiable cost functions defined by a parametrized 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.