Engineering/Mathematics/Eigenvalues
Similar Matrices
Two square matrices and are similar when for some non-singular . Similar matrices are almost never equal, but they describe the same underlying linear behaviour in two different coordinate systems, and every property that does not depend on the coordinates is shared between them.
- Core level
- Stream: similarity
- Reading time 14 min
- Ref KVS-ENG-MATH-0086
- Taxonomy
- Engineering / Mathematics
- Definition
- with non-singular
- Requires
- Both matrices square and of the same size
- Interpretation
- The same operator in two bases
- Preserves
- Characteristic polynomial, eigenvalues, trace, determinant, rank
- Goal
- Find the simplest similar matrix — ideally diagonal
Overview
Row equivalence relates two matrices that describe the same system of equations. Similarity does something analogous for square matrices treated as operators: it relates two matrices that describe the same linear map, seen through two different bases. The definition is compact — for some non-singular — but every occurrence of a change of coordinates in linear algebra, from modal analysis to the Jordan form, is an instance of it.
The requirement that be non-singular carries the whole meaning. A non-singular matrix has independent columns, so its columns form a basis of , and multiplying by translates a vector's ordinary coordinates into coordinates relative to that basis. The composite therefore reads right to left as: convert from the new coordinates back to the standard ones, apply , then convert the result into the new coordinates. The net effect is the action of expressed entirely in the new frame.
Because similarity is a re-description rather than a change of behaviour, any quantity that is intrinsic to the behaviour must survive it. Eigenvalues do, along with the whole characteristic polynomial, the trace, the determinant, the rank and the multiplicity structure. Quantities that depend on the chosen coordinates — individual entries, symmetry, orthogonality of columns, banded structure — do not, and this is exactly what makes similarity useful: the entries can be simplified while the intrinsic content is held fixed.
The programme that follows from the definition is to choose so that is as simple as possible. When has a full set of independent eigenvectors, taking them as the columns of produces a diagonal matrix, and every subsequent computation — determinant, powers, characteristic polynomial, exponential — becomes arithmetic on scalars. When it does not, the best available simple form retains a small amount of off-diagonal structure. Either way, the search for a good is the practical content of the subject.
Definition
Similar Matrices
SIMLet and be square matrices of the same size . Then and are similar when there exists a non-singular matrix of size with . When the matrix is to be emphasised, the phrasing is is similar to via .
The relation is symmetric: if then , so is similar to via . It is therefore safe to say simply that two matrices are similar, without ordering them.
Similarity Transformation
STThe operation carried out by a fixed non-singular matrix is a similarity transformation. Applying it produces a matrix similar to ; applying it with in place of reverses it exactly.
Also called conjugation by . The order matters: and are both similar to but are generally different matrices from each other.
Diagonalisable Matrix
DZMA square matrix is diagonalisable when it is similar to a diagonal matrix, that is when a non-singular exists for which has zero in every off-diagonal position.
Not every matrix is diagonalisable. The obstruction is a shortage of independent eigenvectors, which is exactly the condition that some eigenvalue has geometric multiplicity below its algebraic multiplicity.
Concepts
Similarity is a change of basis
Let be non-singular with columns . Because is non-singular those columns are linearly independent and therefore a basis of . For any vector , the product is the linear combination of the columns with coefficients taken from , so maps coordinates-in-the-new-basis to ordinary coordinates and maps back. Reading from right to left therefore gives: interpret the input as new-basis coordinates, apply in the standard frame, and re-express the output in the new basis. The matrix is the same operator, written in a different language.
Eigenvectors transform with the basis
Suppose and . Then . So is an eigenvector of for the same eigenvalue . Eigenvalues survive a similarity transformation untouched; eigenvectors survive in a transformed form, carried across by . Since is non-singular it maps independent sets to independent sets, so the dimension of each eigenspace is preserved as well — similarity cannot create or destroy a defect.
Choosing to reach a diagonal form
Suppose has linearly independent eigenvectors with eigenvalues , and let be the matrix with those eigenvectors as its columns. Independence makes non-singular. Then has columns , and multiplying on the left by sends each to the standard basis vector , giving columns . The result is the diagonal matrix of eigenvalues. The construction is entirely explicit and it is the reason eigenvector computation matters.
What a simple similar form buys
If is diagonal or triangular, the determinant is the product of the diagonal entries, the characteristic polynomial is already factored, the eigenvalues are visible without any computation, and the eigenvectors of are the standard basis vectors. Powers are trivial: , so and a diagonal makes a matter of raising scalars to the power . This transfer of an expensive matrix computation into cheap scalar arithmetic is the entire economic case for finding a good .
Similarity against row equivalence
Both relations partition matrices into classes, but they answer different questions and must not be conflated. Row equivalence applies to matrices of any shape and permits arbitrary independent row operations, corresponding to left multiplication by a non-singular matrix alone: . Similarity applies only to square matrices and applies the inverse operation simultaneously on the right: . Row equivalence preserves the row space and the null space but destroys the eigenvalues; similarity preserves the eigenvalues but destroys row-echelon structure. Every square matrix is row-equivalent to a diagonal matrix; not every square matrix is similar to one.
What similarity does not preserve
The individual entries carry no invariant meaning, and neither do several structural properties that engineers often rely on. Symmetry is not preserved — a symmetric conjugated by a general is usually not symmetric, which is why orthogonal or unitary is insisted upon whenever symmetry must survive. Sparsity, bandwidth and orthogonality of columns are all destroyed by a general similarity. The condition number is not preserved either, which is why an ill-conditioned can turn a benign problem into a numerically hazardous one.
Constructing and checking a similarity
Equations
Definition of similarity
EQ-SM-01Both matrices must be square of size . The non-singularity of is what makes the relation reversible and meaningful.
Symmetry of the relation
EQ-SM-02Similarity in one direction gives similarity in the other, via the inverse matrix. The relation is therefore genuinely two-sided.
Transformation of eigenvectors
EQ-SM-03The eigenvalue is unchanged; the eigenvector is carried across by . Independence and eigenspace dimensions are preserved because is non-singular.
Diagonalisation by an eigenvector basis
EQ-SM-04Available exactly when has linearly independent eigenvectors. The eigenvalues appear in the same order as their eigenvectors in .
Powers under similarity
EQ-SM-05The inner factors collapse between consecutive terms, so conjugation commutes with taking powers. This is the mechanism that makes diagonalisation valuable for repeated application.
Worked similarity transformation
EQ-SM-06A non-singular integer matrix with , so its inverse is also integral and the transformation can be carried out exactly.
Preserved quantities
EQ-SM-07Three of the invariants of similarity. Each provides an independent arithmetic check on a computed similarity transformation.
Variable Definitions
| Symbol | Name | Meaning | Domain / type |
|---|---|---|---|
| Transformed matrix | The result of the similarity transformation | n x n complex matrix | |
| Original matrix | The matrix being re-expressed in a new basis | n x n complex matrix | |
| Similarity matrix | Non-singular matrix whose columns are the new basis | n x n non-singular | |
| Inverse similarity matrix | Converts standard coordinates into coordinates relative to the columns of | n x n non-singular | |
| Size | Common order of all three matrices | positive integer | |
| Eigenvalue | Shared by similar matrices with equal multiplicities | complex number | |
| Eigenvector of | Maps to the eigenvector of | non-zero vector in C^n | |
| Trace | Sum of diagonal entries, invariant under similarity | complex number | |
| Determinant of | Must be non-zero for to be admissible | non-zero complex number |
Worked Numerical Example
Problem statement
A symmetric stiffness matrix describes a three-degree-of-freedom model in physical coordinates. An analyst re-expresses the model in a non-orthogonal working basis given by the columns of . Compute the transformed matrix and verify that the two descriptions carry identical intrinsic content.
State the matrices
The physical matrix is symmetric and tridiagonal. The working basis is the set of columns of , chosen for convenience rather than orthogonality.
Confirm is non-singular and invert it
Expanding along the first row gives , which is non-zero, so qualifies. Because the determinant is the inverse has integer entries and the whole computation stays exact.
Form first
Multiplying on the right transforms the columns: column of is applied to the -th new basis vector. Doing this step first keeps the intermediate result interpretable.
Apply on the left
Left multiplication re-expresses each of those columns in the new basis. The result is the matrix of the same operator in the working coordinates.
Observe what changed
The transformed matrix is not symmetric, even though is. Symmetry is a property of the coordinate system, not of the operator, and only an orthogonal would have preserved it. The entries bear no visible resemblance to those of .
Check the invariants
The trace is for and for . Both determinants equal . Both characteristic polynomials are , so the two matrices have the same eigenvalues with the same multiplicities.
Transport an eigenvector
The eigenvector of for is . Applying gives , and direct multiplication confirms this is an eigenvector of for the same eigenvalue.
Note the better choice of
Had the columns of been the three eigenvectors , and instead, the transformed matrix would have been . The same operator, the same eigenvalues, but a representation in which every subsequent computation is scalar arithmetic. This is the target that the definition of similarity exists to make reachable.
The two matrices and look nothing alike entry by entry, yet they share every intrinsic quantity: characteristic polynomial, eigenvalues, multiplicities, trace, determinant and rank. Only the coordinate-dependent features differ, and symmetry is one of them. The example also shows the cost of a poor choice of basis: a symmetric, sparse, well-conditioned matrix has become dense and non-symmetric with no analytical gain, which is why is normally chosen from eigenvectors or constrained to be orthogonal.
Applications & Industry Use
Transformation to modal coordinates
Assembling the mode shapes of a structure as the columns of produces a similarity transformation that diagonalises the system matrix. In modal coordinates each degree of freedom evolves independently, so a many-degree-of-freedom transient becomes a set of uncoupled single-degree-of-freedom problems solved in parallel.
State-space realisations
Any invertible change of state variables produces a new realisation with state matrix . Controllable canonical, observable canonical and modal forms are all similarity transformations of one another, which is why controller designs based on pole locations transfer between realisations unchanged.
Numerical eigenvalue algorithms
The QR iteration is a sequence of orthogonal similarity transformations driving a matrix towards triangular form. Orthogonal similarity is chosen specifically because it preserves the two-norm and the condition number, so the eigenvalues of the final triangular matrix are those of the original to within a small backward error.
Rotating a tensor into principal axes
Expressing a stress or inertia tensor in a rotated frame is a similarity transformation by the rotation matrix. Because rotation matrices are orthogonal, the transformation preserves symmetry as well as the eigenvalues, which is why principal stresses and principal moments of inertia are frame-independent quantities.
Reaction coordinate transformations
Recasting a linearised reaction network in terms of reaction extents rather than species concentrations is a change of basis on the state, and the Jacobian transforms by similarity. The relaxation time constants, being eigenvalues, are unchanged, confirming that the choice of coordinates does not alter the physics.
Changing reference frames
A linear map expressed in a tool frame and the same map expressed in a world frame are related by conjugation with the frame transformation. Quantities used for planning — manipulability eigenvalues, condition numbers of the Jacobian in a normalised metric — must be checked for frame dependence, since only the similarity invariants transfer unchanged.
Design Considerations
Prefer an orthogonal or unitary wherever possible
When is orthogonal, , so the inverse costs nothing, symmetry is preserved and the transformation neither amplifies nor attenuates error. A general has none of these properties. Every serious numerical eigenvalue algorithm restricts itself to orthogonal or unitary similarity for exactly this reason.
Watch the conditioning of
The accuracy of a computed similarity transformation degrades with the condition number , and errors in are amplified by up to in the eigenvalues of . Near-defective matrices force an ill-conditioned eigenvector matrix, which is precisely the situation where the naive diagonalising should not be used.
Fix the direction convention and document it
Whether the transformation is written or determines whether the columns of are the new basis or the old one. Both conventions appear in the literature and in software. A single unstated convention change inverts the transformation and produces plausible but wrong results, so state it explicitly in interfaces and documentation.
Do not expect structure to survive
Symmetry, bandedness, sparsity, non-negativity and stochasticity are all coordinate-dependent and are generally destroyed by a similarity transformation. If a downstream algorithm relies on such a property, either constrain to preserve it — orthogonal for symmetry, permutation for sparsity patterns — or re-establish the property explicitly after the transformation.
Use similarity to move work, not to create it
The transformation is worth doing only when the transformed matrix makes some subsequent computation cheaper: repeated powers, a matrix exponential, many right-hand sides. For a single determinant or a single linear solve, the cost of forming exceeds the saving. Decide what the transformed form is for before computing it.
Test similarity by invariants, but do not prove it by them
Equal trace, determinant and characteristic polynomial are necessary for similarity, so a mismatch definitively refutes it. They are not sufficient: two matrices can share a characteristic polynomial and still fail to be similar, when their eigenspace dimensions differ. Establishing similarity requires exhibiting an , or comparing canonical forms.
Standards & Codes
Notation, interchange and numerical standards that govern how this material is written down, stored and computed in production systems.
| Reference | Title | Relevance to this topic |
|---|---|---|
ISO 80000-2 | Quantities and units — Part 2: Mathematics | Sets the notation for the inverse superscript, the determinant and trace operators, and the bracket forms used to display the similarity transformation. |
LAPACK reference implementation | Linear Algebra PACKage reduction and Schur routines | xGEHRD and xHSEQR implement the orthogonal similarity transformations that reduce a matrix to Hessenberg and then Schur form, the numerical backbone of every dense eigenvalue computation. |
IEC 61131-3 | Programmable controllers — Programming languages | State-space controller blocks implemented under this standard are realisation-dependent, so the similarity transformation between a design realisation and an implementation realisation must be recorded to interpret internal states. |
IEEE 754-2019 | IEEE Standard for Floating-Point Arithmetic | Bounds the rounding error in forming , which is amplified by the condition number of and is the reason non-orthogonal similarity is avoided numerically. |
ISO/IEC 40314 | Mathematical Markup Language (MathML) Version 3.0 | Encodes the matrix displays and inverse superscripts on this page as semantic markup, keeping the transformation searchable and accessible. |
Material Selection
For a mathematical topic, "material" is the numeric representation: the scalar field, storage format and precision the computation is built from.
| Representation | Select when | Trade-off |
|---|---|---|
| Unimodular integer with | Exact hand or symbolic work where the inverse must also be integral, as in the worked example. | Keeps every intermediate quantity an integer with no rounding at all, but such matrices are rare and cannot generally be built from eigenvectors. |
| Exact rational | Symbolic diagonalisation of a small matrix whose eigenvectors have rational entries. | Exact and fully general within its scope, but the entries of can have large denominators and the transformed matrix becomes unwieldy. |
| Orthogonal or unitary in binary64 | Any numerical similarity transformation, and mandatory when symmetry must be preserved. | Perfectly conditioned with available for free, but cannot reach a diagonal form for a general non-normal matrix; the best attainable is triangular. |
| General eigenvector in binary64 | The matrix is comfortably diagonalisable and a diagonal form is needed for powers or exponentials. | Gives the simplest possible transformed matrix, but the accuracy of everything downstream is governed by , which is unbounded as the matrix approaches defectiveness. |
| Permutation | Reordering states or degrees of freedom, for example to expose block structure or improve sparsity. | Exact, cost-free to invert, and preserves sparsity and symmetry, but can only reorder — it cannot simplify the numerical content of the matrix. |
| Block-diagonal | The model decomposes into weakly coupled subsystems that are each transformed independently. | Preserves the block structure and keeps the conditioning local to each block, but cannot remove coupling between blocks. |
Manufacturing Notes
Implementation notes — how the result is actually produced by hand, by algorithm and by library, including cost and numerical behaviour.
Cost of forming a similarity transformation
Computing directly requires one inversion at roughly operations and two matrix multiplications at each, about in total. Solving for by an LU factorisation of avoids the explicit inverse and costs about , which is both cheaper and more accurate. Never form an explicit inverse when a solve will do.
Order of multiplication matters for interpretation
Compute first, then apply . The intermediate has columns equal to applied to each new basis vector, which is directly meaningful and easy to check by hand. Computing first gives an intermediate with no such reading, and errors are correspondingly harder to localise.
Verification of a computed transformation
Four cheap checks apply. Confirm and . Confirm by direct multiplication, which avoids relying on the computed inverse. And transport one known eigenvector of through and verify it is an eigenvector of for the same eigenvalue.
Library behaviour
No mainstream library offers a single similarity-transformation call, because the useful operation is always the construction of a particular . numpy.linalg.eig returns the eigenvector matrix that diagonalises; scipy.linalg.schur returns an orthogonal or unitary with triangular; scipy.linalg.hessenberg returns the orthogonal reduction used inside eigensolvers. Prefer these to hand-assembled transformations.
Numerical stability
An orthogonal similarity is backward stable: the computed result is the exact transformation of a matrix within roundoff of the input. A general similarity is not, and the error can be amplified by or worse. Where a non-orthogonal is unavoidable, report alongside the result so that downstream accuracy claims can be scaled accordingly.
Failure Modes & Common Mistakes
| Failure mode / mistake | Impact | Root cause | Prevention & detection |
|---|---|---|---|
| Using a singular | high | Assembling from eigenvectors of a defective matrix, so the columns are dependent. | Verify that row-reduces to the identity or that before inverting. A defective matrix cannot supply independent eigenvectors. |
| Reversing the direction of the transformation | high | Computing when was intended, or misreading whether the columns of are the new or the old basis. | Fix one convention, write it into the interface documentation, and test it on a case with a known answer such as a permutation. |
| Expecting symmetry to survive | medium | Transforming a symmetric matrix by a general non-orthogonal and passing the result to a symmetric eigensolver. | Restrict to be orthogonal or unitary when symmetry must be preserved; otherwise dispatch to a general solver after the transformation. |
| Inferring similarity from equal eigenvalues | medium | Observing that two matrices share a characteristic polynomial and concluding they are similar. | Equal characteristic polynomials are necessary but not sufficient. Compare eigenspace dimensions, or exhibit an explicit . |
| Confusing similarity with row equivalence | medium | Applying row operations alone and expecting the eigenvalues to be preserved. | Row reduction is one-sided and destroys eigenvalues. Similarity requires the inverse operation applied simultaneously on the other side. |
| Forming an explicit inverse unnecessarily | low | Computing as a matrix and multiplying, rather than solving . | Factor once and solve. The explicit inverse is more expensive and less accurate, and offers no advantage when it is used only once. |
| Ignoring an ill-conditioned | high | Diagonalising a near-defective matrix with its eigenvector matrix and trusting the result. | Compute and report . Where it is large, use a Schur factorisation, which is always available and always well conditioned, in place of diagonalisation. |
| Applying similarity to non-square or mismatched matrices | low | Attempting with rectangular or with of a different size. | Similarity is defined only for square matrices of equal size. For rectangular matrices the corresponding notion is equivalence, with and separately non-singular. |
FAQs
Why is the matrix required to be non-singular?
Because the definition uses , which exists only for a non-singular matrix. Structurally, non-singularity is what makes the columns of a basis, and hence what makes the transformation a genuine change of coordinates rather than a projection that loses information. A singular would collapse directions and could not be undone.
Does it matter whether I say is similar to or is similar to ?
No. If then , which is the same relation with in place of , and is non-singular. The relation is symmetric, so the two statements are interchangeable and it is normal to say simply that the matrices are similar.
Are similar matrices equal in any sense?
They are equal as descriptions of a linear operator, but not as arrays of numbers. Every entry can differ, and structural properties such as symmetry and sparsity can be lost. What is shared is everything intrinsic to the operator: eigenvalues, characteristic polynomial, trace, determinant, rank, and the dimensions of every eigenspace.
Is every square matrix similar to a diagonal matrix?
No. Diagonalisation requires linearly independent eigenvectors to fill the columns of , and a defective matrix — one with an eigenvalue whose geometric multiplicity is below its algebraic multiplicity — cannot supply them. The best general result is that every square matrix is similar to a Jordan form, which is diagonal apart from ones on the superdiagonal.
How is similarity different from row equivalence?
Row equivalence applies a non-singular matrix on the left only, , and is defined for matrices of any shape. Similarity applies on the left and on the right simultaneously, and requires square matrices. Row equivalence preserves the null space and row space but not the eigenvalues; similarity preserves the eigenvalues but not the echelon structure.
If two matrices have the same eigenvalues, must they be similar?
No. The identity matrix of size two and the matrix with ones on the diagonal and a single one above it share the characteristic polynomial , but the identity is similar only to itself, since for every . Equal eigenvalues are necessary for similarity but not sufficient; the eigenspace dimensions must also agree.
Why do numerical algorithms insist on orthogonal similarity?
Because an orthogonal matrix satisfies and has condition number exactly one. The transformation therefore costs no inversion, preserves the two-norm and symmetry, and does not amplify rounding error. A general similarity can amplify errors by the condition number of , which is unbounded, so it is used only when the resulting simplification justifies the risk.
References
- Beezer, R. A. A First Course in Linear Algebra, Version 0.70. University of Puget Sound, 2006. Section SD, Subsection SM. Licensed under the GNU Free Documentation License v1.2.
- Horn, R. A. and Johnson, C. R. Matrix Analysis, 2nd edition. Cambridge University Press, 2012. Chapter 1 and Chapter 3.
- Golub, G. H. and Van Loan, C. F. Matrix Computations, 4th edition. Johns Hopkins University Press, 2013. Section 7.1.
- ISO 80000-2:2019, Quantities and units — Part 2: Mathematics. International Organization for Standardization.
- Anderson, E. et al. LAPACK Users' Guide, 3rd edition. Society for Industrial and Applied Mathematics, 1999.
AI Suggested Questions
- Show two matrices with identical characteristic polynomials that are not similar, and prove they are not by comparing eigenspace dimensions.
- Why can a similarity transformation by an orthogonal matrix preserve symmetry when a general one cannot?
- Derive the state matrix of a controllable canonical realisation as an explicit similarity transformation of a given state-space model.
- How does the condition number of the eigenvector matrix bound the error in a numerically computed diagonalisation?
- Explain why the identity matrix is similar only to itself, and characterise all matrices with that property.
- What is the relationship between similarity of square matrices and equivalence of rectangular matrices under ?
Related Calculators
Compute exactly or numerically and report the invariants shared by the two matrices.
Diagonalisability CheckerDecide whether a matrix admits a diagonalising and return the eigenvector matrix and its condition number.
Matrix Inverse CalculatorInvert the similarity matrix with a full audit trail, or solve without forming the inverse.
