Bell

From QETLAB
Jump to navigation Jump to search
Bell
Produces a Bell state

Other toolboxes required none
Related functions MaxEntangled
Function category Special states, vectors, and operators

Bell is a function that returns one of the four Bell states in 2-qubit space:

\(\displaystyle\begin{align*}|\phi_0\rangle = \frac{1}{\sqrt{2}}(|0\rangle\otimes|0\rangle + |1\rangle\otimes|1\rangle) & & & & |\phi_2\rangle = \frac{1}{\sqrt{2}}(|0\rangle\otimes|1\rangle + |1\rangle\otimes|0\rangle) \\ |\phi_1\rangle = \frac{1}{\sqrt{2}}(|0\rangle\otimes|0\rangle - |1\rangle\otimes|1\rangle) & & & & |\phi_3\rangle = \frac{1}{\sqrt{2}}(|0\rangle\otimes|1\rangle - |1\rangle\otimes|0\rangle) \\\end{align*}\)

Syntax

  • PHI = Bell()
  • PHI = Bell(IND)
  • PHI = Bell(IND,SP)
  • PHI = Bell(IND,SP,NRML)

Argument descriptions

  • IND (optional, default 0): The index of the Bell state (i.e., the subscript, from 0 to 3, of the Bell state that you would like, as indicated above).
  • SP (optional, default 0): A flag (either 1 or 0) indicating that PHI should or should not be sparse.
  • NRML (optional, default 1): A flag (either 1 or 0) indicating that PHI should or should not be scaled to have Euclidean norm 1. If NRML=0 then each entry of PHI is 0 or 1, so it has norm $\sqrt{2}$.

Examples

The following code generates a matrix whose columns are the four different Bell states:

>> [Bell(0),Bell(1),Bell(2),Bell(3)]

ans =

    0.7071    0.7071         0         0
         0         0    0.7071    0.7071
         0         0    0.7071   -0.7071
    0.7071   -0.7071         0         0

Source code

Click on "expand" to the right to view the MATLAB source code for this function.