Tutorials
These tutorials demonstrate various applications of FluxOptics.jl, from basic wave propagation to advanced inverse design problems.
Documentation vs Notebooks
The tutorials are available in two formats:
- Documentation pages (this site): Read-only versions with embedded figures and explanations
- Interactive Jupyter notebooks (
notebooks/folder): Executable versions including execution times and interactive exploration
All tutorials are GPU-optimized (GeForce RTX 4070 Super, CUDA 12.x).
- Tutorials 1-4: 2-6 seconds (cavity modes, field retrieval, chromatic shaping, tomography)
- Tutorial 5: 105-mode total intensity shaping
- Square beam shaping: ~34 seconds (600 iterations, TV regularization)
- Ring pattern synthesis: ~50 seconds (1500 iterations, polynomial radial basis)
- Tutorial 6: ~30 seconds (45-mode sorting, 8 phase planes)
CPU execution is significantly slower and not recommended for iterative development.
Running the Tutorials
To run the notebooks yourself:
- Install FluxOptics.jl and required dependencies
- Clone the repository:
git clone https://github.com/anscoil/FluxOptics.jl.git cd FluxOptics.jl/notebooks - Launch Jupyter and open the desired notebook
These tutorials are optimized for GPU execution. Ensure CUDA.jl is properly configured for the timing benchmarks shown above. CPU execution will be significantly slower.
For CPU-only users: The notebooks include comments indicating which lines to modify for CPU execution (typically CUDA array conversions).
Available Tutorials
FoxLi Simulation
Demonstrates basic wave propagation and saturated gain using the Fox-Li algorithm to simulate resonator modes.
Field Retrieval
Shows how to retrieve complex field information from intensity measurements using phase retrieval techniques.
Multi-Wavelength Beam Shaping
Designs optical systems that shape beams at multiple wavelengths simultaneously (RGB).
Waveguide Tomography
Demonstrates inverse reconstruction of waveguide refractive index profiles from tomographic intensity measurements using plane wave illumination at multiple angles.
Multimode Intensity Shaping
Optimizes multimode fiber systems to achieve target intensity distributions. This tutorial demonstrates optimization with 105 modes and is the most computationally intensive example.
Hermite-Gaussian Multimode Sorter
Designs a 45-mode sorter transforming triangular Gaussian arrays into copropagating Hermite-Gaussian modes with 8 cascaded phase masks. Revisits the seminal Carpenter & Fontaine approach (CLEO/Europe 2017) using algorithmic differentiation instead of classical error-reduction algorithms.