# Nakafa Framework: LLM
URL: /en/subject/university/bachelor/ai-ds/linear-methods/matrix-similarity
Source: https://raw.githubusercontent.com/nakafaai/nakafa.com/refs/heads/main/packages/contents/subject/university/bachelor/ai-ds/linear-methods/matrix-similarity/en.mdx
Output docs content for large language models.
---
export const metadata = {
    title: "Matrix Similarity",
    description: "Understand matrix similarity, basis transformations, and invariant properties. Learn eigenvalue preservation, coordinate changes, and linear transformations.",
    authors: [{ name: "Nabil Akbarazzima Fatih" }],
    date: "07/16/2025",
    subject: "Linear Methods of AI",
};
## Definition of Matrix Similarity
In linear algebra, the concept of matrix similarity or equivalence is very important for understanding how two different matrices can represent the same linear transformation in different spaces. Imagine two different portraits of the same object, but taken from different perspectives.
Two matrices  are said to be **similar** if there exists an invertible matrix  such that:
The matrix  in this case is called the similarity transformation matrix.
## Basis Transformation and Coordinate Representation
To understand why matrix similarity is so important, we need to look at its relationship with basis transformation. Let  be the canonical basis and  be another basis of .
If  is an invertible matrix with columns :
Then we have  or  for . The matrix  represents the **basis transformation**.
A vector  can be expressed in the canonical basis through coordinates  and in the basis  through coordinates :
The matrix  represents the **coordinate transformation**.
## Linear Transformation in Different Bases
Now consider the linear transformation . In the canonical basis,  is expressed through coordinates , while in the basis  through coordinates :
Therefore:
or in other words:
In the basis , the linear transformation  is represented by  with the matrix:
This is why similar matrices represent the same linear transformation but viewed from different bases. Similar matrices represent the same linear transformation with respect to different bases of .
## Invariant Properties of Similar Matrices
Similar matrices have several fundamental properties that are very useful. Since they represent the same linear transformation in different spaces, similar matrices preserve the same intrinsic characteristics.
Based on the theorem about similar matrices, if matrices  and  are similar, then they both have:
1. **The same determinant**
2. **The same characteristic polynomial** 
3. **The same eigenvalues**
4. **The same trace**
### Proof of Determinant Equality
For the determinant, we can show:
Since , then:
### Eigenvalue Equality
If  is an eigenvector of  with eigenvalue , such that , then  is an eigenvector of  with the same eigenvalue:
This shows that matrix similarity preserves the spectrum or set of eigenvalues, which is a fundamental characteristic of linear transformations.