Dirac is an important, standardized notation for representing quantum bits, states, and the different operations that can be acted on them.
1. Bras and Kets
Dirac Notation uses two main symbols to represent everything : bras and kets.
A bra is represented as : \(\bra{\psi}\)
And a ket is represented as: \(\ket{\psi}\)
That is why another name for Dirac Notation is simply, “Bra-Ket Notation” or “Braket Notation”
Bras are used to represent row vectors, while kets are used to represent column vectors.
\[\bra{\psi} = \left( x , y \right)\]
\[\begin{split}\ket{\psi} = \begin{pmatrix} x \\ y \end{pmatrix}\end{split}\]
1.1 Basic Operations with Bras and Kets
Most operations that can be done on vectors can be done with bras and kets. Using the following definitions, we can define basic arithmetic operations.
\[\bra{\psi} = \left( 0 , \psi \right)\]
\[\bra{\zeta} = \left( 0 , \zeta \right)\]
\[\begin{split}\ket{\gamma} = \begin{pmatrix} 0 \\ \gamma \end{pmatrix}\end{split}\]
\[\begin{split}\ket{\beta} = \begin{pmatrix} 0 \\ \beta \end{pmatrix}\end{split}\]
Addition:
\[\bra{\psi} + \bra{\zeta} = \left( 0 , \psi \right) + \left( 0 , \zeta \right) = \left( 0 , \psi + \zeta \right)\]
\[\begin{split}\ket{\gamma} + \ket{\beta} = \begin{pmatrix} 0 \\ \gamma \end{pmatrix} + \begin{pmatrix} 0 \\ \beta \end{pmatrix} = \begin{pmatrix} 0 \\ \gamma + \beta \end{pmatrix}\end{split}\]
Subtraction:
\[\bra{\psi} - \bra{\zeta} = \left( 0 , \psi \right) - \left( 0 , \zeta \right) = \left( 0 , \psi - \zeta \right)\]
\[\begin{split}\ket{\gamma} - \ket{\beta} = \begin{pmatrix} 0 \\ \gamma \end{pmatrix} - \begin{pmatrix} 0 \\ \beta \end{pmatrix} = \begin{pmatrix} 0 \\ \gamma - \beta \end{pmatrix}\end{split}\]
Scalar Multiplication:
\[\alpha\bra{\psi} = \alpha\left( 0 , \psi \right) = \left( 0 , \alpha\psi \right)\]
\[\begin{split}\alpha\ket{\gamma} = \alpha\begin{pmatrix} 0 \\ \gamma \end{pmatrix} = \begin{pmatrix} 0 \\ \alpha\gamma \end{pmatrix}\end{split}\]
1.2 What do kets represent?
Kets are used to represent quantum states. Listed are some commonly used states:
Zero State:
\[\begin{split}\ket{0} = \begin{pmatrix} 1 \\ 0 \end{pmatrix}\end{split}\]
One State:
\[\begin{split}\ket{1} = \begin{pmatrix} 0 \\ 1 \end{pmatrix}\end{split}\]
Plus State:
\[\begin{split}\ket{+} = \frac{1}{\sqrt{2}} \left(\ket{0} + \ket{1} \right) = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 \\ 1 \end{pmatrix}\end{split}\]
Minus State:
\[\begin{split}\ket{-} = \frac{1}{\sqrt{2}} \left(\ket{0} - \ket{1} \right) = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 \\ -1 \end{pmatrix}\end{split}\]
1.3 What do bras represent?
The corresponding bra for a ket is the transpose of the complex conjugate:
Complex numbers are in the form \(a + bi\). The complex conjugate would be \(a - bi\).
That means that for a ket \(\ket{\psi}\):
\[\begin{split}\ket{\psi} = \begin{pmatrix} 2 \\ 3i \end{pmatrix}\end{split}\]
the corresponding bra would be
\[\bra{\psi} = \left( 2 , -3i \right)\]
2. Complex Operations with Bras and Kets
Now, we can use bras and kets to perform slightly more complex operations.
2.1 The Inner Product
Simply put, the inner product is a dot product.
\[\begin{split}\left( a , b\right)\cdot\begin{pmatrix}d \\ e \end{pmatrix}\end{split}\]
If we wanted to take the dot product of the two vectors above, we would get the scalar value \(ad + be\).
We can observe that in the dot product, we multiplied a row vector with a column vector. We can put this into braket notation in the following way:
\[\begin{split}\bra{\gamma} = \left( a , b\right) \qquad \ket{\psi} = \begin{pmatrix}d \\ e \end{pmatrix}\end{split}\]
Then in braket notation we write this as: \(\braket{\gamma | \psi}\)
Note that this is equivalent to the dot product that was originally written.
If we take the dot product of a vector with itself, we get the length of the vector.
\(\braket{\psi | \psi}\) gives us the length of the vector \(\psi\).
Oftentimes, we try and normalize vectors so that :math:`braket{psi | psi} = 1`

2.2 The Outer Product
If the inner product is a dot product, then the outer product is a tensor product.
In Dirac Notation, if we take the inner product and swap the bra and the ket, we have the syntax for the outer product:
\[\ket{\psi}\bra{\gamma}\]
Using our previous definitions of \(\bra{\gamma}\) and \(\ket{\psi}\),
we write the outer product as
\[\begin{split}\begin{pmatrix}d \\ e \end{pmatrix} \otimes \left( a , b\right)\end{split}\]
We treat the vectors as matrices and multiply as we normally would.
\[\begin{split}\begin{pmatrix} ad & bd \\ ae & be \end{pmatrix}\end{split}\]
NOTE: The inner product and the outer product result in two very different outcomes. The inner product results in a scalar value, but the outer product results in a matrix.
