How Do I …?#
A task-shaped index. The example gallery is organized by Optiland feature; this page is organized by what you are trying to do. Find your question, follow the link, copy the pattern.
New to Optiland? Read Conventions first — it explains the surface-sequential
model, the “after” rule for thickness and material, sign conventions, and units.
Most “why doesn’t this work?” questions are answered there.
Tip
Stuck on an error rather than a task? Call
optiland.diagnostics.check_system(lens). It reports missing wavelengths,
apertures, stops, and fields, each with a runnable fix. See
System Diagnostics Demo.
Build a system#
How do I … |
Where to look |
|---|---|
build my first lens from scratch? |
|
see a whole design carried from requirements to prescription? |
|
build a simple singlet? |
|
build a cemented doublet? |
|
build a Cooke triplet? |
|
build a Petzval, Tessar, Heliar, or telephoto lens? |
|
build a double Gauss objective? |
|
add an aspheric surface? |
|
define a mirror? |
|
build a two-mirror telescope? |
|
build a three-mirror anastigmat? |
|
use an off-axis parabola? |
|
build a cylindrical (anamorphic) lens? |
|
lay out a system paraxially before choosing glass? |
|
turn an ideal thin lens into a real thick lens? |
|
build a zoom or multi-configuration system? |
|
use off-the-shelf catalog lenses? |
|
combine two existing lenses into one system? |
|
tilt or decenter a surface? |
|
add a fold mirror? |
|
build a freeform surface (Chebyshev, polynomial, Forbes, NURBS)? |
Chebyshev Polynomial, Polynomial Freeform, Forbes Surfaces: Aspheres and Freeforms, NURBS - Parabolic Mirror |
model a diffraction grating? |
|
design a spectrometer? |
Folded Czerny-Turner Spectrometer, Littrow Spectrometer, Dyson Imaging Spectrometer |
model the human eye? |
|
pick a material, or use a specific glass catalog? |
|
design an infrared or lithographic system? |
Constrain a system#
How do I … |
Where to look |
|---|---|
set the aperture stop? |
|
choose between EPD, f/#, and object-space NA? |
|
let the aperture float with the stop diameter? |
|
set my own semi-diameters instead of the computed ones? |
|
add a physical (clear) aperture to a surface? |
|
apodize the pupil? |
|
specify fields as angles vs. object height? |
|
specify fields as paraxial or real image height? |
Field Type: Paraxial Image Height, Field Type: Real Image Height |
make a system telecentric? |
|
fix rays that miss the stop in a wide-angle system? |
|
tie one surface parameter to another (pickups and solves)? |
Analyze a system#
How do I … |
Where to look |
|---|---|
get EFL, BFL, f/#, and the pupil positions? |
|
print a surface-by-surface prescription? |
|
plot a spot diagram? |
|
plot RMS spot size vs. field? |
|
see how the spot changes through focus? |
|
plot transverse ray-aberration (ray fan) curves? |
|
plot field curvature and distortion? |
|
plot a grid-distortion map? |
|
compute encircled energy? |
|
plot the wavefront error (OPD fan or OPD map)? |
Optical Path Difference (OPD) Fan, Optical Path Difference (OPD) Map |
plot RMS wavefront error vs. field? |
|
decompose the wavefront into Zernike coefficients? |
|
compute the PSF? |
|
compute the MTF at a given spatial frequency? |
|
plot MTF vs. field, or through focus? |
|
compute Seidel and chromatic aberration coefficients? |
|
trace rays myself and inspect the intersection coordinates? |
|
run a Monte Carlo (random-ray) trace? |
|
draw a y-ybar diagram? |
|
simulate the image of a scene through my lens? |
|
compute irradiance on a surface? |
|
inspect pupil aberration? |
|
inspect surface sag? |
|
find out why my system will not trace? |
Optimize a system#
How do I … |
Where to look |
|---|---|
vary a radius and minimize spot size? |
|
optimize against wavefront error instead of spot size? |
|
hold total track, edge thickness, or another constraint? |
|
escape a local minimum (global optimization)? |
Global Optimization (Differential Evolution), Global Optimization (Basin Hopping), Global Optimization (SHGO), Global Optimization (Particle Swarm) |
optimize aspheric coefficients? |
|
optimize a freeform surface? |
|
let the optimizer choose the glasses? |
|
add my own operand (merit function term)? |
|
scale variables so the optimizer behaves? |
Custom Variable Scaling, Example - Optimization Using Reciprocal Radii |
undo an optimization that made things worse? |
|
work through a full optimization case study? |
|
design a beam expander? |
|
use orthogonal descent? |
Tolerance a system#
How do I … |
Where to look |
|---|---|
find which parameters my performance is most sensitive to? |
|
estimate manufacturing yield with Monte Carlo? |
|
add a compensator (e.g. refocus) to the analysis? |
|
include surface roughness and scattering? |
Interoperate with other tools#
How do I … |
Where to look |
|---|---|
import a Zemax |
|
import a CODE V |
|
import an OSLO |
|
save and reload a system as JSON? |
|
export a prescription for a report? |
Coatings and polarization#
How do I … |
Where to look |
|---|---|
apply an anti-reflection or multilayer coating? |
|
trace polarized light? |
|
inspect the Jones pupil? |
|
optimize a thin-film stack? |
Differentiate and accelerate#
How do I … |
Where to look |
|---|---|
switch to the PyTorch backend (and to the GPU)? |
|
get gradients of a performance metric w.r.t. lens parameters? |
|
optimize a lens with autograd? |
|
put a lens inside a PyTorch training loop? |
Optiland Torch Module - RMS Spot Size, Optiland Torch Module - Custom Objective |
visualize the solution space of a design? |
|
use machine learning to predict or classify lens performance? |
Extend Optiland#
How do I … |
Where to look |
|---|---|
write a custom surface type? |
|
write a custom coating? |
|
write a custom optimization algorithm? |
|
write a custom operand? |
|
ship my extension as an installable plugin? |
|
understand Optiland’s internals before contributing? |
Visualize#
How do I … |
Where to look |
|---|---|
change the plot theme (including dark mode)? |
|
draw the system in 3D? |
|
model an extended (non-point) source? |
|
use the graphical interface instead of scripting? |
Not listed here?#
If your question is not answered above, it is worth telling us — a missing entry is a gap in the documentation, not a gap in your understanding. Please open an issue or start a discussion.