Mathematical Interlude
Learn about the conditions necessary for a 2x2 matrix to represent a quantum gate and the associated mathematical concepts.
It turns out that we can’t use any combination of numbers in the matrices representing quantum gates. To see why, we need to look at some of the math associated with matrices. If you don’t remember the details or you haven’t seen these manipulations in a math course, don’t worry. We’ll show you what you need to know.
The matrices allowed to represent quantum gates have to satisfy the following requirements:
-
The determinant of the matrix must be equal to or . This guarantees that the output column vector is a unit vector if the input vector is a unit vector. Remember that we use vectors with length because we want our probabilities to sum to .
-
The product of the matrix and its transpose must equal , the identity matrix.
-
The columns in the matrix form a set of orthogonal unit vectors. So do the rows.
Let’s check the Hadamard gate matrix to see if it satisfies those conditions and, along the way, we will explain what determinant and transpose mean. For almost all of this course, we will restrict ourselves to gates that satisfy these conditions, and you won’t need to worry about the mathematical details. However, it is good to know some of the mathematical terminology in case you come across these terms in other books and articles.
The determinant of a matrix is the product of upper-left and lower-right elements minus the product of the lower-left and the upper-right elements. In particular
Here is an example with numerical entries in the matrix:
Get hands-on with 1400+ tech skills courses.