# Nakafa Framework: LLM
URL: /en/subject/university/bachelor/ai-ds/linear-methods/diagonalization-matrix
Source: https://raw.githubusercontent.com/nakafaai/nakafa.com/refs/heads/main/packages/contents/subject/university/bachelor/ai-ds/linear-methods/diagonalization-matrix/en.mdx
Output docs content for large language models.
---
export const metadata = {
   title: "Matrix Diagonalization",
   description: "Transform matrices using eigenvalues and eigenvectors. Learn diagonalization conditions, geometric vs algebraic multiplicity for AI computations.",
   authors: [{ name: "Nabil Akbarazzima Fatih" }],
   date: "07/16/2025",
   subject: "Linear Methods of AI",
};
## Matrix Diagonalization Concept
In matrix theory, we often seek ways to simplify matrix forms to make them easier to analyze and compute. Diagonalization is one of the most powerful techniques to achieve this. Imagine transforming a complex space into a more orderly space where each dimension does not interfere with each other.
The main goal of diagonalization is to find a special basis so that the linear transformation  can be represented through a diagonal matrix . If this basis is an orthonormal basis, then the transformation matrix has the property .
## Definition of Diagonalization
A matrix  is called **diagonalizable** if it is similar to some diagonal matrix , that is, if there exists an invertible matrix  such that:
## Basic Conditions for Diagonalization
When can a matrix  be diagonalized? The answer is when we can find a basis of  that consists entirely of eigenvectors  of  with corresponding eigenvalues .
The diagonal matrix  is:
and  is the matrix with columns:
If  is diagonalizable, then the columns  of  form a basis of eigenvectors. From  we obtain  and thus  for .
Conversely, if  is a basis of eigenvectors, then  is invertible and from  for  we obtain  and thus .
## Example of Non-Diagonalizable Case
Consider the matrix:
This matrix has eigenvalue  with algebraic multiplicity . The eigenspace is the kernel (null space) of :
which has dimension 1. Since there are no other eigenvalues and eigenvectors, and there is no basis of  consisting of eigenvectors of , then  is not diagonalizable.
## Requirements for Matrix Diagonalization
If a matrix  is diagonalizable, then the characteristic polynomial  of  over  factors into linear factors:
where  has  eigenvalues that need not be distinct .
When all eigenvalues are distinct, the process becomes simpler. If  and the characteristic polynomial  of  over  factors into linear factors:
with pairwise distinct eigenvalues  for  with , then  is certainly diagonalizable.
Why is this so? Because eigenvectors for pairwise distinct eigenvalues of  are always linearly independent and form a basis of .
But what if  has repeated eigenvalues? We must check this more carefully. Eigenvalues have algebraic multiplicity  and geometric multiplicity  with the relationship:
## Diagonalization Characterization Theorem
For a matrix , the following statements are equivalent:
1.  is diagonalizable.
2. Both of the following conditions are satisfied. First, the characteristic polynomial of  must factor into linear factors:
   
   with pairwise distinct eigenvalues  of . Second, for all eigenvalues of , the algebraic multiplicity must equal the geometric multiplicity:
   
3. The direct sum of all eigenspaces is the entire vector space:
   
   This means there exists a basis of  consisting of eigenvectors of .
For each , let  be a basis of eigenvectors of  for the eigenspace . Then:
is a basis of  consisting of eigenvectors of . Therefore,  is diagonalizable.