Engineering/Mathematics/Representations
The Change-of-Basis Matrix
A single vector has a different coordinate vector relative to every basis. The change-of-basis matrix converts coordinates relative to into coordinates relative to by one matrix-vector product, and it is nothing more than the matrix representation of the identity transformation.
- Advanced level
- Stream: representations
- Reading time 15 min
- Ref KVS-ENG-MATH-0114
- Taxonomy
- Engineering / Mathematics
- Prerequisite
- Bases, vector representation , matrix representation
- Definition
- , the representation of the identity
- Action
- Always
- Non-singular, with
- Columns
- Coordinates of the vectors relative to
Overview
Coordinates are not intrinsic to a vector. The same polynomial, the same displacement field, the same state of a system has as many coordinate vectors as there are bases of the space it lives in. Any workflow that uses more than one basis — and most engineering workflows do — therefore needs a reliable way of converting between coordinate descriptions of a single object. The change-of-basis matrix is that converter, and it is a single fixed matrix that works for every vector in the space.
Its definition is a special case of matrix representation rather than a new construction. Take the identity transformation on the space, which does nothing at all to a vector, and represent it using basis for the domain and basis for the codomain. Because the transformation changes nothing but the two bases differ, the resulting matrix records exactly the discrepancy between the two descriptions. Its columns are the coordinates, relative to , of the vectors of .
The governing theorem follows at once from the fundamental theorem of matrix representation: for every vector. One matrix-vector product performs the conversion, with no need to re-solve an expansion problem for each new vector. A second theorem states that every change-of-basis matrix is non-singular and that its inverse is the change-of-basis matrix in the opposite direction, so the conversion is never lossy and never ambiguous.
In practice one of the two directions is usually far easier to construct than the other. Expressing the vectors of an awkward basis in terms of a convenient one is normally straightforward; the reverse requires solving a linear system for each vector. The standard tactic is to build whichever direction is cheap and obtain the other by matrix inversion, a manoeuvre the second theorem licenses. This same matrix is also the ingredient that converts a matrix representation of an operator from one basis to another, which is where similarity transformations come from.
Definition
Change-of-Basis Matrix
CBMLet be a vector space with ordered bases and . The change-of-basis matrix from to is the matrix representation of the identity transformation relative to and , that is, the matrix whose -th column is . It is written .
The identity transformation is present only to make the construction an instance of matrix representation; the content of the definition is the pair of bases. Read the subscripts as source then target: consumes -coordinates and produces -coordinates.
Vector Representation
VRFor an ordered basis of , every vector has a unique expansion , and is the column of coefficients . The map is an invertible linear transformation from onto .
Identity Transformation
IDLTThe transformation defined by . It is invertible and equal to its own inverse. Represented with one basis at both ends it gives the identity matrix; represented with two different bases it gives a change-of-basis matrix.
Concepts
The columns are coordinates of the source basis
Because the identity transformation sends to itself, column of is — the coordinates of the -th vector of the source basis expressed in the target basis. This is worth memorising as the construction rule, because it is the fastest route to writing the matrix down and because it makes the direction convention self-evident: the source basis supplies the columns and the target basis supplies the coordinate system.
The change-of-basis theorem
Applying the fundamental theorem of matrix representation to gives . One product converts the coordinate description of any vector. The economy is significant: expanding a vector in an awkward basis from scratch costs a linear solve every time, whereas after the change-of-basis matrix has been built once, each conversion costs and no decisions.
Non-singularity and the reverse direction
Since is an invertible transformation whose inverse is itself, the theorem on representations of invertible transformations applies: is an invertible matrix and its inverse is the representation of with the bases exchanged, namely . Hence , and no change of basis can ever be singular. Conversion is therefore always reversible, and information is never lost by re-expressing a vector.
Build the easy direction, invert for the other
Constructing requires expressing every vector of in terms of . When is a convenient basis this is immediate; when is awkward it is separate linear solves. Since the reverse matrix is the inverse, the efficient procedure is always to build whichever direction has the convenient basis as its target and then invert. In the common case where one basis is a standard or monomial basis, this reduces the whole task to writing down obvious coordinates and performing one inversion.
Chaining conversions
Three bases , and of the same space satisfy , because the composition of the identity with itself is the identity and representations of a composition multiply. Conversions therefore chain like any other transformations, in the same right-to-left order, and . This is what allows a system to define every basis relative to one reference basis and derive all remaining conversions by multiplication.
The special case of coordinate space
When and is the standard basis, does nothing, so is simply the matrix whose columns are the vectors of written out. Its inverse converts standard coordinates into -coordinates. This is the familiar statement that expressing a vector in a new basis means solving a system whose coefficient matrix has the new basis vectors as columns, and it explains why nearly independent basis vectors make the conversion ill conditioned.
Converting coordinates between two bases
Equations
Definition of the change-of-basis matrix
EQ-CBM-01Columns are the coordinates, relative to the target basis , of the vectors of the source basis .
Change-of-basis theorem
EQ-CBM-02One matrix-vector product converts the coordinates of any vector from the description to the description.
Inverse of a change-of-basis matrix
EQ-CBM-03Every change-of-basis matrix is non-singular, and its inverse is the conversion in the opposite direction.
Chaining and the trivial case
EQ-CBM-04Conversions compose in the same right-to-left order as transformations, and converting a basis to itself does nothing.
Coordinate space with the standard basis
EQ-CBM-05Against the standard basis the matrix is just the basis vectors written as columns, and the reverse conversion is its inverse.
Orthonormal bases
EQ-CBM-06Between orthonormal bases the change-of-basis matrix is unitary, so the reverse conversion is the adjoint and no inversion is needed.
Taylor re-centring on quadratics
EQ-CBM-07Converting monomial coordinates into coordinates relative to the shifted basis , as derived in the worked example.
Variable Definitions
| Symbol | Name | Meaning | Domain / type |
|---|---|---|---|
| Vector space | The single space carrying both bases | vector space of dimension n | |
| Source basis | Ordered basis whose coordinates are the input; supplies the columns | ordered basis of V | |
| Target basis | Ordered basis whose coordinates are the output; supplies the coordinate system | ordered basis of V | |
| Change-of-basis matrix | Converts -coordinates into -coordinates | n x n non-singular matrix | |
| Coordinates in the source basis | Column of coefficients expressing in | element of C^n | |
| Coordinates in the target basis | Column of coefficients expressing the same in | element of C^n | |
| Identity transformation | The transformation being represented; changes nothing about the vector | element of L(V,V) | |
| Dimension | Common size of both bases and of the square conversion matrix | positive integer | |
| Source basis vector | The -th vector of , whose target coordinates form column | element of V |
Worked Numerical Example
Problem statement
A polynomial calibration model for a sensor is stored in monomial coordinates but must be re-expressed about the operating point , so that the stored coefficients read directly as offset, slope and curvature at that point. Build the change-of-basis matrix between the monomial basis and the shifted basis, convert a specific model, and verify the reverse direction.
Name the two bases
Work in . The stored basis is the monomial basis and the required basis is the shifted basis , centred on the operating point. Both are bases of the same three-dimensional space, so a change-of-basis matrix exists and is .
Express the source basis in the target basis
Each monomial must be written in powers of . Trivially ; then ; and expanding gives . Reading off the coefficients supplies the three columns.
Assemble the change-of-basis matrix
Placing those coordinate vectors as columns gives the matrix that converts monomial coordinates into shifted coordinates. It is upper triangular, which is characteristic of a conversion between two nested families of polynomials.
Convert a stored model
Take the calibration , stored as . Applying the matrix converts to shifted coordinates.
Decode and check the physical reading
The result says . Expanding confirms , the original model. The new coefficients are exactly the value, the first derivative and half the second derivative at : the model reads at the operating point with zero local slope.
Build the reverse direction independently
Expressing the shifted basis in monomials is equally easy: , and . These columns give directly, without inverting anything.
Confirm the two are inverses
Multiplying the two conversions must give the identity, as the inverse theorem requires. Row one of against the columns of gives , and ; the remaining rows check the same way.
Convert back as a final check
Applying to the shifted coordinates returns , the original monomial coordinates. The round trip is exact, as non-singularity guarantees.
The same quadratic has coordinates in monomials and about the operating point, and one fixed matrix converts between them for every model in the space. The shifted description is the more useful one for control and calibration work, since its entries are the local value, slope and curvature rather than global coefficients.
Applications & Industry Use
Direction cosine matrices between axis systems
Body axes, wind axes and earth axes are three bases of the same three-dimensional space. The direction cosine matrix relating any two of them is a change-of-basis matrix, and because all three bases are orthonormal its inverse is simply its transpose. Chaining conversions through a common reference frame is the composition rule applied to coordinate conversions.
Clarke and Park transformations
Three-phase quantities are coordinates relative to the phase basis; the stationary and rotating reference frames used in motor drive control are two other bases of the same space. The Clarke and Park matrices are the corresponding change-of-basis matrices, chosen because balanced sinusoidal quantities become constants in the rotating description, which is far easier to regulate.
Datum and frame transformations
A position expressed in one terrestrial reference frame must often be re-expressed in another. The linear part of that conversion is a change-of-basis matrix between the two frame axes, and its guaranteed invertibility is what makes the conversion reversible to the precision of the parameters supplied.
Local to global degree-of-freedom conversion
Element stiffness matrices are derived in a local basis aligned with the element and must be assembled in a global basis common to the whole model. The conversion of displacement coordinates between the two is a change-of-basis matrix, and applying it to the operator rather than to a single vector is what produces the familiar congruence transformation used during assembly.
Polynomial basis conversion
Models are stored in monomial, Newton, Bernstein or Chebyshev bases according to the task. Converting between them is a change of basis, and the conditioning of the conversion matrix predicts how much accuracy is lost. Conversion from a Chebyshev description to a monomial one is notoriously ill conditioned at high degree, which is why evaluation is normally performed in the basis the model was fitted in.
Scores in a principal component basis
Reporting a sample as a set of principal component scores rather than raw variable values is a change of basis on the measurement space. Because the principal basis is orthonormal, the conversion matrix is orthogonal and the inverse conversion — reconstructing the raw variables from the scores — costs nothing beyond a transpose.
Design Considerations
Fix and document the direction convention
The two matrices and are inverses, both are equally natural to write down, and confusing them produces results that are wrong but plausible. Adopt one convention — here, source first and target second — state it wherever a conversion matrix is stored, and prefer names that carry both bases rather than a bare label such as T.
Build the direction that is cheap and invert once
Constructing a conversion whose target is a convenient basis costs nothing but transcription; constructing one whose target is awkward costs linear solves. Always build the cheap direction, then obtain the other by a single inversion or, better, by factorising once and solving as needed.
Prefer orthonormal bases where the physics permits
Between orthonormal bases the conversion is unitary: its inverse is its adjoint, it preserves norms and inner products, and its condition number is one. Rotations between frames and principal component bases all enjoy this property. When a basis can be chosen orthonormal at no modelling cost, the numerical benefit is substantial and free.
Watch conditioning when bases are nearly dependent
A change-of-basis matrix is always invertible in exact arithmetic, but it can be arbitrarily close to singular. Conversions between polynomial bases at high degree and between nearly parallel physical axes are the usual offenders. Compute the condition number before trusting a conversion, and remember that the error introduced is a property of the basis pair, not of the vector being converted.
Convert once, not repeatedly
Round-tripping coordinates between bases inside a loop accumulates rounding error and wastes arithmetic. Decide which basis the computation should be performed in, convert on entry and on exit only, and keep intermediate results in a single description. This is the same discipline that governs unit conversions in a physical model.
Do not confuse converting a vector with converting an operator
A change-of-basis matrix converts coordinates of vectors. Re-expressing a matrix representation of an operator requires the conversion on both sides, giving a similarity transformation. Applying a one-sided conversion to an operator representation is a common and silent error, since the shapes conform and the result looks like a matrix of the right size.
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 19111 | Geographic information — Referencing by coordinates | Formalises coordinate reference systems and the operations that convert between them, the geospatial industry's expression of exactly the construction on this page. |
ISO 1151-1 | Flight dynamics — Concepts, quantities and symbols | Defines the body, wind and earth axis systems of flight mechanics and the conventions for the direction cosine matrices that convert between them. |
ISO 80000-2 | Quantities and units — Part 2: Mathematics | Standardises the notation for matrices, coordinate columns and the adjoint, keeping the distinction between a vector and its coordinate representation explicit. |
IEEE 754-2019 | IEEE Standard for Floating-Point Arithmetic | Governs the rounding in a conversion product, and hence the drift observed when coordinates are converted back and forth between two bases many times. |
LAPACK / BLAS reference | Linear Algebra PACKage reference implementation | Supplies the factorisation and condition estimation routines used to invert a conversion matrix safely and to detect a nearly dependent basis pair before it corrupts results. |
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 |
|---|---|---|
| Exact rational entries | Conversions between structured polynomial bases, where the entries are small integers or simple fractions determined by combinatorics. | The conversion and its inverse are exact and often recognisably patterned, but entries grow rapidly with degree and the approach does not scale. |
| IEEE 754 binary64 | General numerical conversions between physically defined bases in engineering software. | Fast and universal, but each conversion introduces rounding proportional to the condition number of the basis pair, so repeated round trips drift. |
| Orthogonal or unitary conversion | Both bases can be taken orthonormal, as with rotations between frames or principal component bases. | Perfect conditioning and a free inverse via the adjoint, but the requirement constrains how bases may be chosen and normalised. |
| Triangular conversion from nested bases | The bases are nested families such as monomials against shifted powers or Newton forms. | Conversion and inversion cost by substitution rather than , though triangular polynomial conversions become badly conditioned at high degree. |
| Sparse storage | Local bases in discretised problems, where each source basis vector involves only a few target basis vectors. | Conversion cost scales with the number of non-zeros, but the inverse conversion is generally dense, so keep it factored rather than forming it. |
| Fixed-point entries | Frame conversions implemented in embedded motor control or navigation hardware without floating-point support. | Deterministic timing and small footprint, but the conversion must be pre-scaled and orthogonality is only approximate after quantisation. |
Manufacturing Notes
Implementation notes — how the result is actually produced by hand, by algorithm and by library, including cost and numerical behaviour.
Hand procedure
Write the vectors of the source basis one at a time, express each in the target basis, and stack the resulting coefficient columns left to right in the order of the source basis. Every column is an independent small problem, so an error affects exactly one column and is easy to localise by testing the conversion on the corresponding basis vector.
Cost of construction and use
If the target basis is convenient, construction is transcription. If it is not, each column is a linear solve against the same basis matrix, so factorise once and reuse the factorisation for all columns rather than solving independently. Once built, each conversion costs and the matrix is reusable for every vector in the space.
Verification
Two checks catch almost everything. Multiply the two directions and confirm the identity. Then convert one vector and decode both descriptions back into the space, confirming they are the same object. Testing on the basis vectors themselves is especially informative, since converting must return column .
Library behaviour
There is rarely a dedicated function, because the operation is just a solve. In NumPy, assembling the basis vectors as the columns of P makes numpy.linalg.solve(P, v) the conversion of standard coordinates into -coordinates, and P @ a the reverse. SymPy can produce exact conversion matrices between polynomial bases symbolically, which is the safer route when the entries are combinatorial.
Conditioning in practice
The relative error of a conversion is bounded by the condition number of the conversion matrix times the unit round-off. Between orthonormal bases that number is one and conversions are essentially free of error. Between a Chebyshev and a monomial basis of degree thirty it can exceed , at which point converting a fitted model destroys most of its accuracy and the model should instead be evaluated in its native basis.
Failure Modes & Common Mistakes
| Failure mode / mistake | Impact | Root cause | Prevention & detection |
|---|---|---|---|
| Using the conversion in the wrong direction | high | Multiplying by when was needed, since both are square and the product conforms. | Adopt and document a source-then-target subscript convention, and test the matrix on a single source basis vector, which must produce its known target coordinates. |
| Applying the matrix to a vector rather than to coordinates | high | Multiplying the conversion matrix by the abstract object, or by the same object's coordinates in a third basis. | Route every conversion through explicitly, and keep coordinate vectors tagged with the basis they belong to. |
| Assuming the inverse is the transpose | high | Generalising from rotations, where the bases are orthonormal, to arbitrary basis pairs where it is false. | Use the transpose only after confirming both bases are orthonormal with respect to the relevant inner product; otherwise invert properly. |
| Reordering a basis after building the matrix | medium | Bases stored in unordered containers, so a later enumeration permutes the columns or rows. | Store bases as ordered immutable sequences and rebuild the conversion whenever the order changes. |
| Converting an operator with a one-sided product | high | Treating a matrix representation of a transformation as if it were a coordinate vector and applying a single conversion. | Re-expressing an operator requires conversions on both sides, giving a similarity transformation; a one-sided product is never correct for an operator. |
| Accumulating drift by repeated round trips | medium | Converting back and forth inside an iteration, so rounding error compounds. | Choose one working basis, convert on entry and exit only, and if round trips are unavoidable, use an orthonormal pair where the conversion is norm preserving. |
| Ignoring an ill-conditioned basis pair | medium | Converting between high-degree polynomial bases or nearly parallel physical axes without checking the conditioning. | Estimate the condition number when the conversion is built and report it; redesign the basis or work natively in the fitted basis when it is large. |
| Mixing bases of different spaces | low | Constructing a conversion between bases that do not belong to the same vector space, producing a meaningless square array. | Confirm both bases span the same space before construction; a change of basis is a statement about one space with two descriptions. |
FAQs
Why is the change-of-basis matrix defined using the identity transformation?
Because it makes the construction an instance of matrix representation rather than a separate theory, so every theorem about representations applies immediately. The change-of-basis theorem is the fundamental theorem specialised to , and the inverse theorem is the invertible-representation theorem specialised the same way.
Which way round do the subscripts go?
Source first, target second: consumes coordinates relative to and produces coordinates relative to . The construction rule is the reminder — the columns are the coordinates of the vectors expressed in , so supplies the columns and supplies the coordinate system.
Can a change-of-basis matrix ever be singular?
No. It represents the identity transformation, which is invertible, so its representation is a non-singular matrix. That is what guarantees a conversion is always reversible. It can nevertheless be badly conditioned, meaning the conversion is theoretically exact but numerically fragile.
Is the inverse just the transpose?
Only when both bases are orthonormal with respect to the same inner product, in which case the conversion matrix is unitary and the inverse is the adjoint. For general bases the transpose is unrelated to the inverse, and using it produces silently wrong results, since the shapes still conform.
How does this differ from re-expressing a matrix representation of an operator?
A change-of-basis matrix converts coordinates of vectors and is applied on one side. An operator representation has an input side and an output side, so re-expressing it requires a conversion on each, producing a similarity transformation when one basis is used at both ends. Applying a single conversion to an operator representation is a category error.
What is the fastest way to build the matrix when both bases are awkward?
Route through a third, convenient basis. Build the conversion from each awkward basis to the convenient one, then chain: . In a system with many bases this is the standard architecture — define every basis against one reference and derive all remaining conversions by multiplication.
Does converting coordinates change the vector?
No. The vector is unchanged; only its description changes. This is precisely why the identity transformation is the right thing to represent. Any procedure that appears to alter a physical quantity during a conversion has an error in the conversion, in the units, or in the basis definitions.
References
- Beezer, R. A. A First Course in Linear Algebra, Version 0.70. University of Puget Sound, 2006. Section CB, Subsection CBM. Licensed under the GNU Free Documentation License v1.2.
- ISO 19111:2019, Geographic information — Referencing by coordinates. International Organization for Standardization.
- Golub, G. H. and Van Loan, C. F. Matrix Computations, 4th edition. Johns Hopkins University Press, 2013.
- Higham, N. J. Accuracy and Stability of Numerical Algorithms, 2nd edition. Society for Industrial and Applied Mathematics, 2002.
- ISO 80000-2:2019, Quantities and units — Part 2: Mathematics. International Organization for Standardization.
AI Suggested Questions
- Build the change-of-basis matrix between the monomial and Chebyshev bases of degree five and report its condition number.
- Show why the Clarke and Park transformations of three-phase power systems are change-of-basis matrices, and identify the two bases in each case.
- Given three bases of one space, construct all six conversion matrices from only two of them by chaining.
- Demonstrate the drift that accumulates when coordinates are converted back and forth a thousand times between two ill-conditioned bases.
- Why does a one-sided change of basis fail for an operator representation, and what is the correct two-sided expression?
- Construct a change-of-basis matrix between two orthonormal bases of a three-dimensional space and verify it is unitary.
Related Calculators
Enter two ordered bases of one space and obtain , its inverse, and the converted coordinates of any supplied vector.
Polynomial Basis ConverterConvert polynomial coefficients between monomial, shifted, Newton and Chebyshev bases, with a conditioning warning at high degree.
Condition Number CalculatorEstimate the condition number of a conversion matrix to gauge how much accuracy a basis change will cost.
