Tutorials
qcr:2607.99201.1

Differentiable Hartree-Fock with PennyLane

This PennyLane demo introduces the differentiable Hartree-Fock solver in PennyLane's quantum chemistry module, based on the work of Arrazola and collaborators. The Hartree-Fock method finds molecular orbitals that minimize the energy of a system in which each electron feels the mean field of the others, and these orbitals define the one- and two-body integrals that build a second-quantized molecular Hamiltonian, which is then mapped to qubits. The key feature here is that every step, from atomic and molecular orbital construction through the Fock matrix and self-consistent field equations, is fully differentiable, so gradients of the resulting Hamiltonian can be taken with respect to the parameters it depends on using automatic differentiation. The tutorial builds on this to set up a variational quantum eigensolver workflow that jointly optimizes three sets of parameters at once, the circuit parameters, the nuclear coordinates, and the basis-set parameters, and it shows how to visualize the atomic and molecular orbitals to animate a bonding orbital during optimization. It matters because differentiating through the Hamiltonian itself enables tasks like geometry optimization, vibrational analysis, and basis-set refinement to be handled natively and efficiently within a single automatically differentiable quantum chemistry pipeline.
Chemistry
Qubit
Circuit-based
Uploaded 4 weeks ago
7
Views
Citing this entry? Use this QCR ID
Uploaded by
QL
QCR Librarian

Overview

PennyLaneAI/demos
675242
README.md

Differentiable Hartree-Fock with PennyLane

This PennyLane demo introduces the differentiable Hartree-Fock solver in PennyLane's quantum chemistry module, based on the work of Arrazola and collaborators. The Hartree-Fock method finds molecular orbitals that minimize the energy of a system in which each electron feels the mean field of the others, and these orbitals define the one- and two-body integrals that build a second-quantized molecular Hamiltonian, which is then mapped to qubits. The key feature here is that every step, from atomic and molecular orbital construction through the Fock matrix and self-consistent field equations, is fully differentiable, so gradients of the resulting Hamiltonian can be taken with respect to the parameters it depends on using automatic differentiation. The tutorial builds on this to set up a variational quantum eigensolver workflow that jointly optimizes three sets of parameters at once, the circuit parameters, the nuclear coordinates, and the basis-set parameters, and it shows how to visualize the atomic and molecular orbitals to animate a bonding orbital during optimization. It matters because differentiating through the Hamiltonian itself enables tasks like geometry optimization, vibrational analysis, and basis-set refinement to be handled natively and efficiently within a single automatically differentiable quantum chemistry pipeline.

Run it

pip install -r requirements.txt
python demo.py

Source and license

Imported from demonstrations_v2/tutorial_differentiable_HF/demo.py in PennyLaneAI/demos at c52c0abeb5122218aa96b38eea848864cce7323f, under the Apache License 2.0. Original authors: Xanadu and the PennyLane community. The upstream LICENSE is included alongside this example.

Join the Discussion

Comments (0)

No comments yet. Be the first to share your thoughts!

Indexed by QCR Librarian

This entry was created automatically from publicly available records. QCR links to public sources and only stores repository content where the license permits redistribution.

Publication

doi:10.48550/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, Jay Soni, Maria Schuld, Rodrigo A. Vargas-Hernández, Teresa Tamayo-Mendoza, Cedric Yen-Yu Lin, Alán Aspuru-Guzik, Nathan Killoran

Versions

v1 Latest
Jul 14, 2026
qcr:2607.99201.1

Cite all versions? Use the base QCR ID to always reference the latest version of this entry.

Tools used

PennyLane

Keywords

pennylane
quantum-chemistry
hartree-fock
vqe
automatic-differentiation
molecular-hamiltonian

You may also like5