The State Measurement Engine: Validating and Applying a Quantum Projector
P. K. Majumdar
Abstract
This Python/NumPy program implements an ideal projective measurement for a single-qubit state. It verifies that the supplied state is normalised and that the measurement operator is both Hermitian and idempotent. It then applies the Born rule to calculate the probability of the selected outcome. When the probability is non-zero, the program constructs and normalises the conditional post-measurement state; when the probability is zero within the specified numerical tolerance, it reports that the outcome cannot occur and avoids invalid normalisation of the zero vector. Two worked examples demonstrate both a possible and an impossible measurement outcome.