bloch-sphere-0

Bra-Ket Notation

We're now going to cover a slightly different notation for doing linear algebra called Bra-ket notation. It was invented by Paul Dirac ins his 1939 publication "A New Notation for Quantum Mechanics". Although it won't be immmediately obvious, this notation will be very convenient as we jump into quantum computing

This notation will give us many new and interesting tools to use, but we will just cover the basics in this article as we've already spent long enough build the mathematical foundations.

Definitions

There are 4 fundamental objects we will use:

A Ket looks like this v\ket{v} and it will represent a vector.

A Bra looks like this v\bra{v}. It's a bit more tricky to define straight away so I'll defer a proper explanation until later on.

Next are operators. An operator will typically be represented by a capital roman letter e.g. AA. These will be the exact same as operators from the previous article.

And then just as before, we will have scalars represented as lowercase roman letters. The one slight difference we'll introduce here is that scalars can multiply bras, kets and operators:ava\ket{v}, bvb\bra{v} or cAcA. We'll see more about what this means later. As alluded to in the previous article, we are primarily interested in the case when these scalars are complex numbers.

The Inner Product

With bra-ket notation we would represent the inner product of two vectors v\ket{v} and w\ket{w} as vw\braket{v|w}. Notice that we've flipped the ket v\ket{v} into a bra v\bra{v} here. So this is in effect a bra acting on a ket. This is our first clue as to what a bra actually is.

We can represent the 3 rules discussed in the previous articles as such:

Linearity in the second argument

u(av+bw)=auv+buw\bra{u}\bigl(a\ket{v} + b\ket{w}\bigr) = a\braket{u|v} + b\braket{u|w}

Conjugate symmetry

vw=wv\braket{v|w}=\braket{w|v}^*

Positive definiteness

vv0  and  vv=0v=0\braket{v|v}\geq0\ \ \text{and}\ \ \braket{v|v}=0 \longleftrightarrow \ket{v}=0

Outer Product

Another operation we can perform here is called the outer product. It looks like this: vw\ket{v}\bra{w}. The result of this operation is an operator. We will define what this operator does in the following way:

uvwvwu\ket{u}\bra{v}\ket{w}\equiv\braket{v|w}\ket{u}

So when an outer product acts on a ket, we get the inner product of the right bra with that ket, multiplied as a coefficient of the left ket.

Remember, a bra acting on a ket (vw\braket{v|w}) gives us a scalar and a ket acting on a bra (vw\ket{v}\bra{w}) gives us an operator.

Bringing it all together

Now we've got some definitions in our mathematical toolkit, let's see what we can do with them!

To kick things off, I'll define some new notation. Instead of using v\ket{v} and w\ket{w} as vectors I'm going to define the following:

0,1,2,...,dVandij={1 if i=j0 if ij\ket{0},\ket{1},\ket{2},...,\ket{d} \in V \qquad \text{and} \qquad \braket{i|j}=\begin{cases}1\text{ if }i = j \\ 0\text{ if }i\neq j\end{cases}

So we have dd vectors, that are members of the vector space VV. They are all orthogonal to eachother. That is, the inner product of any two vectors is 0. They are also normal, as the inner product of a vector with itself is 1.

So the vectors 0,1,,d\ket{0}, \ket{1}, \ldots, \ket{d} form an orthonormal basis of dimension dd.

An arbitrary vector v\ket{v} in our space VV can then be defined as:

v=v00+v11++vdd=ivii\ket{v}= v_0\ket{0} + v_1\ket{1} + \ldots + v_d\ket{d} = \sum_i{v_i\ket{i}}

Linear operators as outer products

We've already seen how the outer product of two vectors can give us a linear operator. What we will show now is how we can represent a linear operator as a sum of coefficients of outer products.

The most basic operator we will investigate first is the identity operator:

I=00+11++dd=iiiI = \ket{0}\bra{0} + \ket{1}\bra{1} + \ldots + \ket{d}\bra{d} = \sum_i\ket{i}\bra{i}

It might not be intuitive how that works at first, so let's try it out on our arbitrary vector v\ket{v} defined above:

Iv=(iii)(jvjj)I\ket{v} = \bigl(\sum_i\ket{i}\bra{i}\bigr)\bigl(\sum_j{v_j\ket{j}}\bigr)

Note here that I've changed the iterator ii to jj in the second sum to ease our calculation here.

Our operators are linear so they distribute over addition:

=i,jiivjj=i,jvjiij=i,jvjiji=\sum_{i,j}\ket{i}\bra{i}v_j\ket{j} \\[3ex] =\sum_{i,j}v_j\ket{i}\bra{i}\ket{j} \\[3ex] =\sum_{i,j}v_j\braket{i|j}\ket{i}

But we know from our definition from earlier that ij\braket{i|j} is 0 when iji\neq j and 1 when i=ji=j . This means we can simplify our sum to:

=ivii=v=\sum_i v_i\ket{i} = \ket{v}

So we have proved that this does indeed implement the identity operator!

Here are some definitions of interesting 2-dimensional linear operators. Note that in these definitions we assume that 0\ket{0} is the first basis vector and 1\ket{1} is the second.

X=01+10Y=i01+i10Z=0011X = \ket{0}\bra{1} + \ket{1}\bra{0} \\[3ex] Y = -i\ket{0}\bra{1} + i\ket{1}\bra{0} \\[3ex] Z = \ket{0}\bra{0} - \ket{1}\bra{1}

Let's define a 2D vector v=a0+b1\ket{v} = a\ket{0} + b\ket{1} and see how the XX operator acts on it:

Xv=(01+10)(a0+b1)=a(01+10)0+b(01+10)1=a(010+100)+b(011+101)=a(100+001)+b(110+011)X\ket{v} = \bigl(\ket{0}\bra{1} + \ket{1}\bra{0}\bigr)\bigl(a\ket{0} + b\ket{1}\bigr) \\[3ex] = a\bigl(\ket{0}\bra{1} + \ket{1}\bra{0}\bigr)\ket{0} + b\bigl(\ket{0}\bra{1} + \ket{1}\bra{0}\bigr)\ket{1} \\[3ex] = a\bigl(\ket{0}\bra{1}\ket{0} + \ket{1}\bra{0}\ket{0}\bigr) + b\bigl(\ket{0}\bra{1}\ket{1} + \ket{1}\bra{0}\ket{1}\bigr) \\[3ex] = a\bigl(\braket{1|0}\ket{0} + \braket{0|0}\ket{1}\bigr) + b\bigl(\braket{1|1}\ket{0} + \braket{0|1}\ket{1}\bigr)

Then we apply our inner product rules in our definition:

=a(00+11)+b(10+01)=a1+b0= a\bigl(0\ket{0} + 1\ket{1}\bigr) + b\bigl(1\ket{0} + 0\ket{1}\bigr) \\[3ex] = a\ket{1} + b\ket{0}

So the effect of the XX operator was to flip the coefficients of 0\ket{0} and 1\ket{1}. I encourage you to have a play with the other operators and see what they do.

Let's take a second to reflect here, this is really interesting. Just in the same way that we can represent any vector as a sum of multiples of basis vectors, we can also represent any linear operator as a sum of multiples of outer-products of basis vectors. You may recall in the previous article where we said to define a linear operator, we only need to define how it acts on the basis vectors. And this proves just that. You can see, for example, in the definition of XX that it takes the basis vector 0\ket{0} to 1\ket{1} and the basis vector 1\ket{1} to 0\ket{0}.

Exercises

Exercise 1

Show that XY=iZXY = iZ.

Show solution

Exercise 2

Continuing on from the previous exercise, check what the other XX, YY and ZZ operators do when multiplied together. What patterns do you notice?

Show solution
> Next Chapter (Qubits and Gates)