A Python (and Matlab) based project for sorting spatial modes such as Hermite-Gaussian (HG) and Laguerre-Gaussian (LG) modes. The project includes tools for visualizing modes, creating spatial light modulator (SLM) masks, and projecting modes using Fourier transforms.
Link to the paper: https://opg.optica.org/oe/fulltext.cfm?uri=oe-34-2-1837
- Generate Hermite-Gaussian (HG) and Laguerre-Gaussian (LG) modes.
- Visualize amplitude and phase masks of modes.
- Create spatial light sorter masks for mode manipulation.
- Perform Fourier-based projections of modes.
- Python 3.x
- NumPy
- Matplotlib
- SciPy
Clone the repository:
git clone https://github.com/yourusername/SinglePlaneSpatialModeSorter.git
cd mmsRun the main script to generate and visualize modes, create SLM masks, and display projections:
python mms_main.pyYou can modify the mode_type variable in the script to switch between Hermite-Gaussian (HG) and Laguerre-Gaussian (LG) modes. Additionally, you can adjust the modes_list to specify the modes to generate.
If you use this project in your research, please cite it using the following BibTeX entry:
@article{Cohen:26,
author = {Khen Cohen and Yoav Yosif-Or and Yaron Oz and Ady Arie},
journal = {Opt. Express},
keywords = {Free space optics; Mode conversion; Optical angular momentum; Quantum key distribution; Space division multiplexing; Spatial light modulators},
number = {2},
pages = {1837--1849},
publisher = {Optica Publishing Group},
title = {Single plane spatial mode sorter},
volume = {34},
month = {Jan},
year = {2026},
url = {https://opg.optica.org/oe/abstract.cfm?URI=oe-34-2-1837},
doi = {10.1364/OE.584001},
abstract = {A mode sorter separates a set of M orthogonal spatial modes in a shared input channel into M different output channels. Here we present an analytic derivation and experimental validation of a single plane device for sorting spatial modes from a diverse variety of mode families, including Hermite-Gaussian (HG), Laguerre-Gaussian (LG), and Bessel-Gaussian (BG), with almost no cross-talk. This sorting capability is required for a wide range of applications that employ classical or quantum light. We also show that applying this design in order to sort a set of Orbital Angular Momentum (OAM) modes with zero radial index reproduces the well-known Fork grating configuration. Furthermore, by taking the limit of M\&\#x2009;\&\#x2192;\&\#x2009;\&\#x221E;, we present an analytical expression for sorting all the modes of a given family. By operating this device in reverse, it can be used to generate arbitrary modes by illuminating it with a Gaussian beam. The power transmission coefficient for this sorter goes as O(M\&\#x2212;1), and we provide a mathematical proof that this is optimal for any typical arrangement of the detector positions. We further study the sorter's sensitivity to wavelength and random phase noise.},
}This project is licensed under the MIT License. See the LICENSE file for details.
This project uses the following libraries: