structured-optics
A Python library for generating, propagating, and analyzing structured light beams (Hermite-Gaussian, Laguerre-Gaussian, Bessel, Ince-Gaussian, fiber LP modes, and more) on a discretized transverse grid.
Features
- Mode generation: Hermite-Gaussian, Laguerre-Gaussian, Bessel, Gaussian-Bessel, Ince-Gaussian (even/odd/helical), fractional OAM, fiber LP modes, and geometric apertures (circle, square, triangle).
- Propagation: Fresnel, Fraunhofer, and incoherent propagation methods.
- Polarization: vector beams with Ex/Ey/Ez components, Jones-matrix optics (waveplates, polarizers).
- Optical elements: lenses (spherical, astigmatic, tilted), slits, irises, and other amplitude/phase masks.
- Analysis: power, intensity and phase profiles, centroid, beam size (std), angular sections, and modal decomposition (HG/LG/Bessel basis projections).
- Holography: SLM and DMD hologram generation for experimental beam shaping.
Installation
pip install structured-optics
Quick start
import structured_optics as so
# Create a beam on a 10mm x 10mm (2*5e-3) grid with 512x512 points
beam = so.Beam(nix=5e-3, Dx=512, waist=1e-3, lamb=1064e-9)
# Set the field to a Laguerre-Gaussian mode with l=2, p=0
beam.lg(l=2, p=0)
# Propagate 10 cm using Fresnel Convolution
beam.propagate(z=0.1, method='fres_c')
# Look at the intensity profile
import matplotlib.pyplot as plt
plt.pcolormesh(beam.x, beam.y, beam.int_profile())
plt.show()
Expected output: (examples/image_examples/LG_20 prop.png)
Documentation
Full API documentation, including all mode types, propagation methods, and optical elements, is available at:
Soon...
Requirements
- Python 3.9+
- numpy
- scipy
- screeninfo
Contributing
Issues and pull requests are welcome at github.com/Altilano/structured-optics.
License
This project is licensed under the BSD-3-Clause License. See LICENSE for details.
Citation
To do
- Documentation.
- Benchmark and optimization.
- Support for high NA focalization. (Non paraxial propagation)
- Cuda and ROCm speed up.
- Support for propagation inside linear medium.
Release files for structured-optics 0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| structured_optics-0.6.tar.gz | 31.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| structured_optics-0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 65.2 kB
Release files / structured_optics-0.6.tar.gz
| Download URL | structured_optics-0.6.tar.gz |
|---|---|
| Size | 31.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c136880f503225a98b00bdb1eef83bacee49ef86ba08aa772b0e1353f2f7d53a
|
|
BLAKE2b-256 checksum How to use checksums |
57cc103c9c391eae73bd2c809d81bf4a69cf7b5f57542a6f9aa5fb4b4c5451a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.15
|
Release files / structured_optics-0.6-py3-none-any.whl
| Download URL | structured_optics-0.6-py3-none-any.whl |
|---|---|
| Size | 33.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b248e0d186023a036712963f1e524146ea5ae874988e60861d3621eecf51faa6
|
|
BLAKE2b-256 checksum How to use checksums |
b44d672497a857d135a0a5c78511c7bd334bb3db6b7591a024a4e3359989d4c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.15
|