states.bb84

BB84 basis states.

Module Contents

Functions

bb84()

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.

>>> from toqito.states import bb84
>>> x = bb84()
>>> print(f"|0> = {x[0][0].T}, \n |1> = {x[0][1].T}")
>>> print(f"|+> = {x[1][0].T}, \n |-> = {x[1][1].T}")
|0> = [[1. 0.]],
|1> = [[0. 1.]]
|+> = [[0.70710678 0.70710678]],
|-> = [[ 0.70710678 -0.70710678]]

References

[1] (1,2)

Wikipedia. Bb84. https://en.wikipedia.org/wiki/BB84.

Returns:

The four BB84 basis states.

Return type:

numpy.ndarray