Free software

About OpticalSetup

Copyright © 2026 Luca Genchi and contributors.

OpticalSetup is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

It is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. See the GNU General Public License for more details.

The numbers OpticalSetup reports come from models with stated limits; read each component's page in the wiki before relying on one.

If you use OpticalSetup in your research, teaching or publications, please cite the software:

Bertoncini, A., & Genchi, L. (2026). OpticalSetup - the optical workbench software [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.23191537

Calculators / Dispersion compensation

Dispersion compensation

Choose a prism or grating layout, the pulse and the chirp it carries; the page solves the separation (or takes yours), draws the bench to scale with the canvas’s own tracer, and gives the compensator’s GDD, TOD and FOD, the output pulse from every order of the phase, the colours’ spread and the transmission.

1GDD across the spectrum
The compensator’s GDD, the input’s and their sum. A flat net curve at zero means a short output; its tilt is the residual TOD.
Data table
2Output duration against the separation
Every order of the phase (solid) and GDD only (dashed). The marker is the bench shown.
Data table
3The output pulse
Intensity against time, with the transform limit and, when it fits, the input.
Data table
Model
Exact plane-wave phase of each layout along the central ray: Fork, Martinez and Gordon’s apex path for prisms, Treacy’s for gratings, Martinez’s equivalent pair for the stretcher (paraxial). The output pulse is the Fourier transform of the spectrum with every order of the phase.
Evidence
Checked against an independent program in 40-digit arithmetic, with its own geometry, ray tracing and derivatives: GDD, TOD, the solved separation and the transmission agree to 10⁻⁹, FOD to 2 × 10⁻³ (validation table). As an outside check, Light Conversion’s online compressor calculators [6] give the same grating-pair GDD and TOD, and the same prism-pair GDD to 5 × 10⁻⁴ in fused silica.
Code
compressor-model.js builds the bench from the canvas’s own elements (prism, grating, lens, mirror, beamsplitter) and glass catalogue; “Open in the canvas” opens that scene.

The physics

A pulse’s spectral phase φ(ω), expanded about its central frequency ω₀, sets its shape in time. The linear term is a delay; the quadratic one, the group delay dispersion (GDD), is a linear chirp; the third- and fourth-order terms (TOD and FOD) distort the pulse further. Glass, lenses and fibres add positive GDD at visible and near-infrared wavelengths. A compensator adds the opposite.

φ(ω)=φ0+τg Δω+GDD2Δω2+TOD6Δω3+FOD24Δω4+…,Δω=ω−ω0\varphi(\omega)=\varphi_0+\tau_g\,\Delta\omega+\frac{\mathrm{GDD}}{2}\Delta\omega^2+\frac{\mathrm{TOD}}{6}\Delta\omega^3+\frac{\mathrm{FOD}}{24}\Delta\omega^4+\dots,\qquad \Delta\omega=\omega-\omega_0

Prism pair. Each colour leaves the first prism in its own direction u(ω) and is made parallel again by the second, identical prism, turned the other way. Fork, Martinez and Gordon showed that the phase between a wavefront before the first prism and one after the second equals that of a virtual ray from apex A of the first to the wavefront through apex B of the second [1]: no glass on that ray, only the projection of the apex-to-apex vector on the colour’s direction. Moving a prism into the beam moves its apex, which is how insertion adds glass. The page evaluates this exactly, with the colour’s direction from Snell’s law at both faces:

φ(ω)=ωc (B−A)⋅u(ω),δ(ω)=θ1+arcsin⁡ ⁣(nsin⁡(α−arcsin⁡(sin⁡θ1/n)))−α\varphi(\omega)=\frac{\omega}{c}\,(\mathbf B-\mathbf A)\cdot\mathbf u(\omega),\qquad \delta(\omega)=\theta_1+\arcsin\!\big(n\sin(\alpha-\arcsin(\sin\theta_1/n))\big)-\alpha
u turns from the input direction by the deviation δ, with n = n(ω) the glass’s index, α the apex angle and θ₁ the angle of incidence. A Brewster-cut prism at minimum deviation has tan θ₁ = n and α = π − 2θ₁ at the central wavelength.

Grating pair. Treacy’s compressor [2]: two parallel gratings a perpendicular distance G apart, used in order −1. In the plane-wave form used here the phase is

φ(ω)=ωc Gcos⁡β(ω),sin⁡β=λd−sin⁡γ,GDD=−λ3G2πc2d2cos⁡3β\varphi(\omega)=\frac{\omega}{c}\,G\cos\beta(\omega),\qquad \sin\beta=\frac{\lambda}{d}-\sin\gamma,\qquad \mathrm{GDD}=-\frac{\lambda^3 G}{2\pi c^2 d^2\cos^3\beta}
γ is the angle of incidence, β the diffraction angle, d the groove spacing. The GDD is Treacy’s explicit form, which the page’s derivative reproduces.

Grating stretcher. Two gratings with two lenses of focal length f between them, 2f apart, each grating a distance s from its lens: the lenses image one grating onto the other, and the pair acts like a grating pair of separation (s₁ + s₂ − 2f) cos β [3]. With the gratings inside the focal planes that is negative, and the GDD positive: the stretcher of a chirped-pulse amplifier [4][5]. This holds to paraxial order in ideal thin lenses without glass; in the canvas the lenses also carry an estimated thickness of N-BK7, whose GDD it adds.

Geq=(s1+s2−2f)cos⁡β0G_\text{eq}=(s_1+s_2-2f)\cos\beta_0

Double pass and sequences. One pass of a pair gives the dispersion, but the colours leave it parallel and side by side across the beam (spatial chirp), millimetres to centimetres apart. The compressors here return the beam they were given, compressed, with its colours on top of each other at the output, so each sends the light back through the same pair or on through a mirror-image second pair: that doubles the phase and brings the colours together again. (Side-by-side colours are not useless: a lens can bring them together at its focus, which spatiotemporal focusing uses, but the beam before the focus stays spatially chirped.) The double pass ends on a flat mirror square to the beam: after one pass of a pair the colours travel parallel, so each meets the mirror at normal incidence and comes back along its own path. The return is the time reverse of the first pass, so the GDD is exactly twice one pass and the colours that one pass left side by side meet again: the beam leaves with the diameter it came in with. In the plane of the figure the return retraces the input, so a beamsplitter takes it out; in the lab the end mirror is tipped slightly out of the plane and a pickoff mirror just above the input takes the return without loss, which leaves the in-plane geometry, and so the dispersion, unchanged. A four-element sequence is two pairs, the second the mirror image of the first; between the pairs the colours travel parallel, so the gap does not change the phase. To see what one pass leaves, open the bench in the canvas, take out the end mirror and put a photodetector in its place, facing the same way and as tall as the mirror (in a four-element sequence, between the two pairs, across the beam and tall enough for the band): its Colours row reads the colours side by side.

Derivatives and the solve. The phase is evaluated in Taylor arithmetic to third order in ω, so GDD and TOD are exact up to rounding; FOD comes from fourth differences of the exact phase. Each layout’s phase is linear in its separation (L, G or s), so the separation that brings the net GDD to the target follows exactly from two evaluations.

The output pulse. The spectrum (Gaussian or sech² intensity with the FWHM entered) carries the input phase plus the compensator’s, every order; the pulse is its Fourier transform and the duration the FWHM of |E(t)|². The input phase is either a material’s, from its published dispersion fit (the material calculator’s data), or the GDD, TOD and FOD entered. The GDD-only duration, for comparison, is the analytic one:

E(t)∝∫S(ω)  e i[φin(ω)+φcomp(ω)] e−iωt dω,τGDD=τ01+(4ln⁡2 GDD/τ02)2E(t)\propto\int\sqrt{S(\omega)}\;e^{\,i[\varphi_\text{in}(\omega)+\varphi_\text{comp}(\omega)]}\,e^{-i\omega t}\,d\omega,\qquad \tau_\text{GDD}=\tau_0\sqrt{1+\big(4\ln2\,\mathrm{GDD}/\tau_0^2\big)^2}
Gaussian; sech² uses its own analytic form, as the canvas does. τ₀ is the transform limit, 0.441 λ²/(cΔλ) for a Gaussian and 0.315 λ²/(cΔλ) for sech².

Spread and transmission. The colours of the FWHM band arrive at the second prism a distance L |δ(λ₁) − δ(λ₂)| apart, and at the second grating G |tan β₁ − tan β₂| apart; with the beam diameter that sets the aperture the second optic needs. Uncoated prism faces transmit by Fresnel’s formulas for the polarization chosen, at each face’s angle (see prism Fresnel); at Brewster’s angle p-polarized light crosses without loss. Gratings transmit the efficiency entered once per diffraction.

Choosing a layout

The defaults show the trade-offs; each number below is the page’s own for that bench.

  • Prism pairs are weak but clean. The fused-silica pair adds −2.2 fs² per mm of separation in double pass at 800 nm, so cancelling 10 mm of N-BK7 takes about 70 cm. A flint (the four N-SF10 prisms) adds −18 fs² per mm. Brewster-cut and p-polarized, the prisms lose nothing to reflection. Sliding the second prism in or out tunes the GDD continuously without moving the beam.
  • Prisms take back part of the glass’s TOD. Glass adds positive GDD and positive TOD; a prism pair adds negative GDD with negative TOD, so it removes part of the glass’s TOD with its GDD. A strongly dispersive flint removes more TOD than the glass brought: on the four-prism default the output (34.8 fs) stays above the transform limit (31.4 fs) because of the TOD left over.
  • Grating pairs are strong. The 1200 lines/mm pair at 45° adds about −2900 fs² per mm of separation in double pass, enough to recompress a pulse stretched to 88 ps in 35 cm. Its TOD is positive with negative GDD: matched to a grating stretcher of the same gratings and angle, it cancels the stretcher’s TOD and FOD too, which is how chirped-pulse amplifiers recompress [4][5]. Each diffraction loses a little (92 % per bounce on the defaults: 72 % for four bounces).
  • Gratings and glass add TOD of the same sign. On the fibre default (20 m of fused silica at 1030 nm, four gratings) the GDD cancels but the TOD adds up, and the output (205 fs) stays well above the transform limit (139 fs). Prisms, or a combination of prisms and gratings, are the usual remedy; this page models each separately.
  • Near Littrow the gratings are most efficient but the beams overlap. In the plane of the figure the beam leaving the second grating runs back across the first; real compressors separate the beams in height. The page draws the bench further from the source where it can, and says so where no in-plane layout works. The numbers do not depend on the drawing.

Every parameter

Inputs first, then what the page derives.

SymbolQuantityUnitMeaning
λ₀, ΔλCentral wavelength, bandwidthnmVacuum wavelength and spectral FWHM. The transform limit follows from them and the shape.
—Chirp to compensate—None; a material and its length (every order of its published dispersion); or entered GDD, TOD and FOD.
—Polarizationp or sp is in the plane of the figure. Sets the prisms’ Fresnel loss.
α, θ₁Apex angle, angle of incidence°Brewster cut: α = π − 2θ_B and θ₁ = θ_B at λ₀, with tan θ_B = n(λ₀). Otherwise set by hand.
LPrism separationmmAlong the central ray, from the first prism’s exit to the second’s entrance.
—Glass in prism 1, 2mmThe central ray’s path in each prism. Sets where the apexes sit.
1/d, γLine density, angle of incidencelines/mm, °Reflective gratings in order −1. Littrow: sin γ = λ/(2d).
GGrating separationmmPerpendicular distance between the faces; the slant distance along the ray is G / cos β.
f, sLens focal length, grating to lensmmThe stretcher: s < f gives positive GDD, s = f none.
—Target net GDDfs²What the solve aims at: 0 for a compressor, a positive value for a stretcher.
GDD, TOD, FODCompensator dispersionfs², fs³, fs⁴Derivatives of its phase at ω₀.
—Output durationfsFWHM of the Fourier-transformed pulse, every order of the phase; and the GDD-only analytic value.
—Colour spread, aperturemmOf the FWHM band on the second optic; the aperture adds the beam diameter (and the grating footprint).
TTransmission%Fresnel losses of the prism faces, or grating efficiency per diffraction. Mirrors are lossless here.

Reading the graphs

1. GDD across the spectrum. The compensator’s GDD (blue), the input’s (dashed) and the net (green) from 1.5 bandwidths below to 1.5 above the centre; the yellow band is the FWHM. At the centre the net is the target. A sloped net curve is residual TOD, a curved one residual FOD.

2. Output duration against the separation. The bench recomputed at other separations around the one shown. The minimum of the solid curve is the shortest pulse this layout gives; with TOD left over it lies slightly away from zero net GDD, where the dashed GDD-only curve has its minimum. Far from it only the dashed curve is drawn, because the pulse is long.

3. The output pulse. Its intensity in time, peak 1, against the transform limit. Satellites on one side are the mark of TOD.

How precise is it?

Numerical precision

QuantityChecked againstAgreement
GDD, TOD, the solved separation and the transmissionAn independent program in 40-digit arithmetic, with its own geometry, ray tracing and derivatives, on seven benches: both prism layouts, both grating layouts and the stretcher, in p and s light (validation table)10⁻⁹
FODThe same program2 × 10⁻³: the page takes the FOD from differences of its phase in double precision
Grating-pair GDDTreacy’s explicit formula [2]10⁻¹⁰
GDD and TOD of grating and prism pairs, double passLight Conversion’s two-prism and grating-pair compressor calculators [6], on benches matched in geometry (perpendicular grating separation; glass in each prism and the path between them)grating pairs identical to 10⁻¹¹; prism pairs GDD within 5 × 10⁻⁴ and TOD within 1 % in fused silica, where both use the same index fit (the residual is consistent with numerical derivatives of the index on their side)
Output durationThe analytic Gaussian and sech² durations when the phase is pure GDD10⁻³

The page shows dispersion to the nearest fs², fs³ or fs⁴ and durations to the nearest fs (a tenth of a fs below 10 fs): the computation is far more precise than that, but the glass data and the plane-wave model hold no more.

Physical accuracy

The phase is exact for plane waves and ideal optics: flat faces, perfect gratings, the glass’s published index. Real compressors depart from it through the beam’s finite size (each part of the beam crosses a different amount of glass), surface and grating errors, misalignment (a prism pair whose faces are not exactly parallel leaves angular dispersion) and the gratings’ groove density tolerance. The page is a design aid for the geometry and the orders of the phase; align and measure the real one.

What is not modelled

  • Beam size and diffraction: everything is along the central ray of each colour.
  • Grisms, chirped mirrors, and prisms combined with gratings in one compressor.
  • Grating efficiency against wavelength, angle and polarization: one number per diffraction.
  • Absorption in the glass, coatings, mirror losses.
  • Thick or real lenses in the stretcher, and their glass: ideal thin lenses, to paraxial order in the page’s numbers.
  • Nonlinear effects in the material carrying the chirp (self-phase modulation in a fibre, for instance).

References

  1. R. L. Fork, O. E. Martinez and J. P. Gordon, “Negative dispersion using pairs of prisms”, Opt. Lett. 9, 150 (1984)
  2. E. B. Treacy, “Optical pulse compression with diffraction gratings”, IEEE J. Quantum Electron. 5, 454–458 (1969)
  3. O. E. Martinez, “3000 times grating compressor with positive group velocity dispersion: application to fiber compensation in 1.3–1.6 µm region”, IEEE J. Quantum Electron. 23, 59–64 (1987)
  4. D. Strickland and G. Mourou, “Compression of amplified chirped optical pulses”, Opt. Commun. 56, 219–221 (1985)
  5. M. Pessot, P. Maine and G. Mourou, “1000 times expansion/compression of optical pulses for chirped pulse amplification”, Opt. Commun. 62, 419–421 (1987)
  6. Light Conversion, Optics Toolbox: two-prism compressor and grating-pair compressor calculators, used here as an outside check of the results