Engineering/Mathematics/Matrices
Orthogonal and Unitary Matrices
A square matrix is orthogonal when , so its inverse is obtained by conjugate transposition rather than by elimination. Such matrices are exactly those with orthonormal columns, and they preserve every inner product and every length they act on.
- Advanced level
- Stream: orthogonality
- Reading time 15 min
- Ref KVS-ENG-MATH-0046
- Taxonomy
- Engineering / Mathematics
- Prerequisite
- Inner products, norms and orthonormal sets
- Defining condition
- , where
- Inverse
- , at zero arithmetic cost
- Equivalent to
- Columns form an orthonormal set
- Geometric effect
- Preserves all inner products and lengths
Overview
Most square matrices require an computation before their inverse is known. A distinguished class avoids that cost entirely: matrices for which the adjoint — the conjugate transpose — is already the inverse. The defining condition looks like an arbitrary algebraic demand at first sight, but it turns out to be one of the most consequential conditions in the subject, and matrices satisfying it are ubiquitous in both theory and computation.
The condition has an immediate interpretation in terms of columns. Entry of the product is exactly the inner product of column with column . Demanding that this product be the identity matrix therefore says that distinct columns are orthogonal and every column has unit norm — that the columns form an orthonormal set. The algebraic definition and the geometric description are two readings of the same statement, and moving freely between them is the main skill this topic develops.
A second characterisation is geometric in a stronger sense. Such a matrix preserves inner products: for all vectors, and specialising to gives . Lengths and angles survive the transformation untouched, so the matrix acts as a rigid motion of the space about the origin: a rotation, a reflection, or a composition of the two. This is the property that makes orthogonal and unitary factors so valuable numerically, because a transformation that cannot change a length also cannot amplify an error.
Terminology varies across the literature. Over the real numbers the adjoint reduces to the transpose, the condition becomes , and the classical name is orthogonal. Over the complex numbers the conjugation is essential, and the common modern name is unitary. This page uses the conjugate-transpose condition throughout, so that every statement holds over and specialises correctly to ; a matrix satisfying only over is a genuinely different and much less useful object.
Definition
Adjoint of a Matrix
AFor a matrix , the adjoint is : transpose the matrix and conjugate every entry. Entrywise, .
Also written or in engineering and physics texts. For a real matrix , so results stated with adjoints specialise correctly without modification.
Orthogonal Matrix
OMA square matrix of size satisfying , that is . Over the real numbers the condition reduces to .
Much of the modern literature reserves orthogonal for the real case and calls the complex case unitary. The condition stated here is the complex one, so every theorem on this page applies verbatim to real orthogonal matrices.
Orthogonal Matrices are Invertible
OMIIf is orthogonal of size , then is nonsingular and . The inverse costs no arithmetic at all: it is a rearrangement of the entries with a sign change on the imaginary parts.
The proof observes that a product involving a singular factor would make singular, so both and are nonsingular; the one-sided inverse result then upgrades to .
Columns of Orthogonal Matrices are Orthonormal Sets
COMOSLet be a square matrix of size with columns . Then is an orthogonal matrix if and only if is an orthonormal set.
Hermitian Matrix
HMA square matrix with , also called self-adjoint. Entrywise , which forces every diagonal entry to be real. A real symmetric matrix is Hermitian.
Hermitian and orthogonal are independent conditions: the identity matrix is both, a general rotation is orthogonal but not Hermitian, and a general covariance matrix is Hermitian but not orthogonal.
Concepts
The product is a table of inner products
Expanding the matrix product entrywise gives , which is precisely the inner product of column with column . Requiring this array to equal therefore imposes unit-norm conditions on the diagonal and orthogonality conditions off it. The equivalence between the algebraic definition and orthonormality of the columns is not a theorem requiring machinery — it is this expansion read in two directions.
Rows are orthonormal too
Since implies , the same argument applied to the second product shows the rows of also form an orthonormal set. This symmetry is specific to square matrices: a rectangular matrix can have orthonormal columns without having orthonormal rows, which is exactly the situation in a thin QR factorisation and the reason the reduced factor is called semi-orthogonal rather than orthogonal.
Preservation of inner products and lengths
Using and the reversal rule for adjoints, . Taking and a square root gives . Angles are preserved because both the inner product and the two norms in the cosine formula are unchanged, so the transformation is an isometry of the space fixing the origin.
Permutation matrices and the group structure
Any rearrangement of the columns of produces an orthogonal matrix, since the columns remain the standard unit vectors and those are already orthonormal. There are such permutation matrices. More generally the orthogonal matrices of size are closed under multiplication — if and then — contain the identity and contain an inverse for each member, so they form a group under matrix multiplication. That group is not commutative for .
Conjugation is not optional over the complex numbers
The condition without conjugation is a different and far weaker requirement over . For the adjoint product is , while the transpose product has zeros on the diagonal and ones off it. The reason is that can vanish for a non-zero complex vector, whereas cannot. Only the conjugated form measures length.
Why numerical analysts prefer these matrices
Because holds for every vector, the induced two-norm of and of are both exactly one, so the condition number of an orthogonal matrix is exactly one. Multiplying by such a matrix therefore cannot amplify an existing error, and algorithms built from orthogonal factors — QR factorisation via Householder reflections or Givens rotations, the singular value decomposition, orthonormal diagonalisation of Hermitian matrices — inherit backward stability from that single fact.
Test: is this square matrix orthogonal?
Equations
Defining condition for an orthogonal matrix
EQ-OM-01Over the real numbers the conjugation is vacuous and the condition becomes .
Entries of the adjoint product as inner products
EQ-OM-02Entry is the inner product of columns and , which is why the defining condition is equivalent to orthonormality of the columns.
Inverse by conjugate transposition
EQ-OM-03The inverse requires no arithmetic. The second identity follows from the first by the one-sided inverse result for square matrices.
Orthonormality of the columns
EQ-OM-04The geometric restatement of the defining condition: unit norms on the diagonal, mutual orthogonality off it.
Preservation of inner products and norms
EQ-OM-05Valid for all . The second identity is the first with , followed by a square root.
A real orthogonal matrix
EQ-OM-06Every column has squared norm and every pair of distinct columns is orthogonal. The determinant is , so this matrix is a rotation.
A unitary matrix where conjugation is essential
EQ-OM-07The unconjugated product is not the identity, which shows that dropping the conjugation over produces an entirely different condition.
Hermitian condition
EQ-OM-08Self-adjointness forces the diagonal entries to equal their own conjugates and therefore to be real.
Variable Definitions
| Symbol | Name | Meaning | Domain / type |
|---|---|---|---|
| Orthogonal matrix | Square matrix satisfying | n x n complex matrix | |
| Adjoint of | Conjugate transpose ; equals the inverse when is orthogonal | n x n complex matrix | |
| Column of | One member of the orthonormal set formed by the columns | C^n, unit norm | |
| Inner product | ; equals in matrix form | complex scalar | |
| Norm of a vector | Length , invariant under an orthogonal matrix | nonnegative real | |
| Conjugate of a matrix | Entrywise complex conjugation, without transposition | same size as A | |
| Permutation matrix | A rearrangement of the columns of ; always orthogonal | n x n matrix | |
| Identity matrix | Target of the defining product and the simplest orthogonal matrix | n x n matrix | |
| Size | Common row and column count of | positive integer |
Worked Numerical Example
Problem statement
A three-axis inertial sensor is mounted on a bracket that rotates it relative to the vehicle frame. The claimed direction cosine matrix is given. Verify that it is orthogonal, obtain its inverse without elimination, and confirm that the transformation preserves the magnitude and relative orientation of measured vectors.
State the candidate matrix
Direction cosine matrices are built from unit vectors, so the common factor is the normalisation. Every entry of is an integer, which makes the arithmetic exact.
Check that the columns have unit norm
The squared norms of the columns of are , and . Dividing by gives unit norm for each column of , so the three diagonal entries of are .
Check mutual orthogonality
Only three inner products are needed rather than six, because the array is symmetric. Using the columns of : columns and give ; columns and give ; columns and give .
Conclude orthogonality and write down the inverse
The columns form an orthonormal set, so and is orthogonal. The inverse is the transpose, obtained by rearranging entries with no arithmetic whatsoever.
Classify the transformation
The determinant of evaluates to , so . An orthogonal matrix has determinant ; the value identifies this one as a proper rotation rather than a rotation composed with a reflection. A mounting matrix with determinant would indicate that an axis sign convention has been inverted somewhere in the bracket definition.
Transform a measured vector
A specific-force reading of in sensor axes maps to . The entries are , and .
Transform a second vector and check the inner product
For the image is , whose squared norm is , matching . The inner products also agree: and .
Note where conjugation would matter
Had the transformation been complex — a phase-rotation matrix in a modulation chain, for instance — the transpose alone would not suffice. For the adjoint product is while the plain transpose product has zeros on its diagonal, because does not measure length over .
The mounting matrix is confirmed orthogonal with determinant , so it is a pure rotation and the reverse transformation costs nothing beyond a transposition. Measured magnitudes and the angles between measured vectors are identical in both frames, which is the property that allows sensor data to be resolved into vehicle axes without any recalibration of scale. A failed unit-norm check would have indicated a normalisation error; a failed orthogonality check would have indicated a genuinely skewed mounting definition requiring reconstruction.
Applications & Industry Use
Direction cosine matrices for attitude
Body-to-navigation frame transformations are stored as real orthogonal matrices with determinant . Inverting a frame transformation is a transposition, and the orthogonality condition provides the numerical health check applied during integration: accumulated drift is removed by re-orthonormalising the matrix rather than by recomputing it.
QR factorisation and least squares
Householder reflections and Givens rotations are orthogonal matrices used to triangularise a matrix. Because they preserve the two-norm exactly, the residual of a least-squares problem is unchanged by their application, which is why QR-based solvers are preferred over normal equations for ill-conditioned data.
Orthogonal transforms and energy conservation
The discrete Fourier transform in its unitary scaling, the discrete cosine transform and orthogonal wavelet transforms are all unitary matrices. Parseval's relation is exactly the norm-preservation property, which means quantisation error introduced in the transform domain has the same energy in the signal domain — the foundation of transform-coding bit allocation.
Unitary gates and reversible computation
Every quantum gate is a unitary matrix, so state vectors retain unit norm and total probability is conserved. Reversibility is the statement , and composing gates corresponds to multiplying unitaries, which stays inside the same group.
Rigid body transformations
The rotational part of a rigid transformation is orthogonal with determinant . Storing rotations this way guarantees that object geometry is neither stretched nor sheared, and re-orthonormalisation after repeated composition prevents accumulated floating-point drift from introducing visible distortion.
Modal transformation of coupled systems
The mode shapes of a symmetric undamped system can be scaled to form an orthonormal set, giving an orthogonal modal matrix that decouples the equations of motion. Because the transformation preserves inner products, modal energy sums correctly to physical energy without any correction factor.
Design Considerations
Store rotations as orthogonal matrices only if you maintain them
Repeated multiplication of floating-point rotation matrices accumulates drift, so the product slowly ceases to be orthogonal. Either re-orthonormalise periodically — by a QR step or a polar decomposition — or store the rotation in a representation with fewer redundant parameters, such as a unit quaternion, and convert on demand.
Never solve a system with an orthogonal coefficient matrix by elimination
If is orthogonal, the solution of is , a single matrix-vector product at operations. Applying a general solver instead costs and discards a perfectly conditioned structure. Detect orthogonality before dispatching to a general routine.
Test orthogonality with the right number of inner products
Because is Hermitian, only its diagonal and one triangle need to be computed: inner products rather than . Compare each against or with a tolerance scaled by and machine epsilon, since exact equality will not hold in floating point.
Distinguish rotations from reflections by determinant
An orthogonal matrix has determinant . The value marks a proper rotation; marks an improper one, which reverses handedness. In a coordinate-frame definition a determinant of almost always means an axis sign convention has been mistaken, and it will silently mirror the geometry rather than raise an error.
Keep the conjugation in complex work
A derivation written with transposes rather than adjoints appears to work on real data and fails silently on complex data, because can vanish for a non-zero complex vector. Write adjoints throughout; nothing is lost on real inputs and complex inputs then need no rework.
Prefer orthogonal factors in any algorithm you must trust
An orthogonal matrix has condition number exactly one, so it cannot amplify an existing error. Algorithms constructed from orthogonal transformations — QR, singular value decomposition, orthonormal diagonalisation of Hermitian matrices — are backward stable for this reason, and the extra cost against an elimination-based method buys exactly that guarantee.
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 | Fixes the notation for the conjugate, transpose and adjoint of a matrix and for the inner product, including the distinction between and that this topic depends on. |
LAPACK / BLAS reference | Linear Algebra PACKage reference implementation | Provides xGEQRF for Householder QR and xORGQR or xUNGQR for forming the orthogonal or unitary factor explicitly, with separate real and complex entry points reflecting the transpose-versus-adjoint distinction. |
ISO 1151 | Flight dynamics — Concepts, quantities and symbols | Defines the axis systems and rotation sequences whose direction cosine matrices are the archetypal engineering example of real orthogonal matrices with determinant . |
ITU-T T.81 | Digital compression and coding of continuous-tone still images (JPEG) | Specifies the discrete cosine transform whose orthogonality underpins the energy-preservation argument used to allocate quantisation error across coefficients. |
IEEE 754-2019 | IEEE Standard for Floating-Point Arithmetic | Determines why a computed product of rotation matrices drifts away from orthogonality, and hence why re-orthonormalisation is a routine maintenance step in long integrations. |
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 |
|---|---|---|
| Real orthogonal matrix, binary64 | Attitude, rigid-body and modal transformations where all data is real. | Transposition gives the inverse at no cost and conditioning is perfect, but stored numbers carry only degrees of freedom, so the representation is redundant and drifts. |
| Complex unitary matrix, binary64 | Modulation chains, unitary discrete Fourier transforms and quantum gate simulation. | Retains all the structural advantages over , at double the storage and roughly four times the arithmetic per multiplication. |
| Unit quaternion | Three-dimensional rotations that are composed or interpolated many times, as in graphics and flight control. | Four numbers instead of nine, one normalisation constraint instead of six, and clean interpolation; requires conversion before it can act on a general matrix. |
| Householder or Givens factored form | The orthogonal factor of a QR decomposition, where it is only ever applied to vectors. | Stores the factor implicitly in or parameters and applies it in , but the explicit matrix must be formed if individual entries are needed. |
| Permutation matrix as an index vector | Row or column exchanges in factorisation and sorting. | Reduces an orthogonal matrix to integers and turns multiplication into indexing, but is applicable only to this special case. |
| Fixed-point direction cosines | Embedded attitude computation on microcontrollers without a floating-point unit. | Deterministic timing and small footprint, but drift from orthogonality is faster and the re-orthonormalisation step must itself be designed in fixed point. |
Manufacturing Notes
Implementation notes — how the result is actually produced by hand, by algorithm and by library, including cost and numerical behaviour.
Cost of the orthogonality test
Forming in full costs about operations. Exploiting the Hermitian symmetry of the result halves that, and in practice the test is usually restricted to the departure from the identity, , evaluated with a tolerance of order . For a matrix known to be nearly orthogonal, a small number of column inner products often suffices as a spot check.
Re-orthonormalising a drifted matrix
Gram-Schmidt applied to the columns restores orthonormality but is not symmetric in its treatment of the columns and can behave poorly in floating point unless the modified variant is used. The polar decomposition, which replaces by the nearest orthogonal matrix in the Frobenius norm, is the principled alternative and can be computed by a short Newton iteration or from a singular value decomposition.
Applying rather than forming the factor
LAPACK returns the orthogonal factor of a QR decomposition in factored Householder form. Applying it to a vector costs operations, whereas forming the explicit matrix costs and then multiplying costs again. Unless individual entries of the factor are required, keep it factored.
Verifying preservation of norms empirically
The most direct test of a candidate transformation is to apply it to a set of random unit vectors and check that the image norms remain within tolerance of one. This exercises the full matrix, catches an error in a single entry that a determinant check would miss, and needs no reference implementation.
Library conventions differ on the adjoint
NumPy's .T transposes without conjugating while .conj().T gives the adjoint; MATLAB's apostrophe operator conjugates and the dot-apostrophe does not; Eigen distinguishes transpose() from adjoint(). Code that is correct on real test data and wrong on complex data almost always traces to this distinction.
Failure Modes & Common Mistakes
| Failure mode / mistake | Impact | Root cause | Prevention & detection |
|---|---|---|---|
| Using the transpose instead of the adjoint on complex data | high | Carrying a real-valued derivation into complex arithmetic, where . | Write adjoints throughout and choose the conjugating operator in code deliberately. Test any transform on complex input, not only on real input. |
| Assuming orthonormal columns without checking norms | medium | Verifying mutual orthogonality but omitting the normalisation, so the matrix is a scaled orthogonal matrix. | Check the diagonal of as well as the off-diagonal entries. A missing normalisation is trivially repaired once detected. |
| Accumulated drift in a chain of rotations | high | Repeatedly multiplying floating-point rotation matrices without re-orthonormalising, so the product slowly loses orthogonality. | Re-orthonormalise on a schedule using a polar decomposition or QR step, or store rotations as unit quaternions and renormalise those instead. |
| Applying a general solver to an orthogonal system | medium | Dispatching to an LU-based solver without noticing the structure. | Detect or record orthogonality and use , an operation instead of . |
| Overlooking a determinant of | medium | Accepting any orthogonal matrix as a rotation, when an improper one reverses handedness. | Check the determinant explicitly when a proper rotation is required. A value of usually indicates a reversed axis convention in the frame definition. |
| Testing orthogonality with exact equality | low | Comparing a computed against entry by entry in floating point. | Use a norm-based test with a tolerance proportional to and machine epsilon. Exact agreement should not be expected and its absence is not an error. |
| Expecting a rectangular factor to be orthogonal | medium | Assuming the thin factor of a QR decomposition satisfies both and . | For an factor with only holds; is an orthogonal projector, not the identity. Track which identity your derivation uses. |
| Assuming orthogonal implies Hermitian or vice versa | low | Conflating two independent structural conditions because both involve the adjoint. | Orthogonality is ; Hermitian symmetry is . Only matrices whose square is the identity satisfy both. |
FAQs
What is the difference between an orthogonal matrix and a unitary matrix?
They are the same condition stated over different scalar fields. Over the real numbers the adjoint is the transpose and the classical name is orthogonal; over the complex numbers the conjugation matters and the usual name is unitary. Stating the condition as covers both, and every theorem here applies to real orthogonal matrices unchanged.
Why does checking the columns suffice to establish orthogonality?
Because entry of is exactly the inner product of column with column . Demanding that this array equal the identity is literally the demand that the columns be mutually orthogonal and of unit norm. The two statements are the same fact written in different notation.
If the columns are orthonormal, must the rows be too?
For a square matrix, yes: implies , and the second product encodes orthonormality of the rows. For a rectangular matrix the implication fails; a tall matrix can have orthonormal columns while its rows are not even independent.
Are the entries of an orthogonal matrix bounded?
Yes. Each column has unit norm, so no entry can exceed in modulus. This is a useful sanity check on hand-constructed direction cosine matrices, and it is part of the reason such matrices are numerically benign.
Is every matrix with determinant orthogonal?
No, and the converse direction is the only valid one. Every orthogonal matrix has determinant of modulus one, but the shear has determinant and is not orthogonal — it changes lengths. Determinant is a single scalar condition; orthogonality is of them.
Why do numerical algorithms favour orthogonal transformations?
Because their condition number is exactly one, so they cannot amplify an existing error. Any algorithm built from a sequence of orthogonal transformations inherits that property, which is why QR factorisation and the singular value decomposition are the tools of choice when a problem is ill-conditioned.
How do I repair a matrix that has drifted from orthogonality?
Compute the polar decomposition and keep its orthogonal factor, which is the nearest orthogonal matrix in the Frobenius norm; it can be obtained from a singular value decomposition or by a short Newton iteration. Modified Gram-Schmidt on the columns is a cheaper alternative that treats the columns asymmetrically.
Do orthogonal matrices of a given size form a group?
Yes. The product of two is orthogonal, the identity is orthogonal, and every orthogonal matrix has an orthogonal inverse, namely its adjoint. The group is non-commutative for ; the permutation matrices form a finite subgroup of order inside it.
References
- Beezer, R. A. A First Course in Linear Algebra, Version 0.70. University of Puget Sound, 2006. Section MINSM, Subsection OM. Licensed under the GNU Free Documentation License v1.2.
- ISO 80000-2:2019, Quantities and units — Part 2: Mathematics. International Organization for Standardization.
- Horn, R. A. and Johnson, C. R. Matrix Analysis, 2nd edition. Cambridge University Press, 2012.
- Golub, G. H. and Van Loan, C. F. Matrix Computations, 4th edition. Johns Hopkins University Press, 2013.
- Higham, N. J. Functions of Matrices: Theory and Computation. Society for Industrial and Applied Mathematics, 2008.
- Anderson, E. et al. LAPACK Users' Guide, 3rd edition. Society for Industrial and Applied Mathematics, 1999.
AI Suggested Questions
- Construct a real orthogonal matrix that is not a permutation matrix, and verify its determinant is .
- Show how a Householder reflection is built from a single vector and prove that it is orthogonal and symmetric.
- Explain why the polar decomposition gives the nearest orthogonal matrix to a drifted rotation, and how to compute it.
- Compare the drift behaviour of a direction cosine matrix against a unit quaternion over a long attitude integration.
- Derive Parseval's relation for the unitary discrete Fourier transform directly from the norm-preservation property.
- Why is the condition number of an orthogonal matrix exactly one, and how does that propagate through a QR-based least-squares solver?
Related Calculators
Test whether a square matrix satisfies , reporting column norms, pairwise inner products and the determinant.
Gram-Schmidt CalculatorTurn an independent set into an orthonormal one and assemble the resulting orthogonal matrix.
Rotation Matrix ToolConvert between direction cosine matrices, axis-angle form and unit quaternions, with an orthogonality residual for each.
