state_props.is_pure

Check if state is pure.

Module Contents

Functions

is_pure(state)

Determine if a given state is pure or list of states are pure [1].

state_props.is_pure.is_pure(state)

Determine if a given state is pure or list of states are pure [1].

A state is said to be pure if it is a density matrix with rank equal to 1. Equivalently, the state \(\rho\) is pure if there exists a unit vector \(u\) such that:

\[\rho = u u^*.\]

Examples

Consider the following Bell state:

\[u = \frac{1}{\sqrt{2}} \left( |00 \rangle + |11 \rangle \right) \in \mathcal{X}.\]

The corresponding density matrix of \(u\) may be calculated by:

\[\begin{split}\rho = u u^* = \frac{1}{2} \begin{pmatrix} 1 & 0 & 0 & 1 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 1 & 0 & 0 & 1 \end{pmatrix} \in \text{D}(\mathcal{X}).\end{split}\]

Calculating the rank of \(\rho\) yields that the \(\rho\) is a pure state. This can be confirmed in toqito as follows:

>>> from toqito.states import bell
>>> from toqito.state_props import is_pure
>>> u = bell(0)
>>> rho = u * u.conj().T
>>> is_pure(rho)
True

It is also possible to determine whether a set of density matrices are pure. For instance, we can see that the density matrices corresponding to the four Bell states yield a result of True indicating that all states provided to the function are pure.

>>> from toqito.states import bell
>>> from toqito.state_props import is_pure
>>> u0, u1, u2, u3 = bell(0), bell(1), bell(2), bell(3)
>>> rho0 = u0 * u0.conj().T
>>> rho1 = u1 * u1.conj().T
>>> rho2 = u2 * u2.conj().T
>>> rho3 = u3 * u3.conj().T
>>>
>>> is_pure([rho0, rho1, rho2, rho3])
True

References

[1] (1,2)

Wikipedia. Quantum state - pure states. https://en.wikipedia.org/wiki/Quantum_state#Pure_states_of_wave_functions.

Parameters:

state (list[numpy.ndarray] | numpy.ndarray) – The density matrix representing the quantum state or a list of density matrices representing quantum states.

Returns:

True if state is pure and False otherwise.

Return type:

bool