AI Glossary / Mathematics and optimization / Intermediate
Unitary matrix
Definition
A unitary matrix is a square complex-valued matrix whose conjugate transpose is its inverse. If U is unitary, UᴴU = UUᴴ = I, where Uᴴ means transpose and complex conjugation, and I is the identity matrix. A unitary transformation preserves the standard complex inner product and Euclidean length, although it can change the individual coordinates of a vector.
What it means
Complex numbers have real and imaginary parts. Conjugation changes the sign of the imaginary part, so the conjugate of a+bi is a−bi. The conjugate transpose first exchanges rows and columns and conjugates their entries.
Unitary matrices provide a way to transform coordinates without stretching lengths. Their columns form an orthonormal basis: each has length 1, and distinct columns have zero complex inner product. Their rows have the corresponding property as well.
For real-valued matrices, conjugation changes nothing, and unitary becomes the familiar orthogonal-matrix condition. The general complex case needs conjugation; an ordinary transpose is insufficient.
How it works
Check that the matrix is square, form its conjugate transpose, and multiply. The defining product must equal the identity in exact mathematics. Numerical checks use a suitable tolerance and examine how close the product is to I.
For any vector x, the squared length after transformation is (Ux)ᴴ(Ux) = xᴴUᴴUx = xᴴx. This calculation explains length preservation. The same identity preserves inner products between different vectors and therefore distances between them.
The transformation is reversible by applying Uᴴ. Reversibility and length preservation concern the complete mathematical transformation. If a later step drops coordinates, rounds values, or changes the representation, the whole processing pipeline may no longer preserve information or length.
Three practical examples
- A signal-processing method can use a properly normalized Fourier transform to change representation while preserving the standard sum of squared magnitudes.
- A complex-valued numerical calculation can use unitary changes of basis to simplify a matrix problem without stretching vector lengths.
- An ideal quantum-computing model can represent a closed-system state transformation with a unitary matrix; measurement and other physical processes require additional descriptions.
Think of it this way
Think of reorganizing a perfectly measured collection of arrows by a reversible coordinate change that preserves their lengths and mutual angles. The numbers used to describe each arrow change, but their geometric relationships remain. In complex spaces this is an algebraic analogy: the transformation need not look like an ordinary rotation of a sheet of paper.
Worked example
Let i denote the imaginary unit, with i squared equal to −1. Define U = (1/sqrt(2)) times the matrix with rows [1,i] and [i,1]. Its conjugate transpose is (1/sqrt(2)) times rows [1,−i] and [−i,1].
In UᴴU, the top-left entry is (1+(−i)i)/2 = (1+1)/2 = 1. The top-right entry is (i−i)/2 = 0. The remaining entries similarly give 0 and 1, so the product is I.
Apply U to x = [1,0]. The output is [1/sqrt(2), i/sqrt(2)]. Its squared length is 1/2+1/2=1, matching the input. Applying Uᴴ restores [1,0].
Now observe that U is equal to its ordinary transpose, but U squared has rows [0,i] and [i,0], which is not I. Thus Uᵀ is not its inverse, despite the matrix being unitary.
For another check, input [1,i] has squared length 2. Its output is [0,sqrt(2)i], also with squared length 2. Individual coordinate magnitudes changed even though total squared length did not.
Illustrative case study
In a fictional audio-analysis project, a team changes its Fourier-transform normalization while comparing signal energy before and after transformation. An unexplained scaling difference appears in the report.
The team writes down the transform convention and checks it on a tiny example. It distinguishes an unscaled transform from the unitary normalization and makes the energy comparison use consistent scaling.
The lesson is that a transform's familiar name does not determine its normalization. The fictional scenario does not imply every software Fourier transform defaults to a unitary convention or that numerical roundoff is the only possible source of disagreement.
Common misconceptions and mistakes
Do not confuse unitary with every entry having magnitude 1. The entries in the worked example have magnitude 1/sqrt(2), while its columns have unit length.
Do not omit complex conjugation when forming the inverse. Also, a rectangular matrix with orthonormal columns satisfies UᴴU=I on its input dimension, but it is not a square unitary matrix; generally UUᴴ is a projection rather than the identity on the larger output space.
Do not assume a unitary transform makes a vector sparse or improves a predictive model. Those are separate properties. Nor does it preserve each coordinate's magnitude: it preserves the combined Euclidean geometry.
Business use
The practical benefit is a well-controlled representation change. When a system uses unitary transforms, check its dimension, normalization, numerical precision, and treatment of discarded components.
For a proposed compression workflow, distinguish the reversible transform from the irreversible truncation that follows. For a model pipeline, evaluate the actual task rather than inferring better predictions from length preservation. Unitarity is an algebraic property with useful consequences, not a general business-quality rating.
People also ask
Is every unitary matrix invertible?
Yes. Its inverse is its conjugate transpose.
Can a real matrix be unitary?
Yes. A real unitary matrix is called orthogonal.
Does a unitary matrix change vector length?
Not in the exact standard Euclidean norm. Finite-precision calculations may introduce small discrepancies, and subsequent processing may change the result.
Check your understanding
Is the 1-by-1 matrix [i] unitary, and what is its inverse?
Answer: Yes. Its conjugate transpose is [−i], and (−i)i=1. Its inverse is therefore [−i], not [i].
Related terms
- Conjugate transpose
- Inner product
- Inverse matrix
- Fourier transform
- Norm
- Complex number
- orthogonal matrix
- orthonormal basis
- quantum gate
Learn next
Multiply both UᴴU and UUᴴ for the worked example, retaining the conjugation signs. Then compare a real rotation matrix with a complex unitary matrix. Study Fourier normalization before using an energy-preservation identity in signal-processing calculations.
More in Mathematics and optimization
- Absolute error loss - Absolute error loss measures a numerical prediction's error as the absolute difference between its predicted and reference values: L(y,y-hat)=|y-y-hat|.
- Active-set method - An active-set method is an optimization approach that works with a changing subset of constraints believed to be tight at the solution.
- Adjoint state method - The adjoint state method computes how a chosen objective changes when the parameters of a mathematical model change.
- Σ-algebra
- Algebraic connectivity - Algebraic connectivity is the second-smallest eigenvalue of a graph's Laplacian matrix.
- Algorithm IMED - Algorithm IMED, short for Indexed Minimum Empirical Divergence, is a method for choosing actions in a stochastic multi-armed bandit problem.
Sources
Aalto Dictionary of Machine Learning, unitary matrix entry: conjugate-transpose inverse and orthonormal-basis characterization. https://aaltodictionaryofml.github.io/ADictML_Main.pdf
Previous: Unit-weighted regression Next: Units function