toqito.state_props.is_ensemble
- toqito.state_props.is_ensemble(states)[source]
Determine if a set of states constitute an ensemble [WatEns18].
An ensemble of quantum states is defined by a function
\[\eta : \Gamma \rightarrow \text{Pos}(\mathcal{X})\]that satisfies
\[\text{Tr}\left( \sum_{a \in \Gamma} \eta(a) \right) = 1.\]Examples
Consider the following set of matrices
\[\eta = \left\{ \rho_0, \rho_1 \right\}\]where
\[\begin{split}\rho_0 = \frac{1}{2} \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}, \quad \rho_1 = \frac{1}{2} \begin{pmatrix} 0 & 0 \\ 0 & 1 \end{pmatrix}.\end{split}\]The set \(\eta\) constitutes a valid ensemble.
>>> from toqito.state_props import is_ensemble >>> import numpy as np >>> rho_0 = np.array([[0.5, 0], [0, 0]]) >>> rho_1 = np.array([[0, 0], [0, 0.5]]) >>> states = [rho_0, rho_1] >>> is_ensemble(states) True
References
[WatEns18]Watrous, John. “The theory of quantum information.” Section: “Ensemble of quantum states”. Cambridge University Press, 2018.
- Parameters:
states – The list of states to check.
- Returns:
Trueif states form an ensemble andFalseotherwise.