Skip to content

is_distinguishable

Checks if a set of quantum states are distinguishable.

is_distinguishable

is_distinguishable(states: list[ndarray], probs: list[float] | None = None) -> bool | bool_

Check whether a collection of vectors are (perfectly) distinguishable or not.

The ability to determine whether a set of quantum states are distinguishable can be obtained via the state distinguishability SDP as defined in state_distinguishability

Examples:

The set of Bell states are an example of distinguishable states. Recall that the Bell states are defined as:

\[ \begin{aligned} u_1 &= \frac{1}{\sqrt{2}} \left(|00\rangle + |11\rangle\right), \quad u_2 = \frac{1}{\sqrt{2}} \left(|00\rangle - |11\rangle\right), \\ u_3 &= \frac{1}{\sqrt{2}} \left(|01\rangle + |10\rangle\right), \quad u_4 = \frac{1}{\sqrt{2}} \left(|01\rangle - |10\rangle\right). \end{aligned} \]

It can be checked in toqito that the Bell states are distinguishable:

from toqito.states import bell
from toqito.state_props import is_distinguishable
bell_states = [bell(0), bell(1), bell(2), bell(3)]
print(is_distinguishable(bell_states))

True

Parameters:

  • states (list[ndarray]) –

    A set of vectors consisting of quantum states to determine the distinguishability of.

  • probs (list[float] | None, default: None ) –

    Respective list of probabilities each state is selected. If no probabilities are provided, a uniform

Returns:

  • bool | bool_

    True if the vectors are distinguishable; False otherwise.

Source code in toqito/state_props/is_distinguishable.py
def is_distinguishable(states: list[np.ndarray], probs: list[float] | None = None) -> bool | np.bool_:
    r"""Check whether a collection of vectors are (perfectly) distinguishable or not.

    The ability to determine whether a set of quantum states are distinguishable can be obtained via the state
    distinguishability SDP as defined in `state_distinguishability`

    Examples:
        The set of Bell states are an example of distinguishable states. Recall that the Bell states are defined as:

        \[
        \begin{aligned}
        u_1 &= \frac{1}{\sqrt{2}} \left(|00\rangle + |11\rangle\right), \quad
        u_2 = \frac{1}{\sqrt{2}} \left(|00\rangle - |11\rangle\right), \\
        u_3 &= \frac{1}{\sqrt{2}} \left(|01\rangle + |10\rangle\right), \quad
        u_4 = \frac{1}{\sqrt{2}} \left(|01\rangle - |10\rangle\right).
        \end{aligned}
        \]

        It can be checked in `toqito` that the Bell states are distinguishable:

        ```python exec="1" source="above"
        from toqito.states import bell
        from toqito.state_props import is_distinguishable
        bell_states = [bell(0), bell(1), bell(2), bell(3)]
        print(is_distinguishable(bell_states))
        ```

    Args:
        states: A set of vectors consisting of quantum states to determine the distinguishability of.
        probs: Respective list of probabilities each state is selected. If no probabilities are provided, a uniform
        probability distribution is assumed.

    Returns:
        `True` if the vectors are distinguishable; `False` otherwise.

    """
    # The dual problem is less computationally intensive to compute in comparison to primal.
    opt_val, _ = state_distinguishability(vectors=states, probs=probs, primal_dual="dual")
    return np.isclose(opt_val, 1)