toqito.states.bell ================== .. py:module:: toqito.states.bell .. autoapi-nested-parse:: Bell states represent the simplest examples of quantum entanglement of two qubits. Also known as EPR pairs, Bell states comprise of four quantum states in a superposition of 0 and 1. Module Contents --------------- .. py:function:: bell(idx) Produce a Bell state [@WikiBellSt]. Returns one of the following four Bell states depending on the value of `idx`: \[ \begin{equation} \begin{aligned} u_0 = \frac{1}{\sqrt{2}} \left( |00 \rangle + |11 \rangle \right), & \qquad & u_1 = \frac{1}{\sqrt{2}} \left( |00 \rangle - |11 \rangle \right), \\ u_2 = \frac{1}{\sqrt{2}} \left( |01 \rangle + |10 \rangle \right), & \qquad & u_3 = \frac{1}{\sqrt{2}} \left( |01 \rangle - |10 \rangle \right). \end{aligned} \end{equation} \] .. rubric:: Examples When `idx = 0`, this produces the following Bell state: \[ u_0 = \frac{1}{\sqrt{2}} \left( |00 \rangle + |11 \rangle \right). \] Using `|toqito⟩`, we can see that this yields the proper state. ```python exec="1" source="above" from toqito.states import bell import numpy as np print(bell(0)) ``` :raises ValueError: If `idx` is not an integer. :param idx: A parameter in [0, 1, 2, 3] :returns: Bell state with index `idx`.