When light encounters a spherical boundary between two media, we can analyze its path using Snell’s law and geometric considerations as shown below:
Figure 1— Refraction at a curved surface.
To determine how an image forms, we need to find where rays originating from a point at distance \(a\) from the surface will converge after refraction. Using Snell’s law for a ray hitting the surface at angle \(\alpha+\theta_1\):
This linear relationship between input (\(y\), \(\theta_1\)) and output (\(y\),\(\theta_2\)) parameters is a hallmark of paraxial optics and a result of the linearization of Snells law.
Matrix Optics
The linear relation between input and output parameters allows us to express optical elements as linear transformations (matrices). This approach forms the foundation of matrix optics. For a lens, the matrix representation is:
This 2×2 matrix is called the ABCD matrix of the lens. Thanks to the linearization of Snell’s law, we can generalize this to any optical element:
\[\begin{pmatrix} y_2 \\
\theta_2 \end{pmatrix} = \begin{pmatrix} A & B \\ C & D \end{pmatrix} \begin{pmatrix} y_1 \\ \theta_1 \end{pmatrix}\]
Each element in the ABCD matrix has a specific physical meaning:
Matrix Element
Physical Meaning
A
Magnification - relates output position to input position
B
Position-to-angle conversion - relates output position to input angle
C
Focusing power - relates output angle to input position
D
Angular magnification - relates output angle to input angle
Every optical element can be characterized by these parameters. For example, a lens has C = -1/f (focusing power), while free space has B = d (position-dependent angle change). An important property is that the determinant of the matrix equals the ratio of refractive indices: det(M) = n₁/n₂, which equals 1 in a single medium.
Here are the ABCD matrices for common optical elements:
\[
\mathbf{M}=\begin{bmatrix}
A & B\\
C & D
\end{bmatrix} =\left[\begin{array}{ll}
1 & d \\
0 & 1
\end{array}\right] \tag{Free space}
\]
A ray entering the first optical element at a height \(y_1\) at an angle \(\theta_1\) is transformed according to the matrix \(\mathbf{M}\) by the whole system. This elegant approach provides a powerful tool for analyzing complex optical systems efficiently.
Example: Optical Cloaking with Lens Systems
Optical cloaking refers to making objects “invisible” by guiding light rays around them such that to an observer, it appears as if the rays traveled through free space without encountering any object. Using matrix optics, we can design such a system.
Figure 2— Example of a practical paraxial cloak. (a)–(c) A hand is cloaked for varying directions, while the background image is transmitted properly.(d) On-axis view of the ray optics cloaking device. (e) Setup using practical, easy to obtain optics, for demonstrating paraxial cloaking principles. (Photos by J. Adam Fenster, videos by Matthew Mann / University of Rochester) Source
For perfect optical cloaking, the ABCD matrix of our system must be equivalent to that of free space:
Since both magnification (\(A\)) and angular magnification (\(D\)) cannot simultaneously equal 1 while maintaining \(\det(\mathbf{M}) = 1\), two lenses are insufficient.
3. Three-Lens Configuration
With three lenses, we have more parameters but still need to determine if we can satisfy all constraints simultaneously. For a three-lens system with focal lengths \(f_1\), \(f_2\), and \(f_3\), separated by distances \(d_{12}\) and \(d_{23}\), the system matrix would be:
Substituting this into the condition for C = 0, we obtain a complex expression that places constraints on the possible values of \(f_1\), \(f_2\), and \(f_3\). For typical lens configurations, this results in values that are difficult to realize physically, as it often requires either negative separations or negative focal lengths.
While the three-lens system provides more parameters to work with than the two-lens system, the mathematical constraints of simultaneously achieving zero focusing power (C = 0) and unit magnification (A = 1) still make perfect cloaking challenging with conventional optical elements.
4. Four-Lens Configuration: The Solution
We can arrange four lenses in two pairs:
First pair (lenses 1 and 2): A beam compressor
Second pair (lenses 3 and 4): A beam expander
For the beam compressor, with lenses at their combined focal length apart:
Which perfectly mimics free space propagation, creating the optical cloaking effect.
Code
# Example of optical cloaking with four lenses using raytracingfrom raytracing import*# Define focal lengths (in mm)f1 =200f2 =75f3 = f2 # f3 = f2 = 75f4 = f1 # f4 = f1 = 200# Create an optical pathpath = ImagingPath()# Add the four lenses with proper spacingpath.append(Space(d=100)) # Initial space before first lenspath.append(Lens(f=f1, label=f"f₁={f1}mm"))path.append(Space(d=f1+f2)) # Distance between lens 1 and 2path.append(Lens(f=f2, label=f"f₂={f2}mm"))path.append(Space(d=100)) # Distance between lens pairs (d₀)path.append(Lens(f=f3, label=f"f₃={f3}mm"))path.append(Space(d=f3+f4)) # Distance between lens 3 and 4path.append(Lens(f=f4, label=f"f₄={f4}mm"))path.append(Space(d=100)) # Final space after last lens# Display the ray path with custom figure sizepath.display(raysList=[ [Ray(y=5, theta=0)], [Ray(y=-5, theta=0)]], interactive=False)
BeginnerHint [in figure.py]: Infinite field of view: cannot use limitObjectToFieldOfView=True. The object height is instead set to the default value of 10.0.
BeginnerHint [in imagingpath.py]: Field of view is infinite. You can pass useObject=True to use the finite objectHeight.
BeginnerHint [in figure.py]: No aperture stop in the system: cannot use onlyPrincipalAndAxialRays=True since they are not defined. Showing the default ObjectRays instead.
Multifocal Imaging
We would like to explore the concept of multifocal imaging to obtain 3D resolution from a single image. In a microscope, an objective lens together with a tube lens is used to focus light from a sample onto a detector. Either the tube lens is no modified to shift the focal plane of the objective lens or one uses multiple tube lenses with different focal lengths with a single objective lens.
Figure 3— The multifocal adapter. (a) Composition of the multifocal imaging setup. The multifocal adapter (MFA) is inserted into the light path between a standard dark-field microscope and a camera. (b) Composition of the multifocal adapter. Incoming light from the microscope is infinity projected by the lens f1 and split by three consecutive beam-splitters (b1 = 25/75; b2 = 33/67; b3 = 50/50). Five mirrors (m) guide the light into four separate optical paths. The lens f5 projects the four images onto the camera chip. The inter-plane distance is set by lenses of different focal length (f1 - f4). (c, d) Experimentally acquired (c) and simulated (d) (see Methods) multifocal dark-field images (planes 1 - 4, 20x objective) of a calibration grid at the four focal positions (indicated on the left side), where one of the four focal planes maps the grid sharply. Scale bar represents 20 µm. Experiment was performed six times with similar results. Source
In the simplest configuration of an objective lens and a tube lens, the light first travels from the object to the objective lens in free space for a distance \(s\), which is represented by
where \(\Delta_ft\) is a parameter modifying the original tube lens focal distance \(f_t\). Finally, the light will propagate to the detector at distance \(f_t\) from the tube lens
The final matrix has again 4 parameters \(A,B,C\) and \(D\). For sharp imaging the parameter \(B\) of the system must be equal to zero, as the outgoing light should be independent of the incoming angle. This is achieved
\[\delta s=\frac{f_{1} \left(\Delta_{ft} d + \Delta_{ft} f_{t} + f_{t}^{2}\right)}{\Delta_{ft} d - \Delta_{ft} f_{1} + \Delta_{ft} f_{t} + f_{t}^{2}}-s_0
\]
Figure 4— Plot of the solution with specific parameter values
The B Parameter
The B parameter is the most direct indicator of a sharp image in matrix optics. For an optical system with ABCD matrix: \[
\begin{pmatrix} y_2 \\ \theta_2 \end{pmatrix} =
\begin{pmatrix} A & B \\ C & D \end{pmatrix}
\begin{pmatrix} y_1 \\ \theta_1 \end{pmatrix}
\]
The output position is given by: \[y_2 = Ay_1 + B\theta_1\]
For an image to be sharp, all rays originating from the same object point must converge to a single image point, regardless of their initial angles. This means that for a given \(y_1\) (object position), the final position \(y_2\) must be independent of the initial angle \(\theta_1\).
This condition is satisfied when B = 0.
When B = 0: - The final position depends only on the initial position (\(y_2 = Ay_1\)) - All rays from a point source converge to a single point in the image plane - The imaging is “stigmatic” (point-to-point mapping)
In our lens example, the system matrix was: \[
\mathbf{M}_{system} =
\left[\begin{array}{cc}
1-\frac{d}{f} & d \\
-\frac{1}{f} & 1
\end{array}\right]
\]
For parallel input rays (different \(y_1\) but all \(\theta_1 = 0\)), we needed A = 0 to make them all converge to a single point, which happened when d = f.
But for general imaging of points (not just parallel rays), the B = 0 condition is what determines whether the image is sharp. This is why, in optical design, finding conjugate planes (where B = 0) is essential for sharp imaging.