Skip to main content

Python package for designing gaussian laser beam propagation and transformation.

Project description

gbeampro

gbeampro is a small Python package for simulating Gaussian (TEM₀₀) laser beam propagation and transformations using the ABCD matrix method (q-parameter formalism).

Installation

pip install gbeampro

Quick Start

from gbeampro import beambase

# Define a beam: 1064 nm, w=1 mm, flat wavefront
beam = beambase.GaussBeam(wl_um=1.064, n=1.0, w_mm=1.0)

# Propagate 100 mm, focus with f=50 mm lens, propagate into crystal (n=1.5)
beam.propagate(50).thinlens(50).interface(1.5).propagate(10)

# Find beam waists
beam.search_BeamWaists()

API Reference

GaussBeam(wl_um, n, z_mm, R_mm, w_mm, label)

Fundamental Gaussian beam object.

Parameter Description Unit
wl_um Wavelength µm
n Refractive index of medium
z_mm z-coordinate of wavefront mm
R_mm Wavefront curvature radius mm
w_mm Beam radius (1/e² intensity half-width) mm
label Label string

Key attributes: .q (complex q-parameter), .theta (divergence half-angle in rad).

Transformation Methods

All methods mutate the beam in-place and return self, enabling method chaining.

Method Description
propagate(d_total, dz=0.01) Free-space propagation over distance d_total (mm), recorded at steps of dz
thinlens(f) Thin lens with effective focal length f (mm)
interface(n2) Refraction at a flat dielectric interface into medium with index n2
interface_curved(n2, r) Refraction at a curved dielectric interface; r > 0 convex, r < 0 concave (mm)
curved_mirror_tan(r, theta_deg) Reflection from a curved mirror, tangential (in-plane) component
curved_mirror_sag(r, theta_deg) Reflection from a curved mirror, sagittal (out-of-plane) component

Analysis Methods

Method Description
search_BeamWaists(out=False) Locate beam waists (sign change of R). Prints results; returns (n, z, w) arrays if out=True

Plot Methods

Method Description
plot_w(ax) Beam radius w vs z
plot_R(ax) Wavefront curvature radius R vs z
plot_n(ax) Refractive index n vs z
plot_theta(ax) Divergence half-angle θ vs z

Trajectory

Every transformation appends to beam.traj, a dict of lists:

Key Description
z_mm z-coordinate (mm)
n Refractive index
R_mm Wavefront curvature radius (mm)
w_mm Beam radius (mm)
q Complex q-parameter
theta_rad Divergence half-angle (rad)

Examples

License

See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gbeampro-1.0.1.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gbeampro-1.0.1-py2.py3-none-any.whl (74.3 kB view details)

Uploaded Python 2Python 3

File details

Details for the file gbeampro-1.0.1.tar.gz.

File metadata

  • Download URL: gbeampro-1.0.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.14.3 HTTPX/0.28.1

File hashes

Hashes for gbeampro-1.0.1.tar.gz
Algorithm Hash digest
SHA256 cbb4e8c055dfd5c85150bc460515e818a19dc23c7e35a9ff7cf4a4c1e065fb84
MD5 85b483260d9f802bcb05187ad4ae421b
BLAKE2b-256 da617d73667536bb774a0887649dcafb803827685673488c4afa872647956e41

See more details on using hashes here.

File details

Details for the file gbeampro-1.0.1-py2.py3-none-any.whl.

File metadata

  • Download URL: gbeampro-1.0.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 74.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: Hatch/1.16.5 cpython/3.14.3 HTTPX/0.28.1

File hashes

Hashes for gbeampro-1.0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 cf75550a57ca626f631ff4349208d28dd83db7eb5ff9fda85674665d1d6f1244
MD5 9e2a374b0671ba76b0b7880980774ae7
BLAKE2b-256 2f22a03e91f1da74f643ad3f87a0f3e3329eab0f74fefcb8594fc03234895523

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page