← LibraryThe Change-of-Basis Matrix | KEVOS® MathematicsProject Delivery · Project ManagementLesson 158/189← PrevNext →
ArticlePublished 8 Aug 202622 min readBy Kevin Jogin
Skip to content

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 CB,C converts coordinates relative to B into coordinates relative to C 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 ρB, matrix representation
Definition
CB,C=MB,CIV, the representation of the identity
Action
ρC(v)=CB,CρB(v)
Always
Non-singular, with CB,C1=CC,B
Columns
Coordinates of the B vectors relative to C

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 B for the domain and basis C 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 C, of the vectors of B.

The governing theorem follows at once from the fundamental theorem of matrix representation: ρC(v)=CB,CρB(v) 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

CBM

Let V be a vector space with ordered bases B={v1,v2,,vn} and C. The change-of-basis matrix from B to C is the matrix representation of the identity transformation IV relative to B and C, that is, the n×n matrix whose j-th column is ρC(vj). It is written CB,C.

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: CB,C consumes B-coordinates and produces C-coordinates.

Vector Representation

VR

For an ordered basis B={v1,,vn} of V, every vector has a unique expansion v=a1v1++anvn, and ρB(v) is the column of coefficients [a1an]t. The map ρB is an invertible linear transformation from V onto n.

Identity Transformation

IDLT

The transformation IV:VV defined by IV(v)=v. 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 vj to itself, column j of CB,C is ρC(vj) — the coordinates of the j-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 IV gives ρC(v)=ρC(IV(v))=MB,CIVρB(v)=CB,CρB(v). 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 O(n2) and no decisions.

Non-singularity and the reverse direction

Since IV is an invertible transformation whose inverse is itself, the theorem on representations of invertible transformations applies: CB,C is an invertible matrix and its inverse is the representation of IV with the bases exchanged, namely CC,B. Hence CB,C1=CC,B, 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 CB,C requires expressing every vector of B in terms of C. When C is a convenient basis this is immediate; when C is awkward it is n 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 B, C and D of the same space satisfy CB,D=CC,DCB,C, 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 CB,B=In. 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 V=n and E is the standard basis, ρE does nothing, so CB,E is simply the matrix whose columns are the vectors of B written out. Its inverse CE,B converts standard coordinates into B-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

Fix the directionDecide which basis holds the coordinates you have and which you want. The matrix CB,C takes B-coordinates to C-coordinates.
Identify the convenient basisDetermine which of the two bases makes coordinatisation immediate. That basis should be the target of the matrix you build by hand.
Build the columnsExpress each vector of the source basis in the target basis and place its coordinates as a column. The result is n columns of length n.
Invert if the direction is wrongIf the matrix you could build easily runs the other way, invert it; the inverse of a change-of-basis matrix is the reverse change of basis.
ConvertMultiply any coordinate vector by the matrix. The same matrix serves every vector in the space, so build once and reuse.
CheckConfirm the two directions multiply to the identity, and decode one converted vector back into the space to confirm it is unchanged.

Equations

Definition of the change-of-basis matrix

EQ-CBM-01
CB,C=MB,CIV=[ρC(v1)ρC(v2)ρC(vn)]

Columns are the coordinates, relative to the target basis C, of the vectors of the source basis B={v1,,vn}.

Change-of-basis theorem

EQ-CBM-02
ρC(v)=CB,CρB(v)vV

One matrix-vector product converts the coordinates of any vector from the B description to the C description.

Inverse of a change-of-basis matrix

EQ-CBM-03
CB,C1=CC,B

Every change-of-basis matrix is non-singular, and its inverse is the conversion in the opposite direction.

Chaining and the trivial case

EQ-CBM-04
CB,D=CC,DCB,C,CB,B=In

Conversions 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-05
V=n,E={e1,,en}CB,E=[v1v2vn]

Against the standard basis the matrix is just the basis vectors written as columns, and the reverse conversion is its inverse.

Orthonormal bases

EQ-CBM-06
B,CorthonormalCB,C1=CC,B=(CB,C)

Between 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-07
CB,C=[111012001]

Converting monomial coordinates {1,x,x2} into coordinates relative to the shifted basis {1,x1,(x1)2}, as derived in the worked example.

Variable Definitions

Symbols used on this page
SymbolNameMeaningDomain / type
VVector spaceThe single space carrying both basesvector space of dimension n
BSource basisOrdered basis whose coordinates are the input; supplies the columnsordered basis of V
CTarget basisOrdered basis whose coordinates are the output; supplies the coordinate systemordered basis of V
CB,CChange-of-basis matrixConverts B-coordinates into C-coordinatesn x n non-singular matrix
ρB(v)Coordinates in the source basisColumn of coefficients expressing v in Belement of C^n
ρC(v)Coordinates in the target basisColumn of coefficients expressing the same v in Celement of C^n
IVIdentity transformationThe transformation being represented; changes nothing about the vectorelement of L(V,V)
nDimensionCommon size of both bases and of the square conversion matrixpositive integer
vjSource basis vectorThe j-th vector of B, whose target coordinates form column jelement 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 x=1, 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.

  1. Name the two bases

    Work in P2. The stored basis is the monomial basis B={1,x,x2} and the required basis is the shifted basis C={1,x1,(x1)2}, centred on the operating point. Both are bases of the same three-dimensional space, so a change-of-basis matrix exists and is 3×3.

  2. Express the source basis in the target basis

    Each monomial must be written in powers of x1. Trivially 1=1; then x=1+(x1); and expanding (x1)2=x22x+1 gives x2=1+2(x1)+(x1)2. Reading off the coefficients supplies the three columns.

    ρC(1)=[100],ρC(x)=[110],ρC(x2)=[121]
  3. 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.

    CB,C=[111012001]
  4. Convert a stored model

    Take the calibration u(x)=34x+2x2, stored as ρB(u)=[342]t. Applying the matrix converts to shifted coordinates.

    ρC(u)=[111012001][342]=[102]
  5. Decode and check the physical reading

    The result says u(x)=1+0(x1)+2(x1)2. Expanding confirms 2(x22x+1)+1=2x24x+3, the original model. The new coefficients are exactly the value, the first derivative and half the second derivative at x=1: the model reads 1 at the operating point with zero local slope.

  6. Build the reverse direction independently

    Expressing the shifted basis in monomials is equally easy: 1=1, x1=1+x and (x1)2=12x+x2. These columns give CC,B directly, without inverting anything.

    CC,B=[111012001]
  7. Confirm the two are inverses

    Multiplying the two conversions must give the identity, as the inverse theorem requires. Row one of CC,B against the columns of CB,C gives 1, 11=0 and 12+1=0; the remaining rows check the same way.

    CC,BCB,C=[111012001][111012001]=I3
  8. Convert back as a final check

    Applying CC,B to the shifted coordinates [102]t returns [10+2,04,2]t=[342]t, the original monomial coordinates. The round trip is exact, as non-singularity guarantees.

Result

The same quadratic has coordinates [342]t in monomials and [102]t about the operating point, and one fixed 3×3 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

Aerospace engineering

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.

Power systems

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.

Geospatial & surveying

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.

Structural finite element analysis

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.

Numerical analysis

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.

Chemometrics & data analysis

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 CB,C and CC,B 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 n 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.

Applicable standards, conventions and reference implementations
ReferenceTitleRelevance to this topic
ISO 19111Geographic information — Referencing by coordinatesFormalises coordinate reference systems and the operations that convert between them, the geospatial industry's expression of exactly the construction on this page.
ISO 1151-1Flight dynamics — Concepts, quantities and symbolsDefines the body, wind and earth axis systems of flight mechanics and the conventions for the direction cosine matrices that convert between them.
ISO 80000-2Quantities and units — Part 2: MathematicsStandardises the notation for matrices, coordinate columns and the adjoint, keeping the distinction between a vector and its coordinate representation explicit.
IEEE 754-2019IEEE Standard for Floating-Point ArithmeticGoverns 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 referenceLinear Algebra PACKage reference implementationSupplies 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 and precision selection
RepresentationSelect whenTrade-off
Exact rational entriesConversions 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 binary64General 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 conversionBoth 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 basesThe bases are nested families such as monomials against shifted powers or Newton forms.Conversion and inversion cost O(n2) by substitution rather than O(n3), though triangular polynomial conversions become badly conditioned at high degree.
Sparse storageLocal 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 entriesFrame 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 O(n2) 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 n columns rather than solving independently. Once built, each conversion costs O(n2) 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 vj must return column j.

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 B-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 1010, 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 modes, root causes and prevention
Failure mode / mistakeImpactRoot causePrevention & detection
Using the conversion in the wrong directionhighMultiplying by CC,B when CB,C 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 coordinateshighMultiplying the conversion matrix by the abstract object, or by the same object's coordinates in a third basis.Route every conversion through ρB explicitly, and keep coordinate vectors tagged with the basis they belong to.
Assuming the inverse is the transposehighGeneralising 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 matrixmediumBases 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 producthighTreating 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 tripsmediumConverting 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 pairmediumConverting 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 spaceslowConstructing 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 IV, and the inverse theorem is the invertible-representation theorem specialised the same way.

Which way round do the subscripts go?

Source first, target second: CB,C consumes coordinates relative to B and produces coordinates relative to C. The construction rule is the reminder — the columns are the coordinates of the B vectors expressed in C, so B supplies the columns and C 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: CB,D=CC,DCB,C. 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

  1. 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.
  2. ISO 19111:2019, Geographic information — Referencing by coordinates. International Organization for Standardization.
  3. Golub, G. H. and Van Loan, C. F. Matrix Computations, 4th edition. Johns Hopkins University Press, 2013.
  4. Higham, N. J. Accuracy and Stability of Numerical Algorithms, 2nd edition. Society for Industrial and Applied Mathematics, 2002.
  5. 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

Continue learning

Algebraic and Geometric Multiplicities of Eigenvalues | KEVOS® MathematicsArticle · Project ManagementAmitsur’s Theorem on the Radical of a Polynomial Ring | KEVOS®Article · Project ManagementAmitsur’s Theorem on the Radical of an Algebra of Small Dimension | KEVOS®Article · Project ManagementArchetypes: Reference Catalogue of Worked Systems | KEVOS® MathematicsArticle · Project Management