Search

Search papers and lessons

Unitary Operator

Level 2 · 12 min read

A unitary operator is a linear map that keeps every length and every angle unchanged, so it rotates or reflects space without stretching or losing anything.

On this page

  • Colour = topic mix
  • Linear algebra
  • Discrete math
  • Sign in to see your progress

TL;DR

A unitary operator is a linear transformation that preserves inner products. Because lengths and angles come from inner products, it keeps every length and every angle the same. Its matrix UU satisfies U†U=IU^\dagger U = I, so its inverse is simply its conjugate transpose. Real examples are rotations and reflections; the complex examples are the ones quantum mechanics uses.

Where you'll see it: in quantum computing, where every gate except a measurement is a unitary matrix, and in the orthogonal matrices behind numerically stable least-squares solvers.

Intuition

Rigid motions

Draw a square grid on a sheet of paper and then pick the sheet up. You can turn it, or flip it over, and the grid squares keep their size and shape. Now stretch the sheet or shear it, and the squares turn into parallelograms and change size. A unitary operator is the first kind of move: a rigid motion of the space, allowed to rotate the axes and flip them, but never to distort them.

Why the idea exists

Quantum mechanics needs this property. A quantum state is a vector of complex numbers, and the probabilities of measurement outcomes are the squared lengths of its components. Those probabilities must always add up to 1. A transformation that changes lengths would change the total probability, which is impossible for a closed system. So time evolution in quantum mechanics has to be unitary. The same idea gives a bonus: a unitary map never squashes two different inputs onto one output, so nothing is lost, and every unitary map can be undone.

The math

Definition

Definition: Unitary operator

A linear map UU on a complex vector space with inner product ⟨⋅,⋅⟩\langle \cdot, \cdot \rangle is unitary if

⟨Ux,Uy⟩=⟨x,y⟩for all vectors x,y.\langle Ux, Uy \rangle = \langle x, y \rangle \quad \text{for all vectors } x, y.

For a square matrix UU, this is equivalent to

U†U=I,U^\dagger U = I,

where U†U^\dagger is the conjugate transpose (flip rows and columns, then take the complex conjugate of each entry) and II is the identity matrix.

Here ⟨x,y⟩=x†y\langle x, y \rangle = x^\dagger y is the inner product, which for real vectors is the ordinary dot product. The definition says UU leaves all inner products alone.

To see the equivalence, write ⟨Ux,Uy⟩=(Ux)†(Uy)=x†U†Uy\langle Ux, Uy \rangle = (Ux)^\dagger (Uy) = x^\dagger U^\dagger U y. This equals x†yx^\dagger y for every xx and yy exactly when U†U=IU^\dagger U = I. Taking xx and yy to be standard basis vectors picks out each entry of U†UU^\dagger U, so the matrix identity is forced.

Consequences

Several useful facts follow directly from U†U=IU^\dagger U = I.

Lengths are preserved. Setting y=xy = x gives ∥Ux∥2=⟨Ux,Ux⟩=⟨x,x⟩=∥x∥2\|Ux\|^2 = \langle Ux, Ux \rangle = \langle x, x \rangle = \|x\|^2. Angles are preserved too, because the angle between xx and yy is defined from their inner product.

The inverse is the conjugate transpose. From U†U=IU^\dagger U = I we get U−1=U†U^{-1} = U^\dagger, and then UU†=IU U^\dagger = I as well. Inverting a unitary matrix costs nothing beyond flipping and conjugating.

The columns form an orthonormal basis. Let uj=Ueju_j = U e_j be column jj of UU. Then ⟨uj,uk⟩=δjk\langle u_j, u_k \rangle = \delta_{jk}, which says each column has length 1 and different columns are perpendicular.

Eigenvalues lie on the unit circle. Suppose Ux=λxUx = \lambda x with x≠0x \neq 0. Then ∥x∥=∥Ux∥=∣λ∣ ∥x∥\|x\| = \|Ux\| = |\lambda| \, \|x\|, so ∣λ∣=1|\lambda| = 1. Every eigenvalue has the form λ=eiφ\lambda = e^{i\varphi} for some angle φ\varphi. In particular, ∣det⁡U∣=1|\det U| = 1.

Real case. When UU has only real entries, the conjugate transpose is the ordinary transpose, and the condition becomes UTU=IU^T U = I. Such a matrix is called orthogonal.

Rotations

The 2D rotation by angle θ\theta is

Rθ=(cos⁡θ−sin⁡θsin⁡θcos⁡θ).R_\theta = \begin{pmatrix} \cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{pmatrix}.

Its columns are (cos⁡θ,sin⁡θ)(\cos\theta, \sin\theta) and (−sin⁡θ,cos⁡θ)(-\sin\theta, \cos\theta). Each has length cos⁡2θ+sin⁡2θ=1\sqrt{\cos^2\theta + \sin^2\theta} = 1, and their dot product is −cos⁡θsin⁡θ+sin⁡θcos⁡θ=0-\cos\theta\sin\theta + \sin\theta\cos\theta = 0. So RθTRθ=IR_\theta^T R_\theta = I for every angle, and rotations are orthogonal.

0123456−1−0.500.51θ (radians)entry value
  • cos θ (top-left entry)
  • sin θ (bottom-left entry)
The entries of the rotation matrix as the angle grows. At every θ, cos²θ + sin²θ = 1, which is why the columns have length 1.

Worked examples

Example
A rotation keeps lengths

Rotate the vector (3,4)(3, 4) by 90∘90^\circ using R=(0−110)R = \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix}.

  1. Length before: 32+42=25=5\sqrt{3^2 + 4^2} = \sqrt{25} = 5.
  2. Apply the matrix: first entry 0⋅3+(−1)⋅4=−40 \cdot 3 + (-1) \cdot 4 = -4, second entry 1⋅3+0⋅4=31 \cdot 3 + 0 \cdot 4 = 3. The result is (−4,3)(-4, 3).
  3. Length after: (−4)2+32=25=5\sqrt{(-4)^2 + 3^2} = \sqrt{25} = 5.
  4. Check the matrix: RTR=(01−10)(0−110)=(1001)R^T R = \begin{pmatrix} 0 & 1 \\ -1 & 0 \end{pmatrix} \begin{pmatrix} 0 & -1 \\ 1 & 0 \end{pmatrix} = \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}.

Interpretation: the vector turned a quarter circle around the origin and kept its length. The check in step 4 confirms this is no accident.

Example
A complex unitary and a non-unitary

Take U=12(1ii1)U = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & i \\ i & 1 \end{pmatrix}. Its conjugate transpose flips the sign of each ii: U†=12(1−i−i1)U^\dagger = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & -i \\ -i & 1 \end{pmatrix}.

  1. Multiply: U†U=12(1⋅1+(−i)(i)1⋅i+(−i)⋅1(−i)⋅1+1⋅i(−i)(i)+1⋅1)U^\dagger U = \frac{1}{2} \begin{pmatrix} 1 \cdot 1 + (-i)(i) & 1 \cdot i + (-i) \cdot 1 \\ (-i) \cdot 1 + 1 \cdot i & (-i)(i) + 1 \cdot 1 \end{pmatrix}.
  2. Use (−i)(i)=−i2=1(-i)(i) = -i^2 = 1. The off-diagonal terms are i−i=0i - i = 0, and the diagonal terms are 1+1=21 + 1 = 2.
  3. So U†U=12(2002)=IU^\dagger U = \frac{1}{2} \begin{pmatrix} 2 & 0 \\ 0 & 2 \end{pmatrix} = I. The matrix is unitary.
  4. Test on the unit vector (1,0)(1, 0): U(1,0)=12(1,i)U(1, 0) = \frac{1}{\sqrt{2}}(1, i). Its squared length is 12(1+1)=1\frac{1}{2}(1 + 1) = 1, as it should be.

Now the shear A=(1101)A = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}. It sends the unit vector (0,1)(0, 1) to (1,1)(1, 1), which has length 2\sqrt{2}. Also A†A=(1112)≠IA^\dagger A = \begin{pmatrix} 1 & 1 \\ 1 & 2 \end{pmatrix} \neq I. Lengths grow, so AA is not unitary.

Example
A quantum gate on a qubit

The Hadamard gate is H=12(111−1)H = \frac{1}{\sqrt{2}} \begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}. A qubit in state ∣0⟩=(1,0)|0\rangle = (1, 0) is a vector whose squared entries give measurement probabilities.

  1. Check that HH is unitary. HH is real and symmetric, so H†=HH^\dagger = H, and H2=12(2002)=IH^2 = \frac{1}{2}\begin{pmatrix} 2 & 0 \\ 0 & 2 \end{pmatrix} = I.
  2. Apply it: H∣0⟩=12(1,1)H|0\rangle = \frac{1}{\sqrt{2}}(1, 1).
  3. Probability of outcome 0 is (12)2=12\left(\frac{1}{\sqrt{2}}\right)^2 = \frac{1}{2}. Probability of outcome 1 is also 12\frac{1}{2}.
  4. The probabilities sum to 1. This is guaranteed because HH preserves length.

Interpretation: the gate created an equal superposition. Because HH is unitary, applying HH again returns the qubit to ∣0⟩|0\rangle exactly, with no information lost.

Tradeoffs and failure modes

Unitary matrices are the right tool when a transformation must be reversible and must keep total norm fixed. They are the wrong tool when information is supposed to leak away.

SituationWhat goes wrongBetter choice
Open quantum system that interacts with its environmentA unitary cannot model decoherence or loss; purity dropsDensity matrices and quantum channels (trace-preserving, not unitary)
Numerical simulation of a closed system over many stepsRounding errors slowly push U†UU^\dagger U away from IIUnitary integrators, or periodic re-orthogonalisation
Data reduction with a non-square matrix whose columns are orthonormalIt is an isometry, not unitary, and cannot be inverted on the full spaceSpeak of isometries, or use a projection
Least squares or eigenvalue computations in floating pointGaussian elimination can amplify errorsOrthogonal transformations (QR decomposition, Householder reflections), whose condition number is 1
Assuming "normalised" means "unitary"A matrix can keep every vector length fixed only if it is unitary; a scaled rotation does not qualifyCheck U†U=IU^\dagger U = I directly

A common mistake is to think unitarity only means "preserves length." In complex spaces it also preserves phases in the right sense: multiplying every entry of the state by a common phase eiφe^{i\varphi} is a unitary operation that changes no measurement probability. Two states that differ only by such a phase are physically the same.

History

The real case is old. Rotations and reflections of the plane and space were studied as geometric motions long before matrices were formalised in the 19th century, and their matrices were later called orthogonal.

The complex case grew out of algebra over complex numbers in the 19th century. Charles Hermite studied the complex analogue of symmetric forms in the 1850s, the same family of ideas that produced Hermitian matrices. Unitary matrices became a standard object in the 20th century through the study of group representations and, above all, quantum mechanics.

The idea became central to physics in 1932, when John von Neumann's book on the mathematical foundations of quantum mechanics made unitary time evolution a basic principle. Since then the same property, keeping total probability at 1, has been a guiding requirement for quantum algorithms.

Check yourself

QuestionName the two things a unitary operator preserves, and say how the matrix condition captures them.Show answer

It preserves inner products. Since lengths and angles are defined from inner products, it preserves both lengths and angles. The matrix condition is U†U=IU^\dagger U = I: for every xx, ∥Ux∥2=x†U†Ux=x†x=∥x∥2\|Ux\|^2 = x^\dagger U^\dagger U x = x^\dagger x = \|x\|^2, and the identity matrix makes the equality hold for all pairs of vectors, not only for a single length.

QuestionIs U=12(11−11)U = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ -1 & 1 \end{pmatrix} unitary? Show your computation.Show answer

Yes. UU is real, so U†=UT=12(1−111)U^\dagger = U^T = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & -1 \\ 1 & 1 \end{pmatrix}. Then UTU=12(1⋅1+(−1)(−1)1⋅1+(−1)⋅11⋅1+1⋅(−1)1⋅1+1⋅1)=12(2002)=IU^T U = \frac{1}{2}\begin{pmatrix} 1 \cdot 1 + (-1)(-1) & 1 \cdot 1 + (-1) \cdot 1 \\ 1 \cdot 1 + 1 \cdot (-1) & 1 \cdot 1 + 1 \cdot 1 \end{pmatrix} = \frac{1}{2}\begin{pmatrix} 2 & 0 \\ 0 & 2 \end{pmatrix} = I. It is in fact the rotation by −45∘-45^\circ.

QuestionWhy must every eigenvalue of a unitary matrix have absolute value 1?Show answer

Let Ux=λxUx = \lambda x with x≠0x \neq 0. Unitary maps preserve length, so ∥x∥=∥Ux∥=∥λx∥=∣λ∣ ∥x∥\|x\| = \|Ux\| = \|\lambda x\| = |\lambda| \, \|x\|. Dividing by ∥x∥>0\|x\| \gt 0 gives ∣λ∣=1|\lambda| = 1. So each eigenvalue is a point on the unit circle in the complex plane, of the form eiφe^{i\varphi}.

QuestionA simulation applies a numerical time-step matrix to a closed quantum system. After many steps the total probability has drifted from 1 to 0.97. What is the likely cause, and what would you do about it?Show answer

The matrix is no longer unitary to working precision, so it no longer preserves lengths. Rounding errors have accumulated over many steps and shrunk the state. The fix is to use a unitary integrator, which is built to preserve the norm exactly in the scheme, or to re-orthogonalise or renormalise the state periodically. Checking U†U−IU^\dagger U - I during the run shows how far the matrix has drifted.

Sources