Represent the pure states by density matrices and . The Pauli matrices obey and . Consequently
On the other hand, and make that trace equal to . Thus the pure-qubit overlap identity is
For mixed states the trace formula still holds, but its left side is then a Hilbert–Schmidt overlap rather than this squared pure-state overlap.