Dirac’s bra-ket linear algebra notation

Jim Mahoney, Nov 2010

Dirac invented a vector notation for quantum states which is used everywhere by physicists.

⟨α\[VerticalSeparator]H\[VerticalSeparator]β⟩

In quantum jargon, α and β are “states” (e.g. a place that a particle can be), while H is an “operator” (which does something to the particle, like bounce a photon off it).  This expression represents a number, namely the probability of starting in state β, getting hit by  H, and ending up at α. 

But none of those details really matter for this discussion.

What matters is here as that this is just a linear algebra expression: α is a column vector, β is a row vector, and  (OverHat[H]) is a square matrix.

(({{(Subscript[α, 1]), (Subscript[α, 2]), …}}))(({{(Subscript[H, 11]), (Subscript[H, 12]), …}, {(Subscript[H, 21]), (Subscript[H, 22]), …}, {…, …, …}}))(({{(Subscript[β, 1])}, {(Subscript[β, 2])}, {…}}))

If the vectors have N components, then this is just a (1x N)·(N x N)·(N x 1) matrix multiplication.  
⟨α| is called a “bra”, and |β⟩ is called a “ket”.

It turns out that this notation can be very useful for some sorts of linear algebra manipulations - change of basis,  finding the coordinates of a vector in a given basis, using projection operators - stuff like that.  

Let’s start with a simple example, and convert it into this notation.

traditional notation

In traditional notation, we’d write the dot product of the two vectors above as

(OverVector[α])·(OverVector[β])

And if we have an orthnormal basis (Subscript[(OverHat[ℯ]), i]) lying around, with dot products

(Subscript[(OverHat[ℯ]), i])·(Subscript[(OverHat[ℯ]), j]) = (Subscript[δ, ij])

then we’d write

(OverVector[α])=(Subscript[α, 1])(Subscript[(OverHat[ℯ]), 1]) + (Subscript[α, 2])(Subscript[(OverHat[ℯ]), 2])
(OverVector[β])=(Subscript[β, 1])(Subscript[(OverHat[ℯ]), 1]) + (Subscript[β, 2])(Subscript[(OverHat[ℯ]), 2])

You may more used to seeing( (Subscript[α, x])(OverHat[ı]) + (Subscript[α, y]) (OverHat[ȷ])); this is the same exact thing.

Plugging in and simplifying gives

(OverVector[α])·(OverVector[β]) = ((Subscript[α, 1])(Subscript[(OverHat[ℯ]), 1]) + (Subscript[α, 2])(Subscript[(OverHat[ℯ]), 2]))((Subscript[β, 1])(Subscript[(OverHat[ℯ]), 1]) + (Subscript[β, 2])(Subscript[(OverHat[ℯ]), 2]))
	= (Subscript[α, 1])(Subscript[(OverHat[ℯ]), 1]) ·(Subscript[β, 1])(Subscript[(OverHat[ℯ]), 1]) + (Subscript[α, 1])(Subscript[(OverHat[ℯ]), 1])·(Subscript[β, 2])(Subscript[(OverHat[ℯ]), 2]) + (Subscript[α, 2])(Subscript[(OverHat[ℯ]), 2])·(Subscript[β, 1])(Subscript[(OverHat[ℯ]), 1])+(Subscript[α, 2])(Subscript[(OverHat[ℯ]), 2])·(Subscript[β, 2])(Subscript[(OverHat[ℯ]), 2])
	= (Subscript[α, 1]) (Subscript[β, 1]) + (Subscript[α, 2]) (Subscript[β, 2])

which is how you turn an abstract vector dot product into coordinates that you can actually calculate.

OK, suppose you didn’t know what (Subscript[α, 1]) was, how could you write an expression for it?
I’m glad you asked.  We just take the expression for (OverVector[β]) up above, and do a dot product with (Subscript[(OverHat[ℯ]), 1]) on both sides :

(Subscript[(OverHat[ℯ]), 1])·(OverVector[β])= (Subscript[(OverHat[ℯ]), 1])·((Subscript[β, 1])(Subscript[(OverHat[ℯ]), 1]) + (Subscript[β, 2])(Subscript[(OverHat[ℯ]), 2])) = (Subscript[β, 1])

Dirac notation

Now it’s time to put all this into Dirac’s notation.

The dot product of two vectors is

⟨α\[VerticalSeparator]β⟩

Our basis vectors are |i⟩with dot products

⟨i\[VerticalSeparator]j⟩ = (Subscript[δ, ij])

But in the next step, instead of writing coordinates like (Subscript[β, 1]), instead we write explicitly ⟨i|β⟩.

This is where it starts to get very cool: this isn’t just a name for the i’th component of β ; this actually is the i’th component of beta.  

Moving right along with what we did before, we now write

⟨α\[VerticalSeparator]= ⟨α\[VerticalSeparator]1⟩⟨1\[VerticalSeparator] + ⟨α\[VerticalSeparator]2⟩⟨2\[VerticalSeparator]
 ⟨β\[VerticalSeparator]= ⟨β\[VerticalSeparator]1⟩⟨1\[VerticalSeparator] + ⟨β\[VerticalSeparator]2⟩⟨2\[VerticalSeparator]

However, before we can now take the dot product of these two and simplify, we need to “flip” (OverVector[β]) from its bra form ⟨β| to its ket form |β⟩.  Technically in linear algrebra jargon this is “the dual”; essentially its just changing from a column vector to a row vector, so that the matrix multiplication works.  So, flipping the second line end for end and plugging in gives

⟨α\[VerticalSeparator]β⟩ =  (  ⟨α\[VerticalSeparator]1⟩⟨1\[VerticalSeparator] + ⟨α\[VerticalSeparator]2⟩⟨2\[VerticalSeparator]  )     ( \[VerticalSeparator]1⟩⟨1\[VerticalSeparator]β⟩ + \[VerticalSeparator]2⟩⟨2\[VerticalSeparator]β⟩  )
	= ⟨α\[VerticalSeparator]1⟩ ⟨1\[VerticalSeparator]1⟩⟨1\[VerticalSeparator]β⟩ +  ⟨α\[VerticalSeparator]1⟩⟨1\[VerticalSeparator]2⟩ ⟨2\[VerticalSeparator]β⟩ + 
	⟨α\[VerticalSeparator]2⟩⟨1\[VerticalSeparator]β⟩ ⟨2\[VerticalSeparator]1⟩ +  ⟨α\[VerticalSeparator]2⟩⟨2\[VerticalSeparator]2⟩ ⟨2\[VerticalSeparator]β⟩
	= ⟨α\[VerticalSeparator]1⟩⟨1\[VerticalSeparator]β⟩ + ⟨α\[VerticalSeparator]2⟩⟨2\[VerticalSeparator]β⟩

Before going any further, make sure you see that this is the same the result before. 

But this time, we aren’t done; we can factor this part on the right to get.

⟨α\[VerticalSeparator]β⟩ = ⟨α\[VerticalSeparator] (  \[VerticalSeparator]1⟩⟨1\[VerticalSeparator] + \[VerticalSeparator]2⟩⟨2\[VerticalSeparator] ) \[VerticalSeparator]β⟩

or, since the part in the middle clearly is just some kind of identify multiplication

𝟙 = \[VerticalSeparator]1⟩⟨1\[VerticalSeparator] + \[VerticalSeparator]2⟩⟨2\[VerticalSeparator]

What the heck is that, I can hear you say.  

Well, it isn’t obvious in traditional notation.

In Dirac notation, you use it all the time to “resolve” a matrix or dot product into a specific basis.
This is exactly where Dirac’s notation comes into its own.  

In terms of concrete things you can visualize easily, and speaking loosely by somewhat mixing up vectors and their coordinates within a basis, you can think of a ket as a column vector and a bra as a row vector.  So in this (OverHat[ℯ]) basis,

\[VerticalSeparator]1⟩ = (({{1}, {0}}))                    \[VerticalSeparator]2⟩=(({{0}, {1}}))
⟨1\[VerticalSeparator]=(({{1, 0)}})                     ⟨2\[VerticalSeparator] =(({{0, 1}}))

and so |1⟩⟨1|  is a (2x1) times (1x2) matrix multiplication, which gives

\[VerticalSeparator]1⟩⟨1\[VerticalSeparator] = (({{1, 0}, {0, 0}}))
\[VerticalSeparator]2⟩⟨2\[VerticalSeparator] = (({{0, 0}, {0, 1}}))

and their sum is the identify matrix.

But there’s also an intuitive notion of what |i⟩⟨i| means : it’s a projection operator onto one component of the basis.

The vertical bars mean that each piece is ready to do a dot product in that direction.  In traditional notation then, having that act on a vector might be written something like

(·(Subscript[(OverHat[ℯ]), 1]) (Subscript[(OverHat[ℯ]), 1])·)(OverVector[α]) = (·(Subscript[(OverHat[ℯ]), 1]) (Subscript[(OverHat[ℯ]), 1])·)((Subscript[α, 1])(Subscript[(OverHat[ℯ]), 1]) + (Subscript[α, 2])(Subscript[(OverHat[ℯ]), 2])) = (Subscript[(OverHat[ℯ]), 1]) (Subscript[α, 1])

which is the advertised projection operator : all parts of the vector except in the i’th direction have been removed.

By adding together all the projection operators, you project onto the same space, which is why for any complete orthonormal base, we get the identity

𝟙=(∑_i)\[VerticalSeparator]i⟩⟨i\[VerticalSeparator]

I have no idea how to write that in traditional notation.  In Dirac notation, it’s fundamental.

This formula is true only for a complete, orthogonal, unit length set of basis vectors.  
(In quantum mechanics, that’s pretty much all we care about.)

change of basis

Suppose now that we have another basis, let’s call it |i'⟩.  How do we calculate the coordinates of our vector in one basis rather in terms of the other?

Well, by inserting the dirac “operator 𝟙”, it’s just a rote symbol manipulation game :

⟨i'\[VerticalSeparator]α⟩=(∑_i) ⟨i'\[VerticalSeparator]i⟩⟨i\[VerticalSeparator]α⟩

That thing in the middle is a matrix of dot products of the basis vectors in the two bases, in all combinations.

[ Do an example : a basis rotated by 30 degrees clockwise. ]

matrix multiplication

I started with an expression like this.

⟨α\[VerticalSeparator](OverHat[H])\[VerticalSeparator]β⟩

Inserting the “operator 𝟙” at the vertical bars resolves this into components

(∑_i) (∑_j) ⟨α\[VerticalSeparator]i⟩⟨i\[VerticalSeparator](OverHat[H])\[VerticalSeparator]j⟩⟨j\[VerticalSeparator]β⟩

which is the same as

(({{(Subscript[α, 1]), (Subscript[α, 2]), …}}))(({{(Subscript[H, 11]), (Subscript[H, 12]), …}, {(Subscript[H, 21]), (Subscript[H, 22]), …}, {…, …, …}}))(({{(Subscript[β, 1])}, {(Subscript[β, 2])}, {…}}))

This shows explicitly what, say (Subscript[H, 12]) is : it’s  ⟨1|(OverHat[H])|2⟩, which is an explicit recipe: let H act on basis vector 2, then dot that with basis vector 1.  Or if it’s more convenient to do that in another basis, you insert the operator one a few more times and do it that way.

eigenvalues

Eigens also fit nicely into this notation system.  Say you have an operator A with eigenvalues (Subscript[λ, k]) and eigenvectors (Subscript[(OverVector[𝓋]), k]).  Then we can use the projection operators to write that explicitly as

A = (∑_k) \[VerticalSeparator](Subscript[𝓋, k])⟩ (Subscript[λ, k]) ⟨(Subscript[𝓋, k])\[VerticalSeparator]

Then if you want to know A’s matrix representation in a specific basis, say |i⟩, you’d calculate

⟨i\[VerticalSeparator]A\[VerticalSeparator]j⟩ = (∑_k) ⟨i\[VerticalSeparator](Subscript[𝓋, k])⟩ (Subscript[λ, k]) ⟨(Subscript[𝓋, k])\[VerticalSeparator]j⟩

which just requires that you know the eigenvectors in that basis; everything else is plug and chug.

[ Another example : an operator that stretches things along the xy line by 2 times, in the x-y basis. ]

You’re quickest bet to find the details is to just google “bra ket”;
however, many of them spit out a lot of quantum jargon.

Here’s a guy talking about notation this week who mentions it :
* http://rjlipton.wordpress.com/2010/11/30/notation-and-thinking/

This one is fairly readable and pretty short :
* http://www.conservapedia.com/Bra-ket_notation

Macros for the bra-ket are from  http://homepage.cem.itesm.mx/lgomez/quantum/ ;
this next cell needs to be evaluated to turn them and the typing shortcuts on.

Needs["Quantum`Notation`"]
SetQuantumAliases[]

Other typing notes :
 Typing bra-ket stuff :  Esc ket Esc , Esc bra Esc , Esc braket Esc , Esc ketbra Esc , Esc se Esc (sigma), many others
 Typing column and row vectors : put parens, then backspace and use control-comma, control-return.
 Typing control-underbar is subscript, control-^ is superscript, control-7 is overscript (i.e. on top); Esc vec Esc is ⇀