Quantumania 16 - Diagonal = Easy

A digression before we get back to quantum computing. In our previous linear algebra tomfoolery, something important has been bubbling away, which is the importance of diagonal matrix representation, and what they mean for simplicity. They mean that we can think of the dimensions of the space as being like completely separate, isolated channels, which don’t suffer from any “crosstalk”. It’s like you’re doing several completely independent calculations, with no interference between them.

If you apply $\hat{M} \equiv \operatorname{diag}(M_1, M_2)$ to a vector $\vec{v}$:

\[\hat{M} \vec{v} \equiv \begin{bmatrix} M_1 & 0 \\ 0 & M_2 \end{bmatrix} \begin{bmatrix} v_1 \\ v_2 \end{bmatrix} = \begin{bmatrix} M_1 v_1 \\ M_2 v_2 \end{bmatrix}\]

it’s like two completely separate conversations on different phone lines. The $n$th diagonal entry is only applicable to the $n$th coordinate of the vector. If any off-diagonal entry was non-zero it would be a different matter. But diagonal matrices are delightfully straightforward.

We can apply the operator $\hat{M}$ twice, and write that as $\hat{M}^2$:

\[\hat{M}^2 \vec{v} \equiv \begin{bmatrix} M_1 & 0 \\ 0 & M_2 \end{bmatrix} \begin{bmatrix} M_1 & 0 \\ 0 & M_2 \end{bmatrix} \begin{bmatrix} v_1 \\ v_2 \end{bmatrix} = \begin{bmatrix} M_1^2 v_1 \\ M_2^2 v_2 \end{bmatrix}\]

In a way this is a function applied to the matrix, but the way that works is trivial: we just apply that function to the separate diagonal entries. We can extend this idea to any function $f$ (an ordinary mapping between numbers). Such a function can be applied to the matrix as a whole, but it’s really just that we are applying the function separately to the individual diagonal entries.

For matrices in general this wouldn’t make sense: a number-valued function of numbers doesn’t know what to do with a matrix. But with a diagonal matrix, we know the non-zero entries act like independent numbers, so we’re essentially “broadcasting” the function wrapping down to the individual entries:

\[f(M) \equiv \begin{bmatrix} f(M_1) & 0 \\ 0 & f(M_2) \end{bmatrix}\]

This leads to the idea of raising something to the power of an operator. It sounds like gibberish until you realise that as long as the operator can be represented by a diagonal matrix, there’s nothing to it.

What kinds of operator can be represented by a diagonal matrix? The answer to this question depends on what kind of basis we allow. If an operator has eigenvectors that are linearly independent and it has as many as there are dimensions in the space, then we can use the eigenvectors as a basis and represent the operator diagonally.

But for two vectors to be linearly independent just means that they aren’t colinear. We want to be more choosy and require that our basis vectors are orthogonal, because our state vector spaces have an inner product with a simple definition that, in order to produce consistent values regardless of the basis, requires that the basis vectors are orthogonal. So in QM we insist on that, and when we speak of changing the basis, we never mean realigning just some of the basis vectors: they all have to rotate properly together, to stay rigidly orthogonal with each other.

With that restriction, in a real vector space the only kind of operator that can be diagonalised is the kind that scales along orthogonal alignments, and it will be represented in any other allowed basis by a symmetrical matrix.

But in complex vector spaces, it’s a lot more interesting than that. A broader set of operators can be diagonalised in an orthogonal basis. Those that can are called normal operators. Also the test for a normal operator is that it commutes with its adjoint. What do we mean by that?

First, adjoint can be thought of as the abstract geometrical equivalent of the conjugate transpose we’ve been using on matrices. So I could have said, much more verbosely, “If you have an operator, $\hat{A}$, and you represent it by a matrix $A$ in some orthogonal basis, and you take the conjugate transpose of that matrix, and those two matrices commute, then $\hat{A}$ is normal.” Also wherever we talked about hermitian matrices, we could instead have talked about self-adjoint operators.

And second, commuting means that two operators can be applied in either order and the result is the same. Again, dropping down to the matrix representation, if you multiply out the two matrices in both orders, the resulting matrix must be the same either way in order for it to be a normal matrix representing a normal operator:

\[A A^\dagger = A^\dagger A \quad \text{for a normal matrix, A}\]

The surprising thing is that as well as self-adjoint operators being normal, so are unitary operators. Rotations can not generally be diagonalised in a real vector space, but in a complex one they can. How, though? Algebraically it follows automatically from the fact that a unitary operator is defined by the requirement that:

\[U U^\dagger = I\]

That is, the inverse of $U$ is its own adjoint. The same must be true going the other way, and so either way around, the result is $I$. It commutes with its own adjoint, so unitary implies normal.

Working more intuitively, in a real vector space we know a diagonal matrix scales along orthogonal directions, with the scaling factors given by the diagonal entries themselves. But a unitary operator isn’t allowed to scale along any direction. It preserves the lengths of all vectors as well as the angles between them. So if it has eigenvectors at all, surely their eigenvalues would have to be $\pm 1$. (In fact in the confines of a 2D real vector space, rotations have no eigenvectors, except rotations by a multiple of $\pi$.)

In a complex space, we find the length of a vector $\vert v \rangle$ by using the complex form of the inner product, $\langle v \vert v \rangle$ and then taking the square root. This always gives a real number regardless of whether the vector has complex coordinates. So the eigenvalues of our unitary operator could be complex numbers, as long as they have unit modulus, of the form $e^{i\theta}$, lying on the unit circle in the complex plane. The diagonal form of a rotation is like this:

\[\begin{bmatrix} e^{i\theta} & 0 \\ 0 & e^{-i\theta} \end{bmatrix}\]

The two coordinates rotate in the complex plane in opposite directions. Why is that? The familiar template for a rotation matrix in a real vector space is:

\[\begin{bmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{bmatrix}\]

We can imagine the real space $\mathbb{R}^2$ as being embedded within the complex space $\mathbb{C}^2$. That is, the standard basis vectors (the Z basis, to use their qubit names):

\[\vert 0 \rangle \equiv \begin{bmatrix} 1 \\ 0 \end{bmatrix} \quad \quad \vert 1 \rangle \equiv \begin{bmatrix} 0 \\ 1 \end{bmatrix}\]

are a pair of ingredients that we can scale and sum using only real coordinates, to build any vector that lies within a “real subspace”. To be precise about what we mean by this, to access the whole space with real coordinates, we’d need a couple more weird ingredients:

\[\vert \gamma \rangle \equiv \begin{bmatrix} i \\ 0 \end{bmatrix} \quad \quad \vert \kappa \rangle \equiv \begin{bmatrix} 0 \\ i \end{bmatrix}\]

This would allow us to build the full range of complex vectors from four real coordinates $(a, b, c, d)$:

\[\begin{eqnarray*} \vert \psi \rangle &=& a \vert 0 \rangle + b \vert 1 \rangle + c \vert \gamma \rangle + d \vert \kappa \rangle \\ \\ &\equiv& \begin{bmatrix} a \\ 0 \end{bmatrix} + \begin{bmatrix} 0 \\ b \end{bmatrix} + \begin{bmatrix} ci \\ 0 \end{bmatrix} + \begin{bmatrix} 0 \\ di \end{bmatrix} \\ \\ &=& \begin{bmatrix} a + ci \\ b + di \end{bmatrix} \end{eqnarray*}\]

So we’re still building 2D complex vectors in $\mathbb{C}^2$, but we’re approaching it as a 4D real space $\mathbb{R}^4$, and we can restrict ourselves to a 2D real subspace of that if we like.

If we take a pair of these ingredients that aren’t complex multiples of each other, such as $\vert 0 \rangle$ and $\vert 1 \rangle$, or $\vert 0 \rangle$ and $\vert \kappa \rangle$, and combine them with complex scalars, we can make any complex vector. So such pairs form a basis for the whole $\mathbb{C}^2$ space, and if we pick an orthogonal, unit-norm pair it’s an orthonormal basis. We can also make other orthonormal bases by linear combination of our ingredients. For example:

\[\vert v_+ \rangle = \frac{1}{\sqrt{2}} \Big[ \vert 0 \rangle - \vert \kappa \rangle \Big] \equiv \frac{1}{\sqrt{2}}\begin{bmatrix} 1 \\ -i \end{bmatrix} \quad \quad \vert v_- \rangle = \frac{1}{\sqrt{2}} \Big[ \vert 0 \rangle + \vert \kappa \rangle \Big] \equiv \frac{1}{\sqrt{2}}\begin{bmatrix} 1 \\ i \end{bmatrix}\]

Why have they been labelled with $+$ and $-$ in apparent opposition to the sign used in their definitions? Because we’re going to be scaling them by complex phase factors that twist them in the positive (anticlockwise) and negative (clockwise) directions respectively, using the diagonalised rotation matrix defined above.

These two vectors are an orthogonal unit basis, as we can test them with the inner product:

\[\langle v_+ \vert v_+ \rangle = \langle v_- \vert v_- \rangle = 1\] \[\langle v_+ \vert v_- \rangle = 0\]

And we can write down the matrix that would convert a vector expressed in this basis into the standard $\vert 0 \rangle, \vert 1 \rangle$ basis: we just use the definitions of $\vert v_+ \rangle$ and $\vert v_- \rangle$ as the columns of the matrix:

\[P = \frac{1}{\sqrt{2}}\begin{bmatrix} 1 & 1 \\ -i & i \end{bmatrix}\]

It’s easy to show this is unitary (i.e. that $P^\dagger = P^{-1}$). With a little more hard labour, leaning on this:

\[e^{i\theta} = \cos \theta + i \sin \theta\]

and being super careful with those minus signs, folks, we can wrap the diagonalised rotation matrix in the usual transform/undo sandwich:

\[P \begin{bmatrix} e^{i\theta} & 0 \\ 0 & e^{-i\theta} \end{bmatrix} P^\dagger = \begin{bmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{bmatrix}\]

So by twisting these two complex basis vectors, $\vert v_+ \rangle$ anticlockwise and $\vert v_- \rangle$ clockwise, by some phase angle, we have the effect of an ordinary rotation on our embedded real space. This is how an arbitrary rotation can be diagonalised, something that would be impossible in a real vector space.

And as a result, not just one but two of the most important kinds of operator we need in QM can be understood as diagonal matrices, and thus like operations that act independently on separate coordinate channels.




Not yet regretting the time you've spent here?

Keep reading:

  • Quantumania 15 - Mystery Function
  • Quantumania 14 - Schrödinger's Umlaut
  • Quantumania 13 - The Hadamard Gate
  • Quantumania 12 - Unexpected Values
  • Quantumania 11 - Daggers, Bras and Kets