# Nakafa Framework: LLM
URL: /en/subject/university/bachelor/ai-ds/linear-methods/spectral-theorem
Source: https://raw.githubusercontent.com/nakafaai/nakafa.com/refs/heads/main/packages/contents/subject/university/bachelor/ai-ds/linear-methods/spectral-theorem/en.mdx
Output docs content for large language models.
---
export const metadata = {
    title: "Spectral Theorem",
    description: "Learn when matrices can be diagonalized with orthonormal eigenvectors. Master normal, Hermitian, and unitary matrices with real-world applications.",
    authors: [{ name: "Nabil Akbarazzima Fatih" }],
    date: "07/16/2025",
    subject: "Linear Methods of AI",
};
## Basic Concepts of Normal Matrices
The spectral theorem answers the important question of when a matrix can be diagonalized using an orthonormal basis of eigenvectors. Imagine you want to transform a complex matrix into a simple diagonal matrix, but using basis vectors that are mutually perpendicular. The spectral theorem provides the precise conditions when this transformation is possible.
When this condition is satisfied, the basis transformation matrix becomes unitary with the property  or orthogonal with the property  for the real case. We will start by studying the complex case first.
A complex matrix  is called normal if it satisfies the commutativity condition with its conjugate transpose:
This condition appears simple, but it is actually very powerful. Matrices that can "exchange places" with their conjugate transpose have special geometric properties.
## Special Properties of Eigenspaces of Normal Matrices
Normal matrices have interesting properties that arbitrary matrices do not possess. For normal matrices, the null space of the matrix and the null space of its conjugate transpose turn out to be identical.
Let's see why this happens. The null space (kernel) is the set of all vectors  that produce . If  and , then we can analyze it like this:
From this calculation, we conclude that . Therefore, for normal matrices we have .
This equality of null spaces brings important consequences for eigenspaces. For every eigenvalue , the eigenspaces of  and  turn out to be identical.
So every eigenvector of the normal matrix  for eigenvalue  is also an eigenvector of  with exactly the same eigenvalue. Imagine finding two mirrors that reflect light in exactly the same direction.
## Hermitian and Unitary Matrices as Examples of Normal Matrices
Two important types of matrices that are always normal are Hermitian matrices and unitary matrices. Let's understand why both are special.
### Hermitian Matrices and Real Eigenvalues
Hermitian matrices have the property . Because of the normal definition , for Hermitian matrices we have , which is clearly always true.
Eigenvalues of Hermitian matrices are always real. To understand this, we use the fact that for normal matrices, the eigenspaces of  and  for the same eigenvalue are identical.
The condition  means the eigenvalue equals its complex conjugate, which only happens if  is a pure real number. So all eigenvalues of Hermitian matrices are always real numbers, not complex numbers with imaginary parts.
### Unitary Matrices and Eigenvalues on the Unit Circle
Unitary matrices have the property . To prove that unitary matrices are also normal, we substitute into the definition and get .
Eigenvalues of unitary matrices have magnitude 1, meaning they lie on the unit circle in the complex plane. We can show this with the following calculation.
The condition  is mathematically equivalent to , which means . So all eigenvalues of unitary matrices have modulus exactly equal to 1. This modulus is the distance from the origin in the complex plane. Imagine a spinning wheel, unitary transformations only rotate vectors without changing their length.