Skip to content

jzli559/GaussianBeam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GaussianBeam

A Python toolkit for modeling Gaussian beam propagation using the ABCD matrix formalism.
Supports both symbolic (SymPy) and numeric (NumPy) calculations, with intuitive chain-style propagation of optical elements.

Features

  • Numeric and symbolic Gaussian beam propagation.
  • Abstracted optical elements: free space propagation, lenses, etc.
  • Intuitive chain-style API.
  • Supports unit handling: nm, um, mm, cm, m, mrad, ...

Installation

Note that installing this package will automatically install the required dependencies: sympy and numpy.

You can directly install the package in editable/development mode:

git clone https://github.com/jzli559/GaussianBeam.git
cd GaussianBeam
pip install -e .

Or install from PyPI (not yet published):

pip install gaussianbeam

Quick Start

from gaussianbeam.raytrace.main import Beam, Mode
from gaussianbeam.units import nm, um, mm, mrad

beam_initial = Beam(wl=1064*nm, w0=5*um)

beam_final = (
    beam_initial.copy()
    .prop(100*mm)
    .lens(f=50*mm)
    .prop(100*mm)
)

print(f"Final waist location : {beam_final.w0_loc/mm:.4f} mm")

All example scripts are in the examples/ directory. For complete numeric demos, see py demo; For complete symbolic demos, see py demo.

About

A Python toolkit for modeling Gaussian beam propagation using the ABCD matrix formalism. Supports symbolic (SymPy) and numeric (NumPy) calculations, abstracted optical elements, and intuitive chain-style propagation.

Resources

License

Stars

Watchers

Forks

Contributors

Languages