5.4. Orthogonal Matrix (Unitary for Real Matrices)#

5.4.1. draft version - do not distribution - alert if errors found#

A square real matrix \(Q\) is called an orthogonal if its transpose, denoted by \(Q^T\), is equal to its inverse, \(Q^{-1}\),

(5.52)#\[\begin{equation} Q^T = Q^{-1}. \end{equation} \]

Therefore multiplication of \(Q\) by \(Q^T\) results in the identity matrix \(\mathbf{I}\),

(5.53)#\[\begin{equation} Q^T Q = Q^{-1}Q = \mathbf{I}. \end{equation} \]

Unitary versus Orthogonal A unitary matrix \(U\) is a complex matrix such that its complex conjugate transpose equals its inverse, \(U^\dagger=U^{-1}\).

Here is an example of complex conjugate transpose (if you don’t know)

(5.54)#\[\begin{equation} \begin{split} A = \begin{bmatrix} a_{11} + i b_{11} & a_{12} + ib_{12} \\ a_{21} + ib_{21} & a_{22} + ib_{22}\end{bmatrix} \\ A^\dagger = \begin{bmatrix} a_{11} - i b_{11} & a_{21} - ib_{21} \\ a_{12} - ib_{12} & a_{22} - ib_{22}\end{bmatrix} \end{split} \end{equation} \]

If the matrix is real, then its complex conjugate transpose is the transpose, and the unitary condition is the orthogonal condition above. We will mostly be using real matrices in this course and will likely refer to the matrix as unitary when technically it is orthogonal (I am known to get a bit flimsy with my verbiage).

Below I list the properties of a real unitary matrix. Some (or all) of which may be unknown to you. The one thing you should take away from these notes is that a real matrix is unitary/orthogonal if its transpose is equal to its inverse \(Q^T=Q^{-1}.\)

5.4.2. Properties of Orthogonal Matrices:#

  • It Has an Inverse: The tranpose must exist, therefore it has an inverse.

  • Preserves Norm (Length) of Real Vectors: Orthogonal matrices preserve the Euclidean norm of real vectors: \begin{equation} |Q\mathbf{x}|^2 = \mathbf{x}Q^T Q \mathbf{x} = \mathbf{x}^T \mathbf{x} \end{equation}

  • Preserves Dot Product (Real Vectors): For any two real vectors \(\mathbf{x}\) and \(\mathbf{y}\), the dot product is preserved under orthogonal transformation: \begin{equation} Q\mathbf{x} \cdot Q\mathbf{y} = \mathbf{x}^T Q^T Q\mathbf{y} = \mathbf{x}^T \mathbf{y} \end{equation}

  • Determinant is \(\pm 1\): The determinant of an orthogonal matrix is either +1 or -1: \(\det(Q) = \pm 1\)

    Proof: \(\det(QQ^T) = \det(I) = 1\). Also, \(\det(QQ^T) = \det(Q) \det(Q^T) = \det(Q) \det(Q) = (\det(Q))^2\). Therefore, \((\det(Q))^2 = 1\), which implies \(\det(Q) = \pm 1\).

    • Orthogonal matrices with a determinant of +1 represent rotations (and combinations of rotations).

    • Orthogonal matrices with a determinant of -1 represent reflections (and combinations involving reflections).

  • Eigenvalues have Magnitude 1 (Real or Complex Conjugate Pairs): The real eigenvalues of an orthogonal matrix are either +1 or -1. Complex eigenvalues occur in conjugate pairs (\(a + bi\), \(a - bi\)) and have a magnitude of 1 (\(a^2 + b^2 = 1\)).

  • Columns (and Rows) are Orthonormal (Real Vectors): The columns of an orthogonal matrix form an orthonormal basis for \(\mathbb{R}^n\). Similarly, the rows also form an orthonormal basis. Let

    (5.55)#\[\begin{equation} Q = \left[\mathbf{c}_1 ~ \mathbf{c}_2 ~ \dots ~ \mathbf{c}_n \right] \end{equation} \]

    where \(\mathbf{c}_i\) are the column vectors. Then \(Q^T Q = I\) implies that \(\mathbf{c}_i^T \mathbf{c}_j = \delta_{ij}\), which means the columns are orthonormal (their dot product is 1 if \(i=j\), and 0 if \(i \neq j\)). The same logic applies to the rows of \(Q\).

Examples:

  • Identity Matrix (\(I\)): \(I^T = I\) and \(I^{-1} = I\), so \(I^T = I^{-1}\).

  • Rotation Matrix in 2D:

    (5.56)#\[\begin{equation} Q(\theta) = \begin{bmatrix} \cos(\theta) & -\sin(\theta) \\ \sin(\theta) & \cos(\theta) \end{bmatrix} \end{equation} \]
    (5.57)#\[\begin{equation}Q(\theta)^T = \begin{bmatrix} \cos(\theta) & \sin(\theta) \\ -\sin(\theta) & \cos(\theta) \end{bmatrix}\end{equation}\]
    (5.58)#\[\begin{equation} Q(\theta)Q(\theta)^T = \begin{bmatrix} \cos^2(\theta) + \sin^2(\theta) & \cos(\theta)\sin(\theta) - \sin(\theta)\cos(\theta) \\ \sin(\theta)\cos(\theta) - \cos(\theta)\sin(\theta) & \sin^2(\theta) + \cos^2(\theta) \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} = I \end{equation} \]
  • Reflection Matrix in 2D (across the x-axis):

    (5.59)#\[\begin{equation} Q = \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix} \end{equation}\]
    (5.60)#\[\begin{equation} Q^T = \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix} = Q \end{equation}\]
    (5.61)#\[\begin{equation} QQ^T = \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix} \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix} = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} \end{equation} \]

A SymPy example of the unitary nature of a rotation matrix is below.

import numpy as np
import sympy as sym
theta = sym.symbols("theta")
Q= sym.Matrix([[sym.cos(theta), -sym.sin(theta)],[sym.sin(theta), sym.cos(theta)]]) 
Q
\[\begin{split}\displaystyle \left[\begin{matrix}\cos{\left(\theta \right)} & - \sin{\left(\theta \right)}\\\sin{\left(\theta \right)} & \cos{\left(\theta \right)}\end{matrix}\right]\end{split}\]
Q.T
\[\begin{split}\displaystyle \left[\begin{matrix}\cos{\left(\theta \right)} & \sin{\left(\theta \right)}\\- \sin{\left(\theta \right)} & \cos{\left(\theta \right)}\end{matrix}\right]\end{split}\]
Q.T*Q
\[\begin{split}\displaystyle \left[\begin{matrix}\sin^{2}{\left(\theta \right)} + \cos^{2}{\left(\theta \right)} & 0\\0 & \sin^{2}{\left(\theta \right)} + \cos^{2}{\left(\theta \right)}\end{matrix}\right]\end{split}\]
sym.simplify(Q.T*Q)
\[\begin{split}\displaystyle \left[\begin{matrix}1 & 0\\0 & 1\end{matrix}\right]\end{split}\]

NumPy example of rotation matrix.

# define theta
# use theta to make Q

theta = np.pi/3 

Q=np.array([[np.cos(theta), -np.sin(theta)], [np.sin(theta), np.cos(theta)]]) 
Q
array([[ 0.5      , -0.8660254],
       [ 0.8660254,  0.5      ]])
# Q.T Q should be 1
Q.T@Q
array([[ 1.00000000e+00, -1.48741681e-17],
       [-1.48741681e-17,  1.00000000e+00]])