Matrix Multiplication

This reference page just iterates the basics of multiplying Matrices along with some other matrix examples more related to quantum mechanics and, in particular, quantum computing.

Note: This is a work in progress!

[1×1] times [1×1]

The result we get, a 1×1 matrix, is the same as we’d get multiplying two scalars together:

\begin{bmatrix}a_{11}\end{bmatrix}\begin{bmatrix}b_{11}\end{bmatrix} = \begin{bmatrix}a_{11}b_{11}\end{bmatrix}

But note that a 1×1 matrix is not a scalar. (The difference becomes obvious in the next two cases.)

[1×1] times [1×2]

Similar to the first case, here the result, a 1×2 matrix (a row vector), is the same as we’d get multiplying the 1×2 matrix by a scalar.


As in the first case, the result is the same as we’d get multiplying row vector by a scalar (another row vector):


But note that, unlike the scalar multiplication, the matrix multiplication cannot be reversed because [1×2][1×1] is an illegal operation. (The number of columns in the first matrix doesn’t match the number of rows in the second.)

Bottom line, a [1×1] matrix is not (always) the same as a scalar!

[2×1] times [1×1]

Here’s the legal version of putting the “scalar” matrix second. In this case, the single column of the 2×1 matrix (a column vector) matches the single row of the 1×1 matrix:


The result is the same as we’d get multiplying a column vector by a scalar (another column vector):


However, as in the second case above, the [2×1][1×1] operation cannot be reversed (due to column/row mismatch), whereas with the scalar operation it can.

[1×2] times [2×1] (inner product)

Multiplying a row vector by a column vector results in a 1×1 matrix usually treated as a scalar:


In Dirac Bra-Ket notation, generally speaking, a bra is row vector, and a ket is a column vector. Often the bra is the conjugate transpose of a ket. For example, given:


Where α is a complex number, then:


Where α* is the conjugate of α.

[2×1] times [1×2] (outer product)

Multiplying a column vector by a row vector results in a matrix with as many rows and columns as the vectors (in this case, a 2×2 matrix):


In Bra-Ket notation, this is (using the definition of |Ψ〉 above):


Which, among other things, allows the definition of quantum gates in terms of combinations of state vectors.

[2×2] times [2×2]

Multiplying two (same-sized) square matrices results in a new matrix of the same size (in this case, 2×2).


(Multiplying square matrices is what many think of as “matrix multiplication” but as the examples above show, it’s not the only form.)

Quantum States

Sticking to 2×2 matrices for a moment, in quantum computing the computational basis states, |0〉 and |1〉, are generally defined as:


Upon that, two common superposition states, |+〉 and |-〉, are defined as:


Tensor Product

The tensor product of two states, a and b, is written:


Which expands to:



Quantum Gates

The Pauli sx gate:


Note this is also a NOT gate.

The Pauli sy gate:


The Pauli sz gate:


Note that these matrices are also the spin axes representations.

The Hadamard gate:


The Hadamard gate maps the |0〉 state to |+〉 and |1〉; state to |-〉. That is, it puts a computational basis state into a superposition of that basis.

And what do you think?

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: