Light propagation in free space with fourier transform
Project description
Light propagation
Lightprop2d includes class 'Beam2D' to transform intitial field distribution
using fourier transform from x-y field profile to kx-ky spectrum.
You can use both numpy and cupy backends with use_gpu
key of Beam2D class.
You can install it as follows
pip install lightprop2d==1.0.4
If you want to use cupy
to accelerate calculations, you must install extra packages with a command
pip install lightprop2d[gpu]
If you want to use pyfftw
to accelerate calculations, you must install extra packages with a command
pip install lightprop2d[fftw]
Check out the Code Reference for details on the 'Beam2D' methods.
Example 1: Random beam propagation
import matplotlib.pyplot as plt
from lightprop2d import Beam2D, random_round_hole, um, nm
# All input data are in cm
# XY grid dimensions
npoints = 256
# XY grid widening
beam_radius = 25*um # 25 um
area_size = 200*um # 200 um
# Wavelength in cm
wl0 = 632*nm
beam = Beam2D(area_size, npoints, wl0, init_field_gen=random_round_hole,
init_gen_args=(beam_radius,))
plt.imshow(beam.iprofile)
plt.show()
beam.propagate(100*um)
plt.imshow(beam.iprofile)
plt.show()
Funding
This work is supported by the Russian Science Foundation under grant No. 21-12-00155.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for lightprop2d-1.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6657b090caf58967256b458028eaf01ea90927fbac322b58a57920bfac55b5f |
|
MD5 | d1a617512f4acdd76f9bbe5c5eeaf977 |
|
BLAKE2b-256 | 0e95dff6feef86accdee8b65fcfca288dacde6ad6528e816ba2ff80de4683ae5 |