Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Log inSign up
Challenges
Datasets
Workspaces
Papers
Discussions
Leaderboard
Blog
Job Board
Q3AS

© 2026 Aqora Quantum S.A.S.

TermsPrivacyLegal Notice

arXiv:2111.09967

Differentiable quantum computational chemistry with PennyLane

Juan Miguel Arrazola, Soran Jahangiri, Alain Delgado, Jack Ceroni, Josh Izaac, Antal Száva, Utkarsh Azad, Robert A. Lang, Zeyue Niu, Olivia Di Matteo, Romain Moyard, Soni, Jay, Maria Schuld, Rodrigo A. Vargas–Hernández, Teresa Tamayo-Mendoza, Cedric Yen-Yu Lin, Alán Aspuru‐Guzik, Nathan Killoran

Published Nov 18, 2021• 9 citations
arXivHTMLPDF

Abstract

This work describes the theoretical foundation for all quantum chemistry functionality in PennyLane, a quantum computing software library specializing in quantum differentiable programming. We provide an overview of fundamental concepts in quantum chemistry, including the basic principles of the Hartree-Fock method. A flagship feature in PennyLane is the differentiable Hartree-Fock solver, allowing users to compute exact gradients of molecular Hamiltonians with respect to nuclear coordinates and basis set parameters. PennyLane provides specialized operations for quantum chemistry, including excitation gates as Givens rotations and templates for quantum chemistry circuits. Moreover, built-in simulators exploit sparse matrix techniques for representing molecular Hamiltonians that lead to fast simulation for quantum chemistry applications. In combination with PennyLane's existing methods for constructing, optimizing, and executing circuits, these methods allow users to implement a wide range of quantum algorithms for quantum chemistry. We discuss how PennyLane can be used to implement variational algorithms for calculating ground-state energies, excited-state energies, and energy derivatives, all of which can be differentiated with respect to both circuit and Hamiltonian parameters. We provide an example workflow describing how to jointly optimize circuit parameters, nuclear coordinates, and basis set parameters for quantum chemistry algorithms. We discuss a functionality for reducing the number of qubits by using symmetries and explain how PennyLane can be used to estimate quantum resources needed to implement several quantum algorithms. By combining insights from quantum computing, computational chemistry, and machine learning, PennyLane is the first library for differentiable quantum computational chemistry.

DOI
10.48550/arxiv.2111.09967

Related papers

Hybrid Quantum-Classical Machine Learning with PennyLane: A Comprehensive Guide for Computational Research

Sidney Shapiro

Hybrid quantum-classical machine learning represents a frontier in computational research, combining the potential advantages of quantum computing with established classical optimization techniques. PennyLane provides a Python framework that seamlessly bridges quantum circuits and classical machine learning, enabling researchers to build, optimize, and deploy variational quantum algorithms. This paper introduces PennyLane as a versatile tool for quantum machine learning, optimization, and quantum chemistry applications. We demonstrate use cases including quantum kernel methods, variational quantum eigensolvers, portfolio optimization, and integration with classical ML frameworks such as PyTorch, TensorFlow, and JAX. Through concrete Python examples with widely used libraries such as scikit-learn, pandas, and matplotlib, we show how PennyLane facilitates efficient quantum circuit construction, automatic differentiation, and hybrid optimization workflows. By situating PennyLane within the broader context of quantum computing and machine learning, we highlight its role as a methodological building block for quantum-enhanced data science. Our goal is to provide researchers and practitioners with a concise reference that bridges foundational quantum computing concepts and applied machine learning practice, making PennyLane a default citation for hybrid quantum-classical workflows in Python-based research.

arXiv:2511.14786•Nov 13, 2025•0 citations

PennyLane: Automatic differentiation of hybrid quantum-classical computations

Ville Bergholm, Josh Izaac, Maria Schuld +65 more

PennyLane is a Python 3 software framework for differentiable programming of quantum computers. The library provides a unified architecture for near-term quantum computing devices, supporting both qubit and continuous-variable paradigms. PennyLane's core feature is the ability to compute gradients of variational quantum circuits in a way that is compatible with classical techniques such as backpropagation. PennyLane thus extends the automatic differentiation algorithms common in optimization and machine learning to include quantum and hybrid computations. A plugin system makes the framework compatible with any gate-based quantum simulator or hardware. We provide plugins for hardware providers including the Xanadu Cloud, Amazon Braket, and IBM Quantum, allowing PennyLane optimizations to be run on publicly accessible quantum devices. On the classical front, PennyLane interfaces with accelerated machine learning libraries such as TensorFlow, PyTorch, JAX, and Autograd. PennyLane can be used for the optimization of variational quantum eigensolvers, quantum approximate optimization, quantum machine learning models, and many other applications.

arXiv:1811.04968•Nov 12, 2018•732 citations

Variational quantum algorithm for molecular geometry optimization

Alain Delgado, Juan Miguel Arrazola, Soran Jahangiri +4 more

Classical algorithms for predicting the equilibrium geometry of strongly correlated molecules require expensive wave function methods that become impractical already for few-atom systems. In this work, we introduce a variational quantum algorithm for finding the most stable structure of a molecule by explicitly considering the parametric dependence of the electronic Hamiltonian on the nuclear coordinates. The equilibrium geometry of the molecule is obtained by minimizing a more general cost function that depends on both the quantum circuit and the Hamiltonian parameters, which are simultaneously optimized at each step. The algorithm is applied to find the equilibrium geometries of the ${\mathrm{H}}_{2},$ ${\mathrm{H}}_{3}{}^{+},$ ${\mathrm{BeH}}_{2},$ and ${\mathrm{H}}_{2}\mathrm{O}$ molecules. The quantum circuits used to prepare the electronic ground state for each molecule were designed using an adaptive algorithm where excitation gates in the form of Givens rotations are selected according to the norm of their gradient. All quantum simulations are performed using the PennyLane library for quantum differentiable programming. The optimized geometrical parameters for the simulated molecules show an excellent agreement with their counterparts computed using classical quantum chemistry methods.

arXiv:2106.13840•Physical Review A•Nov 2, 2021•40 citations

Automatic differentiation in quantum chemistry

Tamayo Mendoza, Teresa

Automatic differentiation (AD) is a well-established tool that allows us to compute exact derivatives of implemented functions with respect to all their parameters. It does so without requiring any extra coding or knowledge of the analytical derivatives. Derivatives of quantum chemistry algorithms are generally very hard to obtain and often cumbersome to implement. AD shows great potential to solve this problem and to facilitate the implementation of gradients in the context of electronic structure methods. In this dissertation, we have applied AD in a broader context and demonstrate that AD tools can compute arbitrary gradients of quantum chemistry methods with respect to any input parameter and any intermediate function. To this end, we have developed the open-source code DiffiQult, a fully differentiable Hartree-Fock (HF) software package. DiffiQult is a python package that uses AD tools using the external libraries JAX and Algopy. As a proof of concept, DiffiQult is an example of an end-to-end differentiable software package of a quantum chemistry algorithm based solely on AD tools. This application has helped us understand the challenges of AD in quantum chemistry. We outline the details, benefits, and caveats of AD for the HF algorithm in this work. We have chosen HF as a starting point since it contains all the functions included in correlated electronic structure methods. In this way, it opens the door for the development of AD for more accurate algorithms. As an application, we describe DiffiQult within the framework of the fully variational HF method, where we use a gradient-based optimization method to compute system-specific basis functions. As a result, the wavefunction can capture more molecular features, and we obtain a set of basis functions for correlated methods in quantum and classical algorithms. This proves that these functions improve variationally energy while keeping a compact representation in correlated methods by interfacing with the quantum chemistry library PySCF, and with Tequila, a platform for rapid development of quantum algorithms. First, we present optimization results of minimal basis sets with respect to all parameters of the molecules H2O, CH4, NH3, HF. Later we include optimization of the potential energy surface of two isomerization mechanisms of diazene and hydrogens chains. Here, we use a minimal optimized basis set to compute FCI when possible with PySCF and VQE energies of hydrogen chains with Tequila. We obtain similar results compared to a bigger basis set with considerably fewer configurations. Also, we show how this approach improves the estimation of the thermodynamic limit in the hydrogen chain at the HF level. Finally, we apply this approach to the optimization of all atomic orbitals of benzene and compute electronic correlations restricting the active space to the 6 π orbitals of benzene using the UpCCGSD ansatz implemented in Tequila.

•Jan 1, 2021•0 citations

Advantages of two quantum programming platforms in quantum computing and quantum chemistry

Peihua Wang, Wei-Yeh Wu, C. Lee +2 more

Quantum computing is at the forefront of technological advancement and has the potential to revolutionize various fields, including quantum chemistry. Choosing an appropriate quantum programming language becomes critical as quantum education and research increase. In this paper, we comprehensively compare two leading quantum programming languages, Qiskit and PennyLane, focusing on their suitability for teaching and research. We delve into their basic and advanced usage, examine their learning curves, and evaluate their capabilities in quantum computing experiments. We also demonstrate using a quantum programming language to build a half adder and a machine learning model. Our study reveals that each language has distinct advantages. While PennyLane excels in research applications due to its flexibility to adjust parameters in detail and access multiple sources of real quantum devices, Qiskit stands out in education because of its web-based graphical user interface and smaller code size. The codes and the dataset used in the studies are available at https://github.com/wangpeihua1231/quantum-programming-platform . This article reviews key applications of quantum computing within quantum chemistry, including ground state energy calculations, quantum dynamics, and Hamiltonian learning. We present a comprehensive comparison of the PennyLane and Qiskit platforms, examining their respective advantages and limitations to inform their suitability for both educational and research contexts in the rapidly advancing field of quantum computing. Additionally, we demonstrate foundational quantum circuits and introduce quantum machine learning models, encouraging readers to explore interdisciplinary applications that bridge quantum computing with broader scientific inquiry.

Journal of Cheminformatics•May 19, 2025•2 citations

DQC: A Python program package for differentiable quantum chemistry

Muhammad Kasim, Susi Lehtola, Sam M. Vinko

Automatic differentiation represents a paradigm shift in scientific programming, where evaluating both functions and their derivatives is required for most applications. By removing the need to explicitly derive expressions for gradients, development times can be shortened and calculations can be simplified. For these reasons, automatic differentiation has fueled the rapid growth of a variety of sophisticated machine learning techniques over the past decade, but is now also increasingly showing its value to support ab initio simulations of quantum systems and enhance computational quantum chemistry. Here, we present an open-source differentiable quantum chemistry simulation code and explore applications facilitated by automatic differentiation: (1) calculating molecular perturbation properties, (2) reoptimizing a basis set for hydrocarbons, (3) checking the stability of self-consistent field wave functions, and (4) predicting molecular properties via alchemical perturbations.

arXiv:2110.11678•The Journal of Chemical Physics•Feb 22, 2022•52 citations
This work describes the theoretical foundation for all quantum chemistry functionality in PennyLane, a quantum computing software library specializing in quantum differentiable programming. We provide an overview of fundamental concepts in quantum chemistry, including the basic principles of the Hartree-Fock method. A flagship feature in PennyLane is the differentiable Hartree-Fock solver, allowing users to compute exact gradients of molecular Hamiltonians with respect to nuclear coordinates and basis set parameters. PennyLane provides specialized operations for quantum chemistry, including excitation gates as Givens rotations and templates for quantum chemistry circuits. Moreover, built-in simulators exploit sparse matrix techniques for representing molecular Hamiltonians that lead to fast simulation for quantum chemistry applications. In combination with PennyLane's existing methods for constructing, optimizing, and executing circuits, these methods allow users to implement a wide range of quantum algorithms for quantum chemistry. We discuss how PennyLane can be used to implement variational algorithms for calculating ground-state energies, excited-state energies, and energy derivatives, all of which can be differentiated with respect to both circuit and Hamiltonian parameters. We provide an example workflow describing how to jointly optimize circuit parameters, nuclear coordinates, and basis set parameters for quantum chemistry algorithms. We discuss a functionality for reducing the number of qubits by using symmetries and explain how PennyLane can be used to estimate quantum resources needed to implement several quantum algorithms. By combining insights from quantum computing, computational chemistry, and machine learning, PennyLane is the first library for differentiable quantum computational chemistry.
Hybrid quantum-classical machine learning represents a frontier in computational research, combining the potential advantages of quantum computing with established classical optimization techniques. PennyLane provides a Python framework that seamlessly bridges quantum circuits and classical machine learning, enabling researchers to build, optimize, and deploy variational quantum algorithms. This paper introduces PennyLane as a versatile tool for quantum machine learning, optimization, and quantum chemistry applications. We demonstrate use cases including quantum kernel methods, variational quantum eigensolvers, portfolio optimization, and integration with classical ML frameworks such as PyTorch, TensorFlow, and JAX. Through concrete Python examples with widely used libraries such as scikit-learn, pandas, and matplotlib, we show how PennyLane facilitates efficient quantum circuit construction, automatic differentiation, and hybrid optimization workflows. By situating PennyLane within the broader context of quantum computing and machine learning, we highlight its role as a methodological building block for quantum-enhanced data science. Our goal is to provide researchers and practitioners with a concise reference that bridges foundational quantum computing concepts and applied machine learning practice, making PennyLane a default citation for hybrid quantum-classical workflows in Python-based research.
PennyLane is a Python 3 software framework for differentiable programming of quantum computers. The library provides a unified architecture for near-term quantum computing devices, supporting both qubit and continuous-variable paradigms. PennyLane's core feature is the ability to compute gradients of variational quantum circuits in a way that is compatible with classical techniques such as backpropagation. PennyLane thus extends the automatic differentiation algorithms common in optimization and machine learning to include quantum and hybrid computations. A plugin system makes the framework compatible with any gate-based quantum simulator or hardware. We provide plugins for hardware providers including the Xanadu Cloud, Amazon Braket, and IBM Quantum, allowing PennyLane optimizations to be run on publicly accessible quantum devices. On the classical front, PennyLane interfaces with accelerated machine learning libraries such as TensorFlow, PyTorch, JAX, and Autograd. PennyLane can be used for the optimization of variational quantum eigensolvers, quantum approximate optimization, quantum machine learning models, and many other applications.
Classical algorithms for predicting the equilibrium geometry of strongly correlated molecules require expensive wave function methods that become impractical already for few-atom systems. In this work, we introduce a variational quantum algorithm for finding the most stable structure of a molecule by explicitly considering the parametric dependence of the electronic Hamiltonian on the nuclear coordinates. The equilibrium geometry of the molecule is obtained by minimizing a more general cost function that depends on both the quantum circuit and the Hamiltonian parameters, which are simultaneously optimized at each step. The algorithm is applied to find the equilibrium geometries of the H2,{\mathrm{H}}_{2},H2​, H3+,{\mathrm{H}}_{3}{}^{+},H3​+, BeH2,{\mathrm{BeH}}_{2},BeH2​, and H2O{\mathrm{H}}_{2}\mathrm{O}H2​O molecules. The quantum circuits used to prepare the electronic ground state for each molecule were designed using an adaptive algorithm where excitation gates in the form of Givens rotations are selected according to the norm of their gradient. All quantum simulations are performed using the PennyLane library for quantum differentiable programming. The optimized geometrical parameters for the simulated molecules show an excellent agreement with their counterparts computed using classical quantum chemistry methods.
Automatic differentiation (AD) is a well-established tool that allows us to compute exact derivatives of implemented functions with respect to all their parameters. It does so without requiring any extra coding or knowledge of the analytical derivatives. Derivatives of quantum chemistry algorithms are generally very hard to obtain and often cumbersome to implement. AD shows great potential to solve this problem and to facilitate the implementation of gradients in the context of electronic structure methods. In this dissertation, we have applied AD in a broader context and demonstrate that AD tools can compute arbitrary gradients of quantum chemistry methods with respect to any input parameter and any intermediate function. To this end, we have developed the open-source code DiffiQult, a fully differentiable Hartree-Fock (HF) software package. DiffiQult is a python package that uses AD tools using the external libraries JAX and Algopy. As a proof of concept, DiffiQult is an example of an end-to-end differentiable software package of a quantum chemistry algorithm based solely on AD tools. This application has helped us understand the challenges of AD in quantum chemistry. We outline the details, benefits, and caveats of AD for the HF algorithm in this work. We have chosen HF as a starting point since it contains all the functions included in correlated electronic structure methods. In this way, it opens the door for the development of AD for more accurate algorithms. As an application, we describe DiffiQult within the framework of the fully variational HF method, where we use a gradient-based optimization method to compute system-specific basis functions. As a result, the wavefunction can capture more molecular features, and we obtain a set of basis functions for correlated methods in quantum and classical algorithms. This proves that these functions improve variationally energy while keeping a compact representation in correlated methods by interfacing with the quantum chemistry library PySCF, and with Tequila, a platform for rapid development of quantum algorithms. First, we present optimization results of minimal basis sets with respect to all parameters of the molecules H2O, CH4, NH3, HF. Later we include optimization of the potential energy surface of two isomerization mechanisms of diazene and hydrogens chains. Here, we use a minimal optimized basis set to compute FCI when possible with PySCF and VQE energies of hydrogen chains with Tequila. We obtain similar results compared to a bigger basis set with considerably fewer configurations. Also, we show how this approach improves the estimation of the thermodynamic limit in the hydrogen chain at the HF level. Finally, we apply this approach to the optimization of all atomic orbitals of benzene and compute electronic correlations restricting the active space to the 6 π orbitals of benzene using the UpCCGSD ansatz implemented in Tequila.
Quantum computing is at the forefront of technological advancement and has the potential to revolutionize various fields, including quantum chemistry. Choosing an appropriate quantum programming language becomes critical as quantum education and research increase. In this paper, we comprehensively compare two leading quantum programming languages, Qiskit and PennyLane, focusing on their suitability for teaching and research. We delve into their basic and advanced usage, examine their learning curves, and evaluate their capabilities in quantum computing experiments. We also demonstrate using a quantum programming language to build a half adder and a machine learning model. Our study reveals that each language has distinct advantages. While PennyLane excels in research applications due to its flexibility to adjust parameters in detail and access multiple sources of real quantum devices, Qiskit stands out in education because of its web-based graphical user interface and smaller code size. The codes and the dataset used in the studies are available at https://github.com/wangpeihua1231/quantum-programming-platform . This article reviews key applications of quantum computing within quantum chemistry, including ground state energy calculations, quantum dynamics, and Hamiltonian learning. We present a comprehensive comparison of the PennyLane and Qiskit platforms, examining their respective advantages and limitations to inform their suitability for both educational and research contexts in the rapidly advancing field of quantum computing. Additionally, we demonstrate foundational quantum circuits and introduce quantum machine learning models, encouraging readers to explore interdisciplinary applications that bridge quantum computing with broader scientific inquiry.
Automatic differentiation represents a paradigm shift in scientific programming, where evaluating both functions and their derivatives is required for most applications. By removing the need to explicitly derive expressions for gradients, development times can be shortened and calculations can be simplified. For these reasons, automatic differentiation has fueled the rapid growth of a variety of sophisticated machine learning techniques over the past decade, but is now also increasingly showing its value to support ab initio simulations of quantum systems and enhance computational quantum chemistry. Here, we present an open-source differentiable quantum chemistry simulation code and explore applications facilitated by automatic differentiation: (1) calculating molecular perturbation properties, (2) reoptimizing a basis set for hydrocarbons, (3) checking the stability of self-consistent field wave functions, and (4) predicting molecular properties via alchemical perturbations.