Purity

Purity is a function that computes the purity of a quantum state $\rho$ (i.e., it computes the quantity ${\rm Tr}(\rho^2)$).

Syntax

 * GAMMA = Purity(RHO)

Argument descriptions

 * RHO: A density matrix to have its purity computed.

Purity of pure states
Pure states have purity equal to 1, as illustrated by the following code:

Purity of mixed states
If $\rho \in M_d$ is mixed then its purity is strictly less than 1. Its purity attains its minimum value of $1/d$ if and only if $\rho$ is the maximally-mixed state (i.e., the scaled identity operator).