The Orthogonality Filter: Gram–Schmidt Projection in a Complex State Space
P. K. Majumdar
Abstract
This Python/NumPy program generates a reproducible, normalised random quantum state and constructs its rank-one projection operator. It then generates a second complex state and applies the Gram–Schmidt procedure to remove every component parallel to the first state, producing a normalised orthogonal vector. The program verifies the inner-product orthogonality, confirms that the projector is Hermitian and idempotent, and demonstrates that applying the projector to the orthogonal state produces a vector whose norm is numerically zero within a declared floating-point tolerance. This illustrates, computationally, how a projector completely filters out a state that lies in its orthogonal complement.