  Entangled quantum states are essential ingredients for many quantum
technologies, but they must be validated before they are used. As a full
characterization is prohibitively resource-intensive, recent work has focused
on developing methods to efficiently extract a few parameters of interest, in a
so-called verification framework. Most existing approaches are based on
preparing an ensemble of nominally identical and independent (IID) quantum
states, and then measuring each copy of the ensemble. However, this leaves no
states left for the intended quantum tasks and the IID assumptions do not
always hold experimentally. To overcome these challenges, we experimentally
implement quantum state certification (QSC), which measures only a subset of
the ensemble, certifying the fidelity of the remaining states. We use active
optical switches to randomly sample from sources of two-photon Bell states and
three-photon GHZ states, reporting statistically-sound fidelities in real time
without destroying the entire ensemble. Additionally, our QSC protocol removes
the assumption that the states are identical, is device-independent, and can
achieve close $N^{-1}$ scaling, in the number of states measured $N$.
Altogether, these benefits make our QSC protocol suitable for benchmarking
large-scale quantum computing devices and deployed quantum communication setups
relying on entanglement in both standard and adversarial situations.
