Code
qcr:2606.36880.1

VQE Overview with PennyLane

This PennyLane demo is the central introduction to the Variational Quantum Eigensolver (VQE), the flagship near-term quantum algorithm for quantum chemistry, applied here to compute the ground-state energy of a molecule. VQE finds the lowest eigenvalue of a molecule's electronic Hamiltonian by preparing a parameterized trial state (ansatz) on a quantum computer, measuring its energy expectation value, and using a classical optimizer to vary the parameters until the energy is minimized, relying on the variational principle that any trial energy upper-bounds the true ground state. The tutorial walks through the full PennyLane chemistry workflow: defining a molecule and using PennyLane's qchem module to build its qubit Hamiltonian, constructing a chemically-motivated ansatz that prepares correlated electronic states, defining the energy as an expectation value, and optimizing the parameters with gradient-based optimization powered by PennyLane's automatic differentiation. It computes the ground-state energy of a small molecule (such as hydrogen) and compares it to the exact result. As the canonical quantum-chemistry demo, it gives the essential, reusable template for molecular ground-state calculations in PennyLane.
Chemistry
Qubit
Circuit-based
Uploaded 3 days ago
9
Views
GitHub667
Citing this entry? Use this QCR ID
Uploaded by
QL
QCR Librarian

Overview

PennyLaneAI/demos
667238
README.md

VQE Overview with PennyLane

This PennyLane demo is the central introduction to the Variational Quantum Eigensolver (VQE), the flagship near-term quantum algorithm for quantum chemistry, applied here to compute the ground-state energy of a molecule. VQE finds the lowest eigenvalue of a molecule's electronic Hamiltonian by preparing a parameterized trial state (ansatz) on a quantum computer, measuring its energy expectation value, and using a classical optimizer to vary the parameters until the energy is minimized, relying on the variational principle that any trial energy upper-bounds the true ground state. The tutorial walks through the full PennyLane chemistry workflow: defining a molecule and using PennyLane's qchem module to build its qubit Hamiltonian, constructing a chemically-motivated ansatz that prepares correlated electronic states, defining the energy as an expectation value, and optimizing the parameters with gradient-based optimization powered by PennyLane's automatic differentiation. It computes the ground-state energy of a small molecule (such as hydrogen) and compares it to the exact result. As the canonical quantum-chemistry demo, it gives the essential, reusable template for molecular ground-state calculations in PennyLane.

Run it

pip install -r requirements.txt
python demo.py

Source and license

Imported from demonstrations_v2/tutorial_vqe/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.

Versions

v1 Latest
Jun 15, 2026
qcr:2606.36880.1

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

Tools used

PennyLane

Keywords

vqe
quantum-chemistry
variational
pennylane
ground-state

You may also like5