states.bb84
¶
BB84 basis states.
Module Contents¶
Functions¶
|
Obtain the BB84 basis states [1]. |
- states.bb84.bb84()¶
Obtain the BB84 basis states [1].
The BB84 basis states are defined as
\[\begin{split}|0\rangle := \begin{pmatrix} 1 \\ 0 \end{pmatrix}, \quad \\ |1\rangle := \begin{pmatrix} 0 \\ 1 \end{pmatrix}, \quad \\ |+\rangle := \frac{1}{\sqrt{2}} \begin{pmatrix} 1 \\ 1 \end{pmatrix}, \quad \\ |-\rangle := \frac{1}{\sqrt{2}} \begin{pmatrix} 1 \\ -1 \end{pmatrix}.\end{split}\]Examples
The BB84 basis states can be obtained in
toqito
as follows in the form of a list of arrays.>>> from toqito.states import bb84 >>> bb84() [[array([[1.], [0.]]), array([[0.], [1.]])], [array([[0.70710678], [0.70710678]]), array([[ 0.70710678], [-0.70710678]])]]
Note
We use #doctest to verify our examples work as expected.
# doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE is used here to make sure doctest matches the calculated output to be close to the expected output instead of making sure both match exactly.
References
- Returns:
The four BB84 basis states.
- Return type:
numpy.ndarray