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?

Tutorial 1a — Optiland for Beginners

see a whole design carried from requirements to prescription?

Tutorial 1e — Design a Doublet End to End

build a simple singlet?

Singlet Lens

build a cemented doublet?

Achromatic Doublet

build a Cooke triplet?

Cooke Triplet

build a Petzval, Tessar, Heliar, or telephoto lens?

Petzval Lens, Tessar Lens, Heliar Lens, Telephoto

build a double Gauss objective?

Double Gauss

add an aspheric surface?

Aspheric Singlet, Odd Asphere

define a mirror?

Parabolic Mirror

build a two-mirror telescope?

Cassegrain Telescope, Hubble Telescope

build a three-mirror anastigmat?

Tutorial 4f, Three Mirror Anastigmat

use an off-axis parabola?

Off-axis Parabola

build a cylindrical (anamorphic) lens?

Cylindrical Lens

lay out a system paraxially before choosing glass?

Paraxial Surfaces

turn an ideal thin lens into a real thick lens?

Paraxial to Thick Lens Conversion

build a zoom or multi-configuration system?

Tutorial 4c, Multi-Configuration Zoom Lens

use off-the-shelf catalog lenses?

Tutorial 4d, Cooke Triplet with Stock Lenses

combine two existing lenses into one system?

Merging Optics

tilt or decenter a surface?

Tutorial 4a

add a fold mirror?

F-theta Scan Lens with 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?

Linear Grating, Radial Phase

design a spectrometer?

Folded Czerny-Turner Spectrometer, Littrow Spectrometer, Dyson Imaging Spectrometer

model the human eye?

Subject-Specific Eye Model Example

pick a material, or use a specific glass catalog?

Tutorial 1c

design an infrared or lithographic system?

Infrared F/4, Tutorial 4e


Constrain a system#

How do I …

Where to look

set the aperture stop?

conventions — stop, aperture, and pupil

choose between EPD, f/#, and object-space NA?

Physical Aperture Demo

let the aperture float with the stop diameter?

Aperture: Float by Stop Size

set my own semi-diameters instead of the computed ones?

Specifying Lens Sizes

add a physical (clear) aperture to a surface?

Example of reading a Zemax file with circular aperture

apodize the pupil?

Apodization

specify fields as angles vs. object height?

conventions — field specification

specify fields as paraxial or real image height?

Field Type: Paraxial Image Height, Field Type: Real Image Height

make a system telecentric?

Telecentric f/2.8 Lens

fix rays that miss the stop in a wide-angle system?

Ray Aiming

tie one surface parameter to another (pickups and solves)?

Pickups


Analyze a system#

How do I …

Where to look

get EFL, BFL, f/#, and the pupil positions?

Tutorial 1b

print a surface-by-surface prescription?

Optical Prescription Report

plot a spot diagram?

Spot Diagram

plot RMS spot size vs. field?

RMS Spot Size versus Field

see how the spot changes through focus?

Through Focus Spot Diagram

plot transverse ray-aberration (ray fan) curves?

Ray Aberration Fan, Best Fit Ray Aberration Fan

plot field curvature and distortion?

Field Curvature, Distortion

plot a grid-distortion map?

Grid Distortion

compute encircled energy?

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?

RMS Wavefront Error versus Field

decompose the wavefront into Zernike coefficients?

Zernike Decomposition

compute the PSF?

FFT PSF - 2D, Huygens PSF - 2D

compute the MTF at a given spatial frequency?

FFT MTF, Geometric MTF, Huygens MTF

plot MTF vs. field, or through focus?

MTF versus Field, Through Focus MTF

compute Seidel and chromatic aberration coefficients?

Tutorial 2c

trace rays myself and inspect the intersection coordinates?

Tutorial 2a

run a Monte Carlo (random-ray) trace?

Tutorial 2b

draw a y-ybar diagram?

Y-Ybar

simulate the image of a scene through my lens?

Image Simulation

compute irradiance on a surface?

Incoherent Irradiance

inspect pupil aberration?

Pupil Aberration

inspect surface sag?

Surface Sag

find out why my system will not trace?

System Diagnostics Demo


Optimize a system#

How do I …

Where to look

vary a radius and minimize spot size?

Tutorial 3a, RMS Spot Size Optimization

optimize against wavefront error instead of spot size?

Wavefront Error Optimization

hold total track, edge thickness, or another constraint?

Constrained Optimization, Bounded Optimization Operands

escape a local minimum (global optimization)?

Global Optimization (Differential Evolution), Global Optimization (Basin Hopping), Global Optimization (SHGO), Global Optimization (Particle Swarm)

optimize aspheric coefficients?

Asphere Optimization

optimize a freeform surface?

Freeform Optimization

let the optimizer choose the glasses?

Tutorial 3e, Glass Expert Optimization Example

add my own operand (merit function term)?

Tutorial 3c

scale variables so the optimizer behaves?

Custom Variable Scaling, Example - Optimization Using Reciprocal Radii

undo an optimization that made things worse?

Undoing Optimization

work through a full optimization case study?

Tutorial 3d

design a beam expander?

Beam Expander Design

use orthogonal descent?

Orthogonal Descent Optimization


Tolerance a system#

How do I …

Where to look

find which parameters my performance is most sensitive to?

Tutorial 6a, Tolerancing - Sensitivity Study

estimate manufacturing yield with Monte Carlo?

Tutorial 6b, Tolerancing - Monte Carlo Simulations

add a compensator (e.g. refocus) to the analysis?

Tolerancing - Compensators

include surface roughness and scattering?

Tutorial 6c


Interoperate with other tools#

How do I …

Where to look

import a Zemax .zmx file?

Tutorial 1d

import a CODE V .seq file?

CODE V (.seq) File Import Demo

import an OSLO .len file?

OSLO (.len) File Import Demo

save and reload a system as JSON?

Tutorial 1d

export a prescription for a report?

Optical Prescription Report


Coatings and polarization#

How do I …

Where to look

apply an anti-reflection or multilayer coating?

Tutorial 5a

trace polarized light?

Tutorial 5b

inspect the Jones pupil?

Jones Pupil Analysis

optimize a thin-film stack?

Tutorial 5c, Tutorial 5d


Differentiate and accelerate#

How do I …

Where to look

switch to the PyTorch backend (and to the GPU)?

Tutorial 7a, PyTorch Backend Basics

get gradients of a performance metric w.r.t. lens parameters?

Gradient Calculation

optimize a lens with autograd?

Tutorial 7b, Gradient-based Optimization

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?

Solution Space Visualization

use machine learning to predict or classify lens performance?

Tutorial 9a, Tutorial 9b


Extend Optiland#

How do I …

Where to look

write a custom surface type?

Tutorial 8a

write a custom coating?

Tutorial 8b

write a custom optimization algorithm?

Tutorial 8c

write a custom operand?

Tutorial 3c

ship my extension as an installable plugin?

Plugin Packages

understand Optiland’s internals before contributing?

Architecture Overview


Visualize#

How do I …

Where to look

change the plot theme (including dark mode)?

Visualization Themes

draw the system in 3D?

2D Visualization in Non-default Axes

model an extended (non-point) source?

Beam Shaping with Extended Source

use the graphical interface instead of scripting?

Optiland GUI Quickstart


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.