3D ray tracing
Hybrid sequential and non-sequential ray tracing without paraxial approximation.
Learn more
3D ray tracing and Gaussian beamlet propagation for optical setups in Julia
Building optical setups in a laboratory environment β for instance a laser interferometer β is a common task for optical engineers and physicists. This package is intended to provide a simulation environment in which the user can quickly analyze and layout simple optical components like lenses or beamsplitters before committing to a breadboard setup.
This package mainly tries to provide a simple Gaussian beamlet propagation tool for coherent, monochromatic and directed light sources. It also offers a convenient kinematic API that allows for the easy placing of optical elements and straight-forward simulation of moving or vibrating components.
For this purpose, the package implements a traditional ray tracing solver. This forms the backbone of the Gaussian beamlet tracing scheme that has been implemented to model the propagation of laser beams.
What this package is not
This package does not include tools for optimizing optical systems, such as fine-tuning lens surfaces to minimize specific aberrations in multi-lens setups. Instead, the package is designed as a digital laboratory where you can play around with stuff before buying it.
A circularly polarized Gaussian laser beam through a Keplerian beam expander β beam radius, focus and polarization are traced along with the rays.
using GLMakie, BeamletOptics
const mm = 1e-3
# Keplerian beam expander: fβ = 15 mm, fβ = 45 mm β 3Γ magnification
lens1 = ThinLens(15mm, 15mm, 12mm, 1.5) # biconvex, f = R for n = 1.5
lens2 = ThinLens(45mm, 45mm, 25mm, 1.5)
translate3d!(lens1, [0, 20mm, 0])
translate3d!(lens2, [0, 80mm, 0]) # spacing fβ + fβ
system = System([lens1, lens2])
# 532 nm laser, 1.5 mm waist radius, circularly polarized
laser = AstigmaticGaussianBeamlet([0, 0, 0], [0, 1, 0], 532e-9, 1.5mm; E0=[1, 0, im]/β2)
solve_system!(system, laser)
# plot lenses and beam
fig = Figure(size=(800, 300))
ax = LScene(fig[1, 1], show_axis=false)
render!(ax, system)
render!(ax, laser; color=RGBAf(0.1, 0.8, 0.1, 0.25), flen=0.04,
show_polarization=true, pol_Ξ»=4mm, pol_gain_max=4, pol_scale=1.5)
render_lcs!(ax, [-5mm, 50mm, -25mm]; scale=3, show_labels=true)
set_orthographic(ax)
0.0 0.0 0.0 1.0 # hide
# beam radius behind the expander relative to the input beam
gauss_parameters(laser, 0.12)[1] / gauss_parameters(laser, 0.0)[1]2.9493488872847196
Browse all tutorials and examples
Warning
This package requires Julia β₯ 1.12
You can add this package to your project by entering the package manager (press ] in the REPL) and typing add BeamletOptics. It is also recommended that you add GLMakie. You can include this package into your current scope via using BeamletOptics. If a Makie version is loaded before or after the inclusion of this package, the extension provided as part of this package will enable additional visualization functions.
The BeamletOptics package is made available under the MIT license. If you use this package for your research, we encourage you to cite it. For your convenience, a BibTeX entry is provided as part of the package (CITATION.bib) or on Zenodo.
A variety of packages and tools exist that implement similar approaches or offer optics modeling capabilities.
Within the Julia ecosystem, the following packages need to be mentioned:
More broadly speaking, have a look at these packages as well:
There also exists a plethora of commercial and non-commercial simulation frameworks outside of the Julia ecosystem. For specific examples regarding the beamlet method used in this package, refer to the Complex ray tracing section.