Retrieval across pulse shapes and interactions#
Compare SHG, PG and SD retrievals for Gaussian and sech pulses, then include a dispersive slab. This is a compact survey after your first retrieval.
Inputs and method#
The script generates its own traces on a matched Fourier grid. It uses a fixed noise seed and fixed retrieval seeds. Clean cases use COPRA; noisy cases use L-BFGS with its package defaults, so this is not a controlled solver ranking. The final case uses a 260 nm carrier and a 10 µm fused-silica slab.
Run from a source checkout:
uv run python examples/example_retrieval.py
Calculation and output#
The cell below loads and executes the runnable script itself. Expand it to inspect
the source, or download example_retrieval.py.
Generated files are isolated in a temporary directory for this documentation run.
====================================================================
Thin-medium retrieval (Gaussian & sech, PG/SD/SHG)
====================================================================
pulse inter algo noise R FWHM/fs
Gaussian 2.5 fs, GDD pg copra 0% 8.12e-17 5.10
Gaussian 2.5 fs, GDD pg lbfgs 1% 6.31e-03 4.99
Gaussian 2.5 fs, GDD sd copra 0% 6.54e-17 5.10
Gaussian 2.5 fs, GDD sd lbfgs 1% 6.45e-03 4.84
Gaussian 2.5 fs, GDD shg copra 0% 1.13e-16 5.10
Gaussian 2.5 fs, GDD shg lbfgs 1% 3.15e-02 4.01
(true FWHM = 5.10 fs)
sech 3 fs pg copra 0% 2.77e-10 3.00
sech 3 fs pg lbfgs 1% 6.44e-03 3.10
sech 3 fs sd copra 0% 2.26e-10 3.00
sech 3 fs sd lbfgs 1% 6.59e-03 2.81
sech 3 fs shg copra 0% 9.66e-13 3.00
sech 3 fs shg lbfgs 1% 6.19e-03 2.95
(true FWHM = 3.00 fs)
====================================================================
Dispersive retrieval (UV pulse, 10 um SiO2 slab)
====================================================================
true temporal FWHM = 5.78 fs
algorithm R FWHM/fs
copra 3.53e-17 5.78
lbfgs 1.69e-05 5.75
Done.
Interpretation and limits#
Read the printed duration against the generating value for each pulse. In the seeded noisy SHG case, the retrieved duration differs appreciably from the generating Gaussian; retain that discrepancy when assessing the method. GDD stretches a pulse beyond its transform-limited input width. Noise can change the residual and field differently, and clipping negative noisy samples changes the noise distribution. This script is an API survey, not a coverage or noise-model validation. Follow solver selection and retrieval theory for controlled comparisons.