Orthogonality Check
P. K. Majumdar
Abstract
This Jupyter Notebook provides a reproducible implementation for determining whether two complex quantum state vectors are orthogonal The notebook accompanies Chapter 2 of Quantum Computing Preliminaries and demonstrates how orthogonality is tested using the absolute value of the complex inner product The Python function accepts normalised or unnormalised state vectors and normalises them automatically before calculating their overlap The implementation validates that both inputs are finite nonempty one dimensional and equal in size It also rejects the zero vector because the zero vector cannot be normalised The calculation uses the NumPy vdot function to apply complex conjugation to the first vector correctly A numerical tolerance is used to determine whether the absolute overlap is sufficiently close to zero The function returns True when the states are orthogonal and False otherwise The notebook includes examples involving the computational zero state the computational one state the plus state and two unnormalised complex vectors The examples confirm that the computational zero and one states are orthogonal while the computational zero and plus states are not orthogonal The unnormalised complex example also demonstrates a pair of states that are not orthogonal Numerical assertions verify all calculated results The notebook requires Python 3 Jupyter Notebook or JupyterLab and NumPy No external datasets internet connection quantum computing framework or physical quantum hardware are required