This example analyzes the stability of an optical cavity by propagating a Gaussian beam through optical elements using ABCD matrices.
cargo run -p physics_examples --example laser_resonator_stabilityA laser cavity traps light between mirrors. For a stable mode to exist, the diffraction of the beam (spreading) must be counteracted by the focusing of lenses or curved mirrors.
We model the beam using the Complex Beam Parameter
-
$R(z)$ : Radius of curvature of the wavefront. -
$w(z)$ : Beam spot size (radius).
Propagation through an optical element (Matrix M) transforms
-
Beam Initialization: Start with a defined waist
$w_0$ . - Drift: Propagate through free space.
- Lens: Focus through a thermal lens.
-
Stability Check: The
gaussian_q_propagationwrapper automatically verifies the physical invariantIm(q) > 0. If the cavity is unstable, the beam size diverges (imaginary part goes to zero/negative in math), triggering a Causal Error.
deep_causality_physics::photonics::gaussian_q_propagationdeep_causality_physics::photonics::{AbcdMatrix, ComplexBeamParameter}deep_causality_physics::photonics::lens_maker