This project uses machine learning to aid in turbulence affected optical communication and networks. This code includes simulation in python for generating higher order Ince, Hermite, and Laguerre Gaussian modes.
- Generation of higher order Ince, Hermite, and Laguerre Gaussian modes.
- Add turbulence
- Model propagation
- Generate data-sets for machine learning projects
- Use generative models for denoising spatial modes
- Use classifying convolutional neural networks for mode classification
If you use this code, we ask that you cite:
Manon P. Bart, Sita Dawanse, Nicholas J. Savino, Viet Tran, Tianhong Wang, Sanjaya Lohani, Farris Nefissi, Pascal Bassène, Moussa N’Gom, and Ryan T. Glasser, "Classification of single photons in higher-order spatial modes via convolutional neural networks," Opt. Lett. 50, 2820-2823 (2025)
This project simulates and analyzes higher-order spatial modes of light for use in turbulence-affected optical communication. The main focus is on Hermite-Gaussian (HG), Laguerre-Gaussian (LG), and Ince-Gaussian (IG) beams, their propagation, and their interaction with turbulence.
where
-
Laguerre-Gaussian (LG) modes
Defined in cylindrical coordinates with circular symmetry and orbital angular momentum (OAM).
where
$L_n^{|\ell|}$ are generalized Laguerre polynomials,$\ell$ is the azimuthal index (OAM). -
Ince-Gaussian (IG) modes
Defined in elliptical coordinates with an ellipticity parameter$\epsilon$ . They interpolate smoothly between HG and LG families.
where
$\mathcal{C}_{p,m}^{e/o}$ are even/odd Ince polynomials and$\epsilon$ controls ellipticity.
Atmospheric turbulence is simulated using the Kolmogorov/Von Kármán model.
The turbulence strength is quantified by the structure constant
-
Weak turbulence:
$C_n^2 \approx 10^{-17},\text{m}^{-2/3}$ -
Strong turbulence:
$C_n^2 \approx 10^{-13},\text{m}^{-2/3}$
A smaller inner scale
Beam propagation is modeled with the Angular Spectrum Method (AS). This method decomposes the field into plane waves, propagates each independently, and reconstructs the beam after a chosen distance. It is efficient and well-suited for simulating free-space optical communication.
In summary, this repository lets you:
- Generate HG, LG, and IG modes of arbitrary order.
- Propagate them using the Angular Spectrum Method.
- Add turbulence to model realistic free-space communication conditions.
- Build datasets for training denoising and classifying machine learning models for mode recognition and classification.
To use both the beam generator and the denoising machine learning model, you will need to run:
pip install git+https://github.com/manonpbart/Machine-Learning-for-Optical-Communication.git#subdirectory=beam_project
import beam_simulation as bs
Information for generating modes can be found with further detail in beam_project/examples/GeneratingBeams.ipynb, which includes several examples of how to use the beam_simulation package. Once the beam_simulation package is downloaded, many different optical set ups can be configured using:
bs.Config(wavelength=795e-9, size_x=400, size_y=400, pixel_size=8e-6,w0=0.35e-3)
which gives the user the ability to change the wavelength, field-of-view, pixel size, beam waist, and more.
Following this, different beams can be generated using:
E_lg = bs.lg(p=2, l=1)
E_hg = bs.hg(n=2, m=3)
E_ig = bs.ig(p=4, m=2, beam="e", elliptic_param=2)
where the elliptic parameter as well as even or odd modes can also be changed.
Propagation of modes can be done using:
E_prop = bs.propagation(E_lg, z=20e-2)
Turbulence can be added for varying Cn2 values:
phi_turb = bs.turbulence(Cn2=38e-12, l_max=25, l_min=1e-3)
E_turb = E_lg * np.exp(1j * phi_turb)
E_turb_prop = bs.propagation(E_turb, z=20e-2)
Beyond just singular modes, this packages allows you to generate data sets containing many different LG, IG, HG modes at different turbulence levels. More information on how to generate these modes is shown below.
For machine learning tasks, large data sets must be created. The data set generation and a full denoising convolutional autoencoder is presented in beam_project/examples/GenerativeModel.ipynb or beam_project/examples/SimpleClass.ipynb
Using the beam simulation package, data sets can be created using
from beam_simulation.create_oam_list import GenerateOAM
gen = GenerateOAM(
mode_types=["LG"],
orders={
"LG": {"p": [0,1,1], "l": [1,2,1]}, #pairs of order numbers
"HG": {"n": [0, 1], "m": [1, 2]}
},
Cn2_list=[71.8e-13, 30.2e-12, 12e-12], #different turbulence levels
n_samples=400 #number of images per mode and order
)
which can generate different pairs of LG, HG, and IG modes as well as change the number of images and the different turbulence strengths. The mode and order numbers can be visualized using:
gen.visualize("LG", "p1_l2", Cn2=71.8e-13)
In the GenerativeModel code, there is a denoising convolutional autoencoder which reduces the effects of turbulence on input images. The full code can be found under beam_project/examples/GenerativeModel.ipynb. This can be called using:
autoenc = ConvAutoencoder(
input_shape=images.shape[1:],
latent_dim=64, #size of latent vector
conv_filters=[32, 16, 8], #determines filter sizw and number of filters
use_batchnorm=True, #batch normalization helps with normalizing during training
use_pool=True,
pool_size = 2,
pool_where = [0], #pool where determines where to add a pooling layer
decoder_activation='linear'
)
#Splitting everything
x_train, x_test, y_train, y_test = train_test_split(
images, labels, test_size=0.2, random_state=42, shuffle=True)
#Training
history = autoenc.train(x_train, y_train, x_test, y_test, epochs=15, batch_size=32)
The images can then be reconstructed using:
xtest_decoded = autoenc.reconstruct(x_test)
Outputs of the denoising CAE and the input images are shown here:
The data set generation and classification project is presented in beam_project/examples/SimpleClass.ipynb.