Skip to main content

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.

PyPI version

License: BSD-3-Clause

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.colorbar()
plt.show()

Expected output:

LG20

Documentation

Full API documentation, including all mode types, propagation methods, and optical elements, is available at:

(https://altilano.github.io/structured-optics/)

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, no scalar field)
  • Cuda and ROCm speed up.
  • Support for propagation inside linear medium.

Release files for structured-optics 0.6.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for structured-optics 0.6.3
File Size Uploaded
structured_optics-0.6.3.tar.gz 42.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for structured-optics 0.6.3
File Interpreter ABI Platform
structured_optics-0.6.3-py3-none-any.whl Python 3 none any Details

Total release size: 87.5 kB

Release files / structured_optics-0.6.3.tar.gz

Download URL structured_optics-0.6.3.tar.gz
Size 42.3 kB
Tags Source
SHA-256 checksum
How to use checksums
af13bc497c9573c47743a83f5b701ca3b588781e37c4f7b1a224d1ac27431b5b
BLAKE2b-256 checksum
How to use checksums
2b8c1771c7e1d3648441c97f03ceeb7dd97eb98ed87995618be16d22108419bd
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.3-py3-none-any.whl

Download URL structured_optics-0.6.3-py3-none-any.whl
Size 45.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
820f4e4e1586270471690c43c6159cd7da4833af6e3b1659cb210af97da1c2ed
BLAKE2b-256 checksum
How to use checksums
2c5b5c1af84e43408ca1561272927af6812ef47f7ecdff8a4113cdfa5f2eb6fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release history Release notifications | RSS feed

This release

0.6.3 This release

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6

2 release files

0.5

2 release files

0.4.1

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page