Generalized quantum circuit differentiation rules

Generalized quantum circuit differentiation rules
Variational quantum algorithms that are used for quantum machine learning rely on the ability to automatically differentiate parametrized quantum circuits with respect to underlying parameters. Here we propose the rules for differentiating quantum circuits (unitaries) with arbitrary generators. Unlike the standard parameter-shift rule valid for unitaries generated by operators with spectra limited to at most two unique eigenvalues (represented by involutory and idempotent operators), our approach also works for generators with a generic nondegenerate spectrum. Based on a spectral decomposition, we derive a simple recipe that allows explicit derivative evaluation. The derivative corresponds to the weighted sum of measured expectations for circuits with shifted parameters. The number of function evaluations is equal to the number of unique positive nonzero spectral gaps (eigenvalue differences) for the generator. We apply the approach to relevant examples of two-qubit gates, among others showing that the so-called fermionic simulation (fSim) gate can be differentiated using four measurements. Additionally, we present generalized differentiation rules for the case of Pauli-string generators, based on distinct shifts (here referred to as the triangulation approach), and analyze the variance for derivative measurements in different scenarios. Our work offers a toolbox for the efficient hardware-oriented differentiation needed for circuit optimization and operator-based derivative representation.
Generalized quantum circuit differentiation rules | Phys. Rev. A