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, Jay Soni, Maria Schuld, Rodrigo A. Vargas–Hernández, Teresa Tamayo-Mendoza, Cedric Yen-Yu Lin, Alán Aspuru‐Guzik, Nathan KilloranarXiv 2021 · DOI · arXiv

TL;DR

This paper introduces PennyLane's quantum chemistry module, a library designed for differentiable quantum computational chemistry. It enables seamless integration of quantum chemistry calculations with machine learning techniques by providing differentiable implementations of core quantum chemistry methods, including the Hartree-Fock solver, and offering tools for building and optimizing quantum circuits for chemical simulations.

What Problem Does This Paper Address?

Quantum chemistry simulations are crucial for understanding molecular properties and designing new materials, but they are computationally intensive. While quantum computing offers a promising avenue for tackling these challenges, developing and optimizing quantum algorithms for chemistry requires specialized tools that bridge the gap between quantum computing, computational chemistry, and machine learning. Specifically, there's a need for software that allows for the automatic differentiation of quantum chemistry calculations with respect to both quantum circuit parameters and molecular properties (like nuclear coordinates and basis set parameters), enabling efficient optimization of hybrid quantum-classical approaches.

Methods

The paper details the quantum chemistry functionality within PennyLane, a library for differentiable quantum programming. Key methods include:

  • Differentiable Hartree-Fock Solver: This is a flagship feature that allows for the computation of exact gradients of molecular orbitals, Hartree-Fock energies, and molecular Hamiltonians with respect to nuclear coordinates and basis set parameters. This is achieved through automatic differentiation.
  • Specialized Quantum Chemistry Operations: PennyLane provides gates like Givens rotations for single and double excitations, which are particle-number conserving and suitable for quantum chemistry ansätze.
  • Quantum Chemistry Circuit Templates: Pre-built circuit architectures (ansätze) are available, such as AllSinglesDoubles, simplifying the construction of quantum circuits for chemical systems.
  • Adaptive Circuit Design: The AdaptiveOptimizer facilitates the construction of circuits by iteratively selecting gates that yield the largest gradients, leading to more efficient ansätze.
  • Qubit Tapering: Functionality to reduce the number of qubits required for simulations by exploiting symmetries in the molecular Hamiltonian.
  • Resource Estimation: Tools to estimate the number of shots, gates, and qubits needed for specific quantum algorithms like VQE and Quantum Phase Estimation.
  • Molecular Hamiltonian Construction: Functions to build molecular Hamiltonians from atomic symbols and coordinates, with options for differentiable parameters.

Datasets

Not discussed in the paper. The paper focuses on the theoretical framework and software implementation for quantum chemistry calculations, rather than specific datasets for training or evaluation. The "datasets" in this context are the molecular systems defined by their atomic symbols, geometries, and basis sets.

Key Insights and Ideas

  • Bridging the Gap: PennyLane's differentiable quantum chemistry module acts as a crucial bridge between quantum computing, computational chemistry, and machine learning, enabling a unified approach to solving complex chemical problems.
  • Differentiable Hartree-Fock is Key: The differentiable Hartree-Fock solver is a cornerstone, allowing for precise gradient calculations that are essential for optimization in hybrid quantum-classical algorithms.
  • Givens Rotations as Building Blocks: The paper highlights the universality of controlled single- and double-excitation gates (based on Givens rotations) for particle-conserving unitaries, making them ideal for quantum chemistry circuits.
  • Fully Differentiable Workflows: The library enables end-to-end differentiable workflows, allowing simultaneous optimization of circuit parameters, nuclear coordinates, and basis set parameters, which is critical for accurate molecular simulations.
  • Qubit Tapering for Efficiency: Exploiting symmetries to reduce qubit requirements is a practical step towards making larger quantum chemistry simulations feasible on current and near-term quantum hardware.

Key Results

The paper doesn't present specific quantitative results from benchmark experiments but rather details the capabilities and theoretical underpinnings of the PennyLane quantum chemistry module. The key "results" are the functionalities and tools it provides:

  • Exact Gradients: The ability to compute exact gradients of various quantum chemistry quantities (energies, orbitals, Hamiltonians) with respect to molecular and circuit parameters.
  • Flexible Circuit Construction: Tools for building quantum circuits using individual gates, templates, or adaptive methods.
  • Efficient Simulation: Built-in sparse matrix techniques for fast simulation of molecular Hamiltonians.
  • Resource Estimation Capabilities: Functionality to estimate the quantum resources needed for algorithms like VQE and QPE.
  • Differentiable Molecular Hamiltonians: The ability to construct Hamiltonians whose parameters (like basis set exponents and nuclear coordinates) are differentiable.

Limitations and Future Work

  • Current Capabilities: The paper notes that PennyLane's functionality is as of the time of writing and aims for continuous development to expand scope and performance.
  • External Dependencies: While PennyLane provides core functionality, it can interface with external packages like PySCF and Psi4 for integral calculations and OpenFermion for Hamiltonian construction, suggesting potential areas for deeper integration or standalone improvements.
  • Hardware Resource Requirements: The paper acknowledges that quantum phase estimation, while powerful, requires a large number of qubits and deep circuits, posing challenges for current hardware.
  • Future Work: The authors express a goal to continue developing PennyLane, incorporating state-of-the-art techniques and welcoming community contributions. They emphasize that quantum computational chemistry is a young field with much more to be discovered.

Summary updated

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.
BibTeX
@misc{arrazola2021differentiable,
  author = {Juan Miguel Arrazola and Soran Jahangiri and Alain Delgado and Jack Ceroni and Josh Izaac and Antal Száva and Utkarsh Azad and Robert A. Lang and Zeyue Niu and Olivia Di Matteo and Romain Moyard and Jay Soni and Maria Schuld and Rodrigo A. Vargas–Hernández and Teresa Tamayo-Mendoza and Cedric Yen-Yu Lin and Alán Aspuru‐Guzik and Nathan Killoran},
  title = {{Differentiable quantum computational chemistry with PennyLane}},
  year = {2021},
  eprint = {2111.09967},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2111.09967},
}
Figure