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.
There are 4 fundamental objects we will use:
A Ket looks like this and it will represent a vector.
A Bra looks like this . 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. . 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:, or . 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.
With bra-ket notation we would represent the inner product of two vectors and as . Notice that we've flipped the ket into a bra 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:
Another operation we can perform here is called the outer product. It looks like this: . The result of this operation is an operator. We will define what this operator does in the following way:
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 () gives us a scalar and a ket acting on a bra () gives us an operator.
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 and as vectors I'm going to define the following:
So we have vectors, that are members of the vector space . 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 form an orthonormal basis of dimension .
An arbitrary vector in our space can then be defined as:
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:
It might not be intuitive how that works at first, so let's try it out on our arbitrary vector defined above:
Note here that I've changed the iterator to in the second sum to ease our calculation here.
Our operators are linear so they distribute over addition:
But we know from our definition from earlier that is 0 when and 1 when . This means we can simplify our sum to:
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 is the first basis vector and is the second.
Let's define a 2D vector and see how the operator acts on it:
Then we apply our inner product rules in our definition:
So the effect of the operator was to flip the coefficients of and . 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 that it takes the basis vector to and the basis vector to .
Show that .
Continuing on from the previous exercise, check what the other , and operators do when multiplied together. What patterns do you notice?