Ray Transfer Matrices (ABCD Formalism)
Trace a ray through a camera zoom — a dozen elements, a dozen glass-air interfaces, several air gaps — and the surface-by-surface bookkeeping becomes punishing. The ray-transfer, or ABCD, formalism collapses the whole calculation into a single matrix multiplication. Its premise is the paraxial approximation, in which and Snell's law linearises to . Under that approximation a paraxial ray is described completely by two numbers at any reference plane — its height above the axis and its slope — and every optical element transforms linearly. A linear transformation of two numbers is a matrix, and the entire optics of the element lives in its four entries . The power is compositional. Because each element is a linear map, a train of elements is the ordered product of their matrices, and tracing a ray through an arbitrarily complicated system reduces to one matrix multiply. More than that, the structure of the system reads straight off the product: the condition marks a pair of conjugate (imaging) planes with magnification ; marks an afocal, telescopic system; the effective focal length is and the principal planes follow from and . The zeros of the matrix are the geometry of the instrument. Historically these same results were obtained one surface at a time, through refraction at a spherical surface and the thin-lens equation. The matrix method organises that surface-by-surface labour into a single algebra, generalises without effort to thick lenses and multi-element systems, and makes the paraxial invariant manifest as the determinant . The very same matrices later propagate Gaussian laser beams and set optical-resonator stability — so the ABCD algebra is the shared paraxial language of classical imaging, laser physics, and beam delivery.
- A paraxial ray at any plane is two numbers, height and slope ; each element acts on as a matrix .
- The building blocks are free propagation , the thin lens , refraction at a curved surface, and the mirror; any system is their ordered product.
- Systems compose by multiplying matrices in reverse order of encounter: , first element rightmost.
- The determinant (equal to in a single medium) is the paraxial Smith–Helmholtz invariant — conservation of étendue.
- is the imaging condition, with transverse magnification ; is the power; is afocal (telescopic).
- The same ABCD matrix propagates a Gaussian beam's complex parameter and sets laser-cavity stability, so ray and beam optics share one algebra.
- Key idea: represent a paraxial ray by , let every element be a matrix, and cascade by multiplying in reverse order; imaging (), focusing, and beam propagation all become matrix algebra.
Represent a paraxial ray by the column ; every optical element is a ray-transfer matrix acting on it; a system is the ordered product of its element matrices, first element rightmost. The imaging condition (magnification ), the power , and the invariant are then read directly off the four elements.
Where this lives today
The ABCD algebra is the daily workhorse of optical engineering. Lens and telescope design lays out a multi-element system by cascading matrices; the composite immediately give the effective focal length (), the principal-plane locations, and the back focal distance without tracing individual surfaces, and setting designs afocal beam expanders and telescopes of angular magnification . Thick lenses are handled by inserting a reduced-thickness translation between the two surface matrices — the same product that locates their principal planes. And through a single bridge, the identical matrix reaches into wave optics: a Gaussian beam's complex parameter transforms by , so the same that images a ray also propagates a laser beam's waist and divergence, and the eigenvalues of a round-trip matrix set a cavity's stability — the treatments developed by name in the laser-cavity article that reuses this formalism for Gaussian beams. From camera zooms to fibre mode-matching, the four numbers of the ray-transfer matrix are the shared language.
The physical picture
We keep the Hecht convention for the elements we build from: light left to right, converging, real conjugates . Think of the ray's two numbers as a position and a momentum: is where it crosses a reference plane, and (or the reduced angle ) is its transverse "momentum." Optical elements are then linear canonical transformations of this 2-D phase space, and (in reduced angles) is Liouville's theorem — paraxial optics conserves phase-space area, which optics calls étendue.
Free space shears the phase space: a ray keeps its slope while its height grows by , so the element is . A lens does the complementary shear: it keeps the height but kicks the slope by , so the element is . Every complex system is just a sequence of shears in the two directions of phase space — and reading a matrix like a chart, means all rays leaving a point arrive at a point (an image), while means parallel stays parallel (a telescope).
The core equations
A ray at a reference plane is a column, and each element acts on it. Context: the same two numbers carry through the whole system, transformed at each step by a matrix; stacking the steps is matrix multiplication.
where: — ray heights at input and output planes; — paraxial slopes (or reduced angles ); dimensionless, a length, an inverse length. The three workhorse elements are:
where: — propagation distance; — focal length ( converging); — indices before/after a surface of radius . Free space leaves the slope, grows the height; the lens leaves the height, kicks the slope; the surface does both. A spherical mirror is with . Systems compose by multiplying in the order light meets the elements — first encountered on the right. Context: applying means the first matrix touches the ray first, so it sits nearest the column.
where: — matrix of the -th element the ray meets. Reversing this order is the single most common bookkeeping error in the method. The determinant telescopes to a statement about the media, not the elements:
where: — indices of the input and output spaces. Each element contributes its own index ratio; intermediate indices cancel in the product, leaving . In a single medium — the paraxial Smith–Helmholtz invariant, i.e. conservation of étendue. Finally, the matrix elements label the system's geometry:
where: makes independent of (all rays from a point reach a point); is the transverse magnification there; is the system power; maps parallel bundles to parallel bundles. The same propagates a Gaussian beam's complex parameter by the bilinear law — the bridge to beam optics developed by name in the laser-cavity article.
This card builds the most-used element two ways, so that its single non-trivial entry is anchored both in the definition of focal length and in refraction at a spherical surface. The first route is a one-line geometric argument — a lens leaves height alone and adds a slope proportional to . The second composes the two surface-refraction matrices at zero separation and recovers the lensmaker's equation as the element, so the thin lens is exposed as two spherical surfaces stacked, exactly as the base optics of the lens demands.
Step 1. A thin lens has zero thickness, so a ray does not move transversely across it: , giving , . Why height is fixed: with no glass path the ray cannot drift sideways as it crosses the single plane.
Step 2. By definition of the focal length, a ray arriving parallel to the axis () at height must leave aimed at the focus a distance away, i.e. with slope . In general , so , : the thin-lens matrix. Why : the further off-axis the ray, the harder the lens bends it toward the axis — linearly, in the paraxial regime.
Step 3. Now derive from optics. Model the lens as surface 1 (air→glass, ) and surface 2 (glass→air, ) at zero separation, using with the right indices. The product has upper triangle and . Why the diagonal returns to : input and output media are both air, so and no net angular magnification survives.
Step 4. Identifying gives — the lensmaker's equation, now a corollary of matrix multiplication. Why this matters: it certifies the abstract thin-lens matrix against the concrete two-surface physics, and it is the template for building a thick lens by inserting a translation between the two surfaces. *Verified in verify_ray-transfer-matrices.py: a parallel ray through leaves with slope ; the two-surface product gives with and diagonal .*
Go deeper · Derivation B · 1 minThe imaging condition B = 0 and the magnification A
This is the owned headline of the method: the entire content of the thin-lens (Gaussian) imaging law is a single zero of a matrix element. We assemble the object–lens–image system matrix from three factors, then impose and watch the conjugate equation appear, with the transverse magnification handed over for free as the surviving element . It is the cleanest statement of why an image forms — because there is a plane where the output height stops depending on the input angle.
Step 1. Trace from an object plane a distance before the lens to an image plane after it: , with the first free space (object to lens) rightmost. Why this order: the ray first crosses the object-to-lens gap, so its matrix is applied first — it sits nearest the ray column.
Step 2. Multiplying out, . The element controls whether an image forms. Why is the deciding element: , so depends on the launch angle unless .
Step 3. Impose : , i.e. — the conjugate equation. All rays leaving one object point, whatever their angle, land on one image point. Why is imaging: it removes the dependence of , which is precisely the definition of a stigmatic image.
Step 4. With imaging enforced, simplifies (using the conjugate relation) to , the transverse magnification; and is the power, while gives the angular magnification . Why the elements carry the physics: the four numbers of the product ARE the imaging law — magnification, power, and invariant, all at once. *Verified in verify_ray-transfer-matrices.py: the sympy product gives and ; yields and ; the case , gives () and .*
Limiting cases
| Case | Matrix condition | Meaning |
|---|---|---|
| Imaging (conjugate planes) | , | output height independent of input angle — a stigmatic image, magnification |
| Afocal / telescopic | , angular mag | parallel in ⇒ parallel out; a telescope or beam expander, lateral mag |
| Input focal plane | , | the input plane is the front focal plane; rays of common angle converge to a point |
| Output focal plane | , | the output plane is the back focal plane |
| Single medium | étendue conserved (Smith–Helmholtz); reduced angles keep across index jumps |
Worked examples
1 · A single lens by matrix multiplication (the imaging check)
A thin lens of has an object in front. Use the ABCD product to locate the image and its magnification.
Step 1. System matrix . Its element is .
Step 2. Impose imaging: . This is exactly .
Step 3. Magnification is the surviving element : inverted, twice size. Equivalently .
Step 4. Check the invariant: . Both media are air, so , and the angular magnification is — the ray cone steepens by two, as it must for a doubled image.
2 · Two lenses: effective focal length of a compound system
Two thin lenses, and , are separated by in air. Find the effective focal length from the system matrix.
Step 1. , first lens rightmost. Multiply the three matrices.
Step 2. The lower-left element is .
Step 3. The effective focal length is — the pair is more powerful than either lens alone, exactly Gullstrand's result.
Step 4. The principal planes come from and : with and , the back plane sits at before lens 2. One matrix product has delivered focal length and both cardinal planes without tracing a single surface by hand.
Physics of the portrait
The protagonist here is a mathematical object — the ray-transfer matrix — and its deep identity is that of a linear canonical transformation. That is why the same four numbers govern rays, Gaussian beams, and even the quantum harmonic oscillator's phase space: they are all linear maps that preserve area.
Origins · 1 minray transfer matrix and how this was discovered
The ray-transfer matrix is the statement that paraxial optics is linear algebra. Carry a ray as the column — a point in a two-dimensional phase space of position and reduced angle — and every optical element is a linear map with unit determinant: a shear (free space), a shear in the other direction (a lens), or a boundary rescaling (a refracting surface). Unit determinant is Liouville's theorem: the phase-space area a bundle of rays occupies, its étendue, is conserved through any lossless system. This is the same structure that governs the linear canonical transformations of classical mechanics and the propagation of Gaussian beams, where the identical matrix advances the complex beam parameter by a Möbius transformation. So "ray transfer matrix" names not just a computational trick but the recognition that imaging, focusing, telescoping, and beam delivery are one algebra — the linear, area-preserving maps of a two-dimensional phase space — with the geometry of any instrument encoded in four numbers.
Going further
Texts. Hecht, Optics, 5th ed., §6.2 (matrix methods in paraxial optics) · Saleh & Teich, Fundamentals of Photonics, 3rd ed., Ch. 1 (ray optics) and Ch. 3 (Gaussian beams, the ABCD law) · Born & Wolf, Principles of Optics, §4.6 (matrix treatment) · Kogelnik & Li, "Laser Beams and Resonators," Appl. Opt. 5, 1550 (1966).
Provenance. All element matrices are standard (Hecht §6.2; Saleh & Teich Ch. 1). verify_ray-transfer-matrices.py reproduces: the free/lens/refraction/mirror matrices with ; the thin-lens slope kick ; the two-surface product giving ; the object–lens–image product with , , and , ; the real case , , ; and the two-lens effective focal length . The Gaussian-beam ABCD law and resonator-stability condition are recalled by name from the laser-cavity article (Kogelnik & Li 1966), where they are developed in full — this article owns the ray matrices.
Builds on: Ray Model of Light · Snell's Law of Refraction · Refraction at a Spherical Surface · Thin Lens Equation and Lensmaker's Equation. Leads to: Thick Lenses and Principal Planes · Image Formation and Magnification · Plane and Spherical Mirrors.
Why represent a ray by height AND slope — isn't one number enough?
No — a ray at a plane needs both where it is and where it is going, because optics changes those two things differently. Free space leaves the slope alone but moves the height; a lens leaves the height alone but changes the slope. With only one number you could not distinguish a ray that is high and level from one that is low and climbing, yet they end up in completely different places. The pair is the minimal complete description of a paraxial ray, and because every element transforms the pair linearly, that description is exactly what a matrix acts on. Two numbers in, two numbers out, one matrix between — that is the whole method.
Where does the imaging condition B = 0 actually come from?
From the output equation . An image forms when every ray leaving a single object point — that is, every ray with the same but different launch angles — arrives at a single output height . That happens if and only if does not depend on , which requires the coefficient of to vanish: . Then for all rays from the point, so is exactly the ratio of image height to object height — the magnification. The zeros of the matrix are the geometry: images, collimates, marks a front focal plane.
Why is the first element written on the right of the product?
Because matrices act on the ray from the left, in the order they are applied. The first element the ray meets transforms the initial column first: . The second acts on that result: . Continuing, , so — the first element encountered — ends up rightmost, nearest the ray column. Writing the product in physical left-to-right order instead would trace the system backwards. It feels counterintuitive, so it is the classic first mistake; when in doubt, apply the matrices to a test ray one at a time and watch which one touches it first.
What does det M = n_in/n_out mean physically?
It is the paraxial conservation of étendue — optical throughput. Each element's determinant equals its own index ratio ( for free space and a thin lens, for a surface), and in a product the intermediate indices cancel, leaving . If you carry reduced angles instead of bare angles, every determinant becomes and the statement reads — Liouville's theorem for the ray phase space. The content is the Smith–Helmholtz (Lagrange) invariant: you cannot shrink a beam's size without steepening its angles in compensation, so no passive optical system can increase brightness. It is the ray-optics ancestor of the second law's constraint on radiative concentration.
How can the same matrix handle a geometric ray and a Gaussian laser beam?
Because both are governed by the paraxial (parabolic) wave equation, which preserves the same linear-canonical structure. A ray transforms as ; a Gaussian beam is summarised by a single complex number , where packs the wavefront radius and spot size , and it transforms by the bilinear (Möbius) law with the same . So one matrix propagates a laser waist through lenses and gaps, and the eigenvalues of a round-trip matrix decide whether a cavity is stable. This article owns the ray matrices; the beam and resonator applications are carried by the laser-cavity article that reuses them.
Do I still need the thin-lens and single-surface equations if I have matrices?
They are not separate physics — the matrices contain them. The lensmaker's equation is the element of the two-surface product; the thin-lens conjugate relation is the condition of the object–lens–image product; the single-surface relation is the refraction matrix itself. What the matrix method adds is organisation: instead of chaining several -type equations by hand and tracking signs at each surface, you multiply matrices and read the answers off the four elements. For one or two surfaces the closed-form equations are quicker; for a ten-element zoom the matrix product is the only sane route, which is why every lens-design program is built on it.