# Nakafa Framework: LLM
URL: /en/subject/university/bachelor/ai-ds/linear-methods/diagonalization-procedure
Source: https://raw.githubusercontent.com/nakafaai/nakafa.com/refs/heads/main/packages/contents/subject/university/bachelor/ai-ds/linear-methods/diagonalization-procedure/en.mdx
Output docs content for large language models.
---
export const metadata = {
   title: "Basic Procedure for Diagonalization",
   description: "Learn the 3-step matrix diagonalization procedure: compute eigenvalues, find eigenspaces, and check conditions with practical examples.",
   authors: [{ name: "Nabil Akbarazzima Fatih" }],
   date: "07/16/2025",
   subject: "Linear Methods of AI",
};
## General Matrix Diagonalization Procedure
Imagine you are trying to rearrange a messy room to make it orderly. Matrix diagonalization is similar to that, we transform a complex matrix into a diagonal form that is much simpler to analyze.
To diagonalize a matrix , we use a systematic procedure that will determine whether the matrix can be simplified and how to do it.
## Diagonalization Steps
The diagonalization procedure consists of three main steps that must be performed sequentially:
1. **Compute the characteristic polynomial** to find all eigenvalues  along with their algebraic multiplicities . 
   This step is like finding the "keys" that will unlock the hidden structure of the matrix. The absolute requirement that must be satisfied is that the characteristic polynomial  must factor completely into linear factors, meaning:
   
   If not, then the matrix cannot be diagonalized at all.
2. **Compute the eigenspaces** for each eigenvalue by solving the homogeneous linear system:
   
   Here we look for all vectors that "survive" when the matrix  acts on them, only changing their length by a factor of  without changing their direction.
3. **Check the diagonalization conditions** by verifying whether the algebraic multiplicity equals the geometric multiplicity for all eigenvalues. Mathematically, for all  we must have .
   This condition ensures that we have enough independent eigenvectors to form a complete basis. If satisfied, the basis vectors from all eigenspaces form the columns of the transformation matrix , yielding:
   
## Example Application of the Procedure
Consider the matrix:
Let us apply the diagonalization procedure to this concrete example:
1. We compute the characteristic polynomial to find the eigenvalue "keys":
   
   After factoring, we obtain:
   
   From this we see that the eigenvalues are  with algebraic multiplicity  and  with algebraic multiplicity . Since  equals the matrix dimension, the initial requirement is satisfied.
2. We find all vectors that "survive" the transformation for each eigenvalue:
   
   
   
   
3. We check whether the diagonalization conditions are satisfied. For eigenvalue , its algebraic multiplicity is 2 and its eigenspace has dimension 2 (two independent basis vectors). For eigenvalue , its algebraic multiplicity is 1 and its eigenspace has dimension 1.
   Since  and , the diagonalization conditions are completely satisfied.
Now we can form the transformation matrix  by arranging all eigenvectors as columns, and the diagonal matrix  with eigenvalues on the main diagonal:
Thus, the matrix  is successfully diagonalized to  through the transformation .
Diagonalization means there exists a basis of eigenvectors, where the basis transformation matrix  is invertible. This result shows that the systematic procedure we use can definitively determine whether a matrix can be diagonalized and how to do it.