Several quantities important in condensed matter physics, quantum information, and quantum chemistry, as well as quantities required in meta-optimization of machine learning algorithms, can be expressed as gradients of implicitly defined functions of the parameters characterizing the system. Here, we show how to leverage implicit differentiation for gradient computation through variational quantum algorithms and explore applications in condensed matter physics, quantum machine learning, and quantum information. A function defined implicitly as the solution of a quantum algorithm, e.g., a variationally obtained ground- or steady-state, can be automatically differentiated using implicit differentiation while being agnostic to how the solution is computed. We apply this notion to the evaluation of physical quantities in condensed matter physics such as generalized susceptibilities studied through a variational quantum algorithm. Moreover, we develop two additional applications of implicit differentiation -- hyperparameter optimization in a quantum machine learning algorithm, and the variational construction of entangled quantum states based on a gradient-based maximization of a geometric measure of entanglement. Our work ties together several types of gradient calculations that can be computed using variational quantum circuits in a general way without relying on tedious analytic derivations, or approximate finite-difference methods.
Several quantities important in condensed matter physics, quantum information, and quantum chemistry, as well as quantities required in meta-optimization of machine learning algorithms, can be expressed as gradients of implicitly defined functions of the parameters characterizing the system. Here, we show how to leverage implicit differentiation for gradient computation through variational quantum algorithms and explore applications in condensed matter physics, quantum machine learning, and quantum information. A function defined implicitly as the solution of a quantum algorithm, e.g., a variationally obtained ground- or steady-state, can be automatically differentiated using implicit differentiation while being agnostic to how the solution is computed. We apply this notion to the evaluation of physical quantities in condensed matter physics such as generalized susceptibilities studied through a variational quantum algorithm. Moreover, we develop two additional applications of implicit differentiation -- hyperparameter optimization in a quantum machine learning algorithm, and the variational construction of entangled quantum states based on a gradient-based maximization of a geometric measure of entanglement. Our work ties together several types of gradient calculations that can be computed using variational quantum circuits in a general way without relying on tedious analytic derivations, or approximate finite-difference methods.
The past few years have seen a significant transfer of tools from machine learning to solve quantum physics problems. Automatic differentiation is one standard algorithm used to efficiently compute gradients of loss functions for generic neural networks. In this work we show how to extend automatic differentiation to the case of complex loss function in a way that can be readily implemented in existing frameworks and which is compatible with the common case of real loss functions. We then combine this tool with matrix product states and apply it to compute the ground state and the steady state of a close and an open quantum system. Compared to the traditional density matrix renormalization group algorithm, complex automatic differentiation allows both straightforward GPU accelerations as well as generalizations to different types of tensor and neural networks.
Abstract Many near-term quantum computing algorithms are conceived as variational quantum algorithms, in which parameterized quantum circuits are optimized in a hybrid quantum–classical setup. Examples are variational quantum eigensolvers, quantum approximate optimization algorithms as well as various algorithms in the context of quantum-assisted machine learning. A common bottleneck of any such algorithm is constituted by the optimization of the variational parameters. A popular set of optimization methods work on the estimate of the gradient, obtained by means of circuit evaluations. We will refer to the way in which one can combine these circuit evaluations as gradient rules. This work provides a comprehensive picture of the family of gradient rules that vary parameters of quantum gates individually. The most prominent known members of this family are the parameter shift rule (PSR) and the finite differences method. To unite this family, we propose a generalized PSR that expresses all members of the aforementioned family as special cases, and discuss how all of these can be seen as providing access to a linear combination of exact first- and second-order derivatives. We further prove that a PSR with one non-shifted evaluation and only one shifted circuit evaluation does not exist, and introduce a novel perspective for approaching new gradient rules.
The current leading approach to the variational optimization of projected entangled-pair states (PEPS) is based on automatic differentiation, which allows for a convenient evaluation of the energy gradient with respect to the local variational degrees of freedom. However, evaluating the energy gradient not only remains a major computational bottleneck of the optimization procedure, but also suffers from frequent numerical instabilities. In this work, we adopt recent advances in implicit differentiation techniques to address these challenges in PEPS optimization. By reformulating the core step of the gradient computation in terms of a single characteristic equation for the contraction environment, we reduce the cost of the gradient computation and improve its scaling with the problem size. By choosing a suitable parametrization of this characteristic equation based on the intrinsic symmetries of the contraction environment, we can directly remove instabilities from the global gradient computation that would otherwise arise from the derivatives of subroutines of the contraction algorithm. Finally, we demonstrate how this approach drastically simplifies the practical implementation of stable gradient-based PEPS optimization.
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.
Quantum optimization has shown promising results for quadratic unconstrained binary optimization (QUBO) problems. Real-world applications, however, often involve polynomial coefficients that depend on tunable external factors - such as demand forecasts or risk preferences - giving rise to bilevel optimization structures. We show how variational quantum algorithms (VQAs) can efficiently handle such parametric problems, making three contributions. First, we propose a bilevel optimization model for diagonal cost Hamiltonians where coefficients depend on a tunable outer parameter: an outer loop adjusts this parameter - reshaping the cost landscape - while an inner VQA optimizes circuit variables. Second, since derivative-free probing methods incur a multiplicative overhead when each outer evaluation requires a complete inner solve, we develop correlator-reuse implicit differentiation (CR-ID), which obtains outer gradients by reusing quantum measurements already collected during inner energy estimation, requiring essentially no additional circuit executions. Experiments across three coefficient families show that CR-ID consistently improves budget-normalized efficiency by ~4\% in 1D and over 14\% in multi-dimensional settings, showing a significant performance advantage compared to finite-difference methods. Third, we show that this property is architecture-dependent: VQE admits exact reuse gradients, whereas QAOA introduces a state-dependent term that creates a cost-bias trade-off.
Quantum computing has become a potential way to solve complex problems that conventional computers can’t handle, especially those involving strongly correlated quantum systems. Classical simulation of these systems becomes exponentially more challenging as the number of interacting particles rises, resulting in significant computational and memory limitations. As a result, classical computational approaches are unable to handle many significant physical and chemical systems, including molecular structures, biological molecules, and quantum materials. Quantum computers operate using the same quantum mechanical principles as these systems. Consequently, they provide a natural framework for exploring large Hilbert spaces and capturing complex quantum correlations. This thesis begins by discussing the fundamental principles of quantum mechanics that are applicable to computation, such as qubits, superposition, and entanglement. The construction of quantum circuits is discussed after a discussion of basic quantum gates and their matrix representations. These ideas are the foundation of quantum algorithms and offer the essential framework for comprehending the modeling and manipulation of complicated quantum states using quantum hardware. Building on this foundation, the thesis focuses on Variational Quantum Algorithms (VQAs), which offer a feasible hybrid quantum-classical approach to optimizing near-term quantum devices. In VQAs, a parameterized quantum circuit is used to approximate the ground-state energy of the quantum system. A classical optimizer then iteratively updates the variational parameters to minimize a cost function, usually the expectation value of the system’s Hamiltonian. A thorough analysis of the function of gradient-based optimization is conducted, encompassing the parameter-shift rule that is employed to calculate precise energy derivatives. The discussion is expanded to include major applications such as the Quantum Approximate Optimization Algorithm and developing approaches to quantum machine learning, emphasizing the importance of efficient and accurate gradient evaluation. A major challenge in the real-world application of VQAs is the high resource cost of gradient estimation using conventional direct measurement techniques. These techniques require repeated projective measurements and several executions of parameter-shifted quantum circuits, which lead to significant measurement overhead and deeper circuits. Quantum Non-Demolition Measurement (QNDM) is examined in this thesis as a potential framework for gradient evaluation to get around this limitation. Based on recent theoretical advances, QNDM introduces an ancillary detector qubit that coherently stores gradient information within its phase. Derivatives can then be estimated indirectly through detector measurements. This allows gradient information to be extracted without destroying the quantum state and with a greatly reduced number of measurements. The efficiency of QNDM is evaluated by extending the study to systems with bigger Hamiltonians and greater molecular complexity, as well as by comparing it in detail with direct measurement techniques utilizing benchmark molecular systems like LiH, Li2, and H2. Although both methods successfully converge to the ground-state energy, as shown by numerical results, QNDM consistently uses fewer quantum resources in terms of logical gate operations, measurement shots, and circuit executions. Additionally, as system size grows, QNDM’s resource advantage becomes more noticeable, suggesting that it has favorable scalability for bigger molecular systems. This thesis concludes that, while both direct measurement and quantum non-demolition measurement approaches allow for precise variational optimization, QNDM gives a significant decrease in quantum resources. These results establish QNDM as an effective and scalable method for developing quantum simulations of realistic physical and chemical systems and for executing variational quantum algorithms on near-term quantum hardware.