state_props.is_mixed
¶
Check if state is mixed.
Module Contents¶
Functions¶
|
Determine if a given quantum state is mixed [1]. |
- state_props.is_mixed.is_mixed(state)¶
Determine if a given quantum state is mixed [1].
A mixed state by definition is a state that is not pure.
Examples
Consider the following density matrix:
\[\begin{split}\rho = \begin{pmatrix} \frac{3}{4} & 0 \\ 0 & \frac{1}{4} \end{pmatrix} \in \text{D}(\mathcal{X}).\end{split}\]Calculating the rank of \(\rho\) yields that the \(\rho\) is a mixed state. This can be confirmed in
toqito
as follows:>>> from toqito.states import basis >>> from toqito.state_props import is_mixed >>> e_0, e_1 = basis(2, 0), basis(2, 1) >>> rho = 3 / 4 * e_0 * e_0.conj().T + 1 / 4 * e_1 * e_1.conj().T >>> is_mixed(rho) True
References
- Parameters:
state (numpy.ndarray) – The density matrix representing the quantum state.
- Returns:
True
if state is mixed andFalse
otherwise.- Return type:
bool