VQE Overview with PennyLane
Overview
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.
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
Cite all versions? Use the base QCR ID to always reference the latest version of this entry.
Join the Discussion
Comments (0)
No comments yet. Be the first to share your thoughts!