---
title: Classical Shadows Algorithm Overview
url: https://www.emergentmind.com/topics/classical-shadows-algorithm
type: topic
---

# Classical Shadows Algorithm Overview

A classical shadows algorithm is a randomized measurement protocol that produces a succinct classical representation of a quantum state, enabling simultaneous estimation of a large collection of expectation values with rigorous sample-complexity guarantees. The principal eigenstate classical shadows (PECS) protocol—also called the principal eigenstate shadow—extends this methodology to the task of learning a classical surrogate for the top eigenstate of a mixed quantum state, allowing efficient estimation of expectation values on the principal eigenvector even when the underlying state is only partially pure. PECS achieves near-optimal sample complexity over a full range of principal eigenvalue parameters and unifies the regimes of pure-state tomography, mixed-state shadow tomography, and top-eigenvector learning with joint measurements.

## 1. Problem Definition and Principal Eigenstate Setting

Given an unknown density matrix $\rho$ acting on a $d$-dimensional Hilbert space, suppose $\rho$ possesses a unique largest eigenvalue $\lambda>1/2$, associated with a rank-one projector $\phi=|\phi\rangle\langle\phi|$, and spectral gap $2\lambda-1>0$ to the rest. Denoting the principal deviation by $\eta=1-\lambda<1/2$, the goal is to efficiently learn a classical description $\hat\phi$ of $|\phi\rangle$ such that, for any observable $O$ with $\|O\|\le 1$ or squared Hilbert–Schmidt norm $\|O\|_2^2\le B$, one can accurately estimate $\langle\phi|O|\phi\rangle$ to additive accuracy $\epsilon$ with failure probability at most $\delta$, using as few copies of $\rho$ as possible.

This setting arises naturally in applications such as principal component analysis of quantum states, learning ground states of mixed-state ensembles, and quantum algorithms for dominant eigenvector estimation. A key constraint modeled in PECS is that state preparation is expensive, but collective (joint) measurements on small batches of copies are allowed [2405.13939].

## 2. Joint Symmetric Measurement Protocol

The PECS methodology is based on a generalized classical shadows protocol utilizing joint, entangling measurements across $n$ copies of $\rho$. One performs the standard symmetric POVM—a continuous measurement with elements
\[
\left\{F_\psi = \binom{n+d-1}{n} \, |\psi\rangle\langle\psi|^{\otimes n}\,d\psi,\ \psi\in\mathbb{CP}^{d-1}\right\}
\]
plus a fail element $F_{\rm fail}=I-\Pi_{\text{sym}}$, where $\Pi_{\text{sym}}$ projects onto the $n$-fold symmetric subspace.

The experiment samples $n$ copies of $\rho$ and performs this symmetric POVM:
- If the outcome is $\psi\neq$ "fail", the protocol outputs a classical description of the observed pure state $\psi$ (the Haar outcome).
- If the outcome is "fail", the experiment is repeated.

This protocol reduces to single-copy classical shadows for $n=1$, but crucially, for $n>1$, the symmetric joint measurement amplifies overlap with the unknown principal component $\phi$, enabling efficient variance reduction for $\lambda\gg1/2$ [2405.13939].

## 3. Classical Estimation and Averaging Procedure

Upon each successful $n$-copy measurement, the algorithm forms the raw estimator
\[
M = \frac{(d+n)\,|\psi\rangle\langle\psi| - I_d}{n}\;.
\]
Averaging theory (Kitaev–Massar–Popescu moments) shows that $E[M]=M_1$, where $M_1$ is an unbiased proxy for $\phi$ constructed from $n$-copy moments of $\rho$ and the symmetric subspace projector.

To reduce variance, the procedure is repeated $b$ times (each on fresh blocks of $n$ copies); the final estimator is
\[
\hat\phi = \frac{1}{b}\sum_{j=1}^b M^{(j)}.
\]
To estimate $\langle\phi|O|\phi\rangle$ for a target $O$, output $\operatorname{Tr}(O\hat\phi)$. For simultaneous estimation of $M$ observables, a median-of-means protocol is applied with $O(\log(M/\delta))$ independent shadow estimators [2405.13939].

## 4. Sample Complexity and Three-Regime Performance

The PECS protocol’s sample complexity for target additive error $\epsilon$ exhibits three parametric regimes as a function of the principal deviation $\eta=1-\lambda$:
- **Regime I: Nearly pure $\phi$ ($\eta \le 1/s^*$)**
  \[
  N = \Theta(s^*) = \Theta(\sqrt{B}/\epsilon + 1/\epsilon^2)
  \]
  where $s^* = \Theta(\sqrt{B}/\epsilon + 1/\epsilon^2)$. This matches the optimal pure-state shadows complexity and the lower bound for “state compression” [2211.11810].

- **Regime II: Moderately pure ($1/s^* \lesssim \eta \le \sqrt{\epsilon}$)**
  \[
  N = \Theta\big((B\eta + 1)/\epsilon^2\big)
  \]

- **Regime III: Fairly mixed ($\sqrt{\epsilon} \lesssim \eta < 1/2$)**
  \[
  N = \Theta(B\eta/\epsilon^2 + \eta/\epsilon^{5/2})
  \]

To guarantee accuracy $\epsilon$ with probability $\ge 1-\delta$ for $M$ observables, one multiplies $N$ by $O(\log(M/\delta))$ due to the median-of-means bound. As $\lambda \to 1$ ($\eta\to0$), the sample complexity recovers the pure-state bound $\Theta(\sqrt{B}/\epsilon + 1/\epsilon^2)$; for highly mixed states, PECS remains optimal among protocols using joint measurements [2405.13939].

## 5. Comparative Analysis and Optimality

PECS improves over and sometimes strictly outperforms all other natural strategies in the principal-eigenstate learning regime:
- **Single-copy classical shadows** require $N=\Theta(B/\epsilon^2)$ for $\eta\ll\epsilon$ and degrade to $N=\Theta(B\eta/\epsilon^3)$ for $\eta\gg\epsilon$.
- **Purification followed by shadows** (first apply $k$-copy purification to reduce $\eta\to O(\eta/k)$, then standard shadows) requires $N=\Omega(B\eta/\epsilon^3)$ in typical regimes.
- **Purification plus single joint measurement** (no averaging) gives $N=\Theta(s^*)$ for $\eta\le1/s^*$ and $N=\Theta(\eta(s^*)^2)$ for $\eta\ge1/s^*$, suboptimal compared to the three-regime PECS strategy.

A key theorem asserts that PECS is sample-optimal for $\eta\lesssim1/s^*$—including the pure limit—and always at least as good as hybrid alternatives even as the spectral gap closes [2405.13939].

## 6. Pseudocode Summary and Robustness Analysis

**Algorithm PECS** (single observable version)
1. *(Optional)* Estimate $\eta$ using 2-copy symmetric measurements (fail rate $\approx\eta$).
2. Select regime (I/II/III) given $\eta$, set purification parameter $k$, joint measurement block size $n$, and repetition count $b$.
3. *(If $k>1$)* Apply purification using $k$ copies to obtain a purer $\rho'$ with $\eta'=O(\eta/k)$.
4. For $j=1,\ldots, b$:
    - Measure $n$ fresh copies of $\rho'$ via the symmetric POVM to obtain $\psi_j$ or "fail".
    - If "fail", discard the block and repeat.
    - Compute $M^{(j)} = ((d+n)\psi_{j}\psi_{j} - I)/n$.
5. Output $\hat\phi = (1/b)\sum_{j=1}^b M^{(j)}$.
6. Estimate $\langle\phi|O|\phi\rangle$ via $\operatorname{Tr}(O\hat\phi)$.
7. *(If estimating $M$ observables)* Use median-of-means across $O(\log(M/\delta))$ runs.

**Key theorem (joint measurement robustness):** For $\rho = (1-\eta)\phi + \eta\sigma$ on $n$ copies, the symmetric POVM succeeds with probability at least $(1-\eta)^{n-1}$. On success, the raw estimator $M$ satisfies bias $O(\eta/n)$ and variance $O(1/n^2)$—so bias/variance are efficiently controlled by block size $n$ and spectral purity [2405.13939].

**Proof techniques** utilize Schur-Weyl duality, analysis of moments in symmetric subspaces, explicit computation of conditional distributions on eigenvalue counts, and the derivation of closed-form bias and variance for both the success conditioned random estimator and its implications for subsequent observable estimation.

## 7. Extensions, Limitations, and Outlook

PECS provides a sample-optimal protocol for principal eigenvector learning in the joint measurement setting, smoothly interpolating between previously distinct shadow-tomography regimes (pure-state, mixed-state, ground-state learning). While the focus is on the unique top eigenstate scenario ($\lambda>1/2$ and spectral gap), extensions to degenerate or near-degenerate principal eigenspaces may require further developments, as does adaptation to settings with hardware-induced noise or constraints on feasible entangling measurements.

The algorithm’s optimality and efficiency rely on the availability of collective symmetric measurements, which are natural in many photonic, atomic, and trapped-ion architectures supporting permutation-symmetric POVMs. As the field advances, further generalizations to higher-rank eigenprojectors, dynamical learning of time-evolving dominant components, and error-mitigated or symmetry-adapted PECS protocols are plausible research directions [2405.13939].

Source: https://www.emergentmind.com/topics/classical-shadows-algorithm