Code
qcr:2606.77483.1

Classical Shadows

This PennyLane demo implements classical shadows, a powerful and efficient protocol for characterizing a quantum state by predicting many of its properties from a small number of randomized measurements, introduced by Huang, Kueng, and Preskill. Full quantum state tomography requires a number of measurements that grows exponentially with the number of qubits, but classical shadows sidesteps this: by repeatedly applying a random unitary (for example a random Pauli or Clifford operation) and measuring, one collects a set of efficiently-storable classical snapshots, the classical shadow, from which the expectation values of many observables can be estimated with rigorous guarantees, and crucially the number of measurements scales only logarithmically with the number of target observables. The tutorial explains the construction of the shadow from randomized measurements, how to invert the measurement channel to build an unbiased estimator of the state, and how to use the median-of-means technique to combine snapshots into accurate predictions. It implements the protocol in PennyLane and demonstrates predicting several observables and fidelities of a prepared state. As a foundational tool for efficient quantum state characterization and learning, classical shadows is presented here in a clear, hands-on form in PennyLane.
Qubit
Circuit-based
Uploaded 2 days ago
13
Views
GitHub667
Citing this entry? Use this QCR ID
Uploaded by
QL
QCR Librarian

Overview

PennyLaneAI/demos
667238
README.md

Classical Shadows

This PennyLane demo implements classical shadows, a powerful and efficient protocol for characterizing a quantum state by predicting many of its properties from a small number of randomized measurements, introduced by Huang, Kueng, and Preskill. Full quantum state tomography requires a number of measurements that grows exponentially with the number of qubits, but classical shadows sidesteps this: by repeatedly applying a random unitary (for example a random Pauli or Clifford operation) and measuring, one collects a set of efficiently-storable classical snapshots, the classical shadow, from which the expectation values of many observables can be estimated with rigorous guarantees, and crucially the number of measurements scales only logarithmically with the number of target observables. The tutorial explains the construction of the shadow from randomized measurements, how to invert the measurement channel to build an unbiased estimator of the state, and how to use the median-of-means technique to combine snapshots into accurate predictions. It implements the protocol in PennyLane and demonstrates predicting several observables and fidelities of a prepared state. As a foundational tool for efficient quantum state characterization and learning, classical shadows is presented here in a clear, hands-on form in PennyLane.

Run it

pip install -r requirements.txt
python demo.py

Source and license

Imported from demonstrations_v2/tutorial_classical_shadows/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 16, 2026
qcr:2606.77483.1

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

Tools used

PennyLane

Keywords

classical-shadows
tomography
characterization
pennylane
randomized-measurements

You may also like5