Quantum Phase Estimation with PennyLane
Overview
Quantum Phase Estimation with PennyLane
This PennyLane demo introduces Quantum Phase Estimation (QPE), one of the most important subroutines in quantum computing, which estimates the eigenvalue phase of a unitary operator for a given eigenstate and underpins algorithms from Shor's factoring to quantum chemistry. Given a unitary and one of its eigenstates, QPE writes the eigenvalue's phase into a register of estimation qubits to a precision set by their number. The tutorial builds QPE from its components in PennyLane: preparing the estimation register in superposition, applying controlled powers of the target unitary so that the unknown phase is kicked back and encoded as relative phases across the register, and applying an inverse Quantum Fourier Transform to convert those phases into a binary number that can be read by measurement. It shows how the number of estimation qubits controls the precision of the result and how to interpret the measured outcome as an approximation of the phase, using PennyLane's templates for the controlled unitaries and the inverse QFT. By assembling the estimator from clear building blocks and running it on a concrete example, the demo gives a hands-on, foundational understanding of phase estimation, the engine behind many advanced quantum algorithms, in PennyLane.
Run it
pip install -r requirements.txt
python demo.py
Source and license
Imported from demonstrations_v2/tutorial_qpe/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!