state_props.is_separable
¶
Check if state is separable.
Module Contents¶
Functions¶
|
Determine if a given state (given as a density matrix) is a separable state [1]. |
- state_props.is_separable.is_separable(state, dim=None, level=2, tol=1e-08)¶
Determine if a given state (given as a density matrix) is a separable state [1].
Examples
Consider the following separable (by construction) state:
\[\rho = \rho_1 \otimes \rho_2. \rho_1 = \frac{1}{2} \left( |0 \rangle \langle 0| + |0 \rangle \langle 1| + |1 \rangle \langle 0| + |1 \rangle \langle 1| \right) \rho_2 = \frac{1}{2} \left( |0 \rangle \langle 0| + |1 \rangle \langle 1| \right)\]The resulting density matrix will be:
\[\begin{split}\rho = \frac{1}{4} \begin{pmatrix} 1 & 0 & 1 & 0 \\ 0 & 1 & 0 & 1 \\ 1 & 0 & 1 & 0 \\ 0 & 1 & 0 & 1 \end{pmatrix} \in \text{D}(\mathcal{X}).\end{split}\]We provide the input as a denisty matrix \(\rho\).
On the other hand, a random density matrix will be an entangled state (a separable state). >>> from toqito.rand import random_density_matrix >>> from toqito.state_props import is_separable >>> rho_separable = np.array([[1, 0, 1, 0], … [0, 1, 0, 1], … [1, 0, 1, 0], … [0, 1, 0, 1]]) >>> rho_random = random_density_matrix(4) >>> is_separable(rho_separable) True >>> is_separable(rho_random) False
References
- Raises:
ValueError – If dimension is not specified.
- Parameters:
state (numpy.ndarray) – The matrix to check.
dim (None | int | list[int]) – The dimension of the input.
level (int) – The level up to which to search for the symmetric extensions.
tol (float) – Numerical tolerance used.
- Returns:
True
ifrho
is separabale andFalse
otherwise.- Return type:
bool