Optical Diffraction and Interference (scalar and vectorial)
Project description
Free software: MIT license
Documentation: https://diffractio.readthedocs.io/en/latest/
Features
Diffractio is a Python library for Diffraction and Interference Optics.
It implements Scalar and vector Optics. The main algorithms used are:
Fast Fourier Transform (FFT).
Rayleigh Sommerfeld (RS).
Chirp z-transform (CZT).
Plane Wave Descomposition (PWD).
Beam Propagation Method (BPM).
Wave Propagation Method (WPM).
Vectorial Rayleigh-Sommerfeld (VRS).
Vector Fast Fourier Tranform (VFFT).
Vector Chirp z-transform (VCZT).
When possible, multiprocessing is implemented for a faster computation.
The scalar propagation schemes are implemented in modules:
X - fields are defined in the x axis.
Z - fields are defined in the z axis (for visualiztion and analysis).
XZ - fields are defined in the xz plane, being z the propagation direction.
XY - fields are defined in the xy transversal plane.
XYZ - fields are defined in the xyz volume.
Each scheme present three modules:
sources: Generation of light.
masks: Masks and Diffractive Optical elements.
fields: Propagation techniques, parameters and general functions.
The vector propagation schemes are implemented in modules:
vector_XY - Ex, Ey, and Ez electric field components are defined, which allows polarization analysis.
There are additional schemes used mainly for representation.
vector_X - fields are defined in the z axis (for visualiztion and analysis).
vector_Z - fields are defined in the z axis (for visualiztion and analysis).
vector_XZ - fields are defined in the xz axis (for visualiztion and analysis).
vector_XYZ - fields are defined in the xyz axis (for visualiztion and analysis).
For the vector analysis, we also use the py_pol module: https://pypi.org/project/py-pol/
Sources
One main part of this software is the generation of optical fields such as:
Plane waves.
Spherical waves.
Gaussian beams.
Bessel beams.
Vortex beams.
Laguerre beams.
Hermite-Gauss beams.
Zernike beams.
Masks
Another important part of Diffractio is the generation of masks and Diffractive Optical Elements such as:
Slits, double slits, circle, square, ring …
Lenses, diffractive lenses, aspherical lenses…
Axicon, prisms, biprism, image, rough surface, gray scale …
Gratings: Ronchi, phase, radial, angular, sine, forked, blazed, 2D, chess…
In the XZ scheme there is also a number of masks:
image, sphere, layer, lenses, wedge, prism, probe, gratings…
Additionally, any X_mask can be extruded to the XZ scheme.
Masks from functions
Surfaces can be added to objects
Fields
Several propagation algorithms for propagation of light are implemented in the fields modules:
Fast Fourier Transform (FFT) which allows, in a single step, to determine the field at the far field.
Rayleigh-Sommerfeld (RS) [Appl. Opt., 45(6) 1102–1110, (2006)] RS allows, in a single step, to propagate to a near or far observation plane, which allows fast computations. The fields and the masks must be defined in a plane.
Beam propagation method (BPM) [Appl. Opt. 24, 3390-3998 (1978)] which allows to analyze the propation of light in volumetric elements, such as spheres, cylinders and other complex forms, provided that the spatial variations in the refraction index are small. It allows graded index structures. It presents a complexity of O(n) in the two-dimensional and O(n2) in the three-dimensional case. It is computed according to the split-step propagation scheme.
Wave Propagation Method (WPM). [Appl. Opt. 32, 4984 (1993)] WPM was introduced in order to overcome the major limitations of the beam propagation method (BPM). With the WPM, the range of application can be extended from the simulation of waveguides to simulation of other optical elements like lenses, prisms and gratings. WPM can accurately simulate scalar light propagation in inhomogeneous media at high numerical apertures, and provides valid results for propagation angles up to 85° and that it is not limited to small index variations in the axis of propagation. Fast implementation with discrete number of refraction indexes is also implemented.
Chirped Z-Transform (CZT). [Light: Science and Applications, 9(1), (2020)] CZT allows, in a single step, to propagate to a near or far observation plane. It present advantages with respecto to RS algorithm, since the region of interest and the sampling numbers can be arbitrarily chosen, endowing the proposed method with superior flexibility. CZT algorithm allows to have a XY mask and compute in XY, Z, XZ, XYZ schemes, simply defining the output arrays.
Vector Rayleigh-Sommerfeld (VRS). The VRS method [Laser Phys. Lett. 10(6) 065004 (2013)] allows to propagate (Ex,Ey,Ez) fields offering the advantage of significant reduction in computation, from flat diffractive elements (Thin Element Approximation) with full control of polarization. It addresses simultaneously both longitudinal polarization. This approach offers the advantage of significant reduction in computation.
Vector Chirped Z-Transform (VCZT). [Light: Science and Applications, 9(1), (2020)]. CZT is also implemented in vector fields.
“””
The fields, masks and sources can be stored in files.
Also drawings can be easily obtained, for intensity, phase, fields, etc.
In some modules, videos can be generated for a better analysis of optical fields.
Vector beams
Here, we implement new classes where the E_x, E_y, and E_z fields are generated and propagated using Rayleigh-Sommerfeld and Chirped z-transform algorithms. Also, simple and complex polarizing masks can be created.
Intensity of vector field
Polarization: Stokes parameters
Other features
Intensity, MTF and other parameters are obtained from the optical fields.
Fields can be added simply with the + signe, and interference is produced. Masks can be multiplied, added and substracted in order to make complex structures
Resampling fields in order to analyze only areas of interest.
Save and load data for future analysis.
Rayleigh-Sommerfeld implementation is performed in multiprocessing for fast computation.
Polychromatic and extended source problems can also be analyzed using multiprocessing.
Citing
L.M. Sanchez Brea, “Diffractio, python module for diffraction and interference optics”, https://pypi.org/project/diffractio/ (2019)
References for algorithms
RS
Shen, F. & Wang, A. “Fast-Fourier-transform based numerical integration method for the Rayleigh-Sommerfeld diffraction formula. Appl. Opt. 45, 1102–1110 (2006).
WPM
K.-H. Brenner, W. Singer, “Light propagation through micro lenses: a new simulation method”, Appl. Opt., 32(6) 4984-4988 (1993).
Schmidt, S. et al. “Wave-optical modeling beyond the thin-element-approximation” Opt. Express 24, 30188 (2016).
Brenner, K.H. “A high-speed version of the wave propagation method applied to micro-optics.” 16th Workshop on Information Optics (WIO). IEEE (2017)
Schmidt, S., et al. “Rotationally symmetric formulation of the wave propagation method-application to the straylight analysis of diffractive lenses” Opt. Lett. 42, 1612 (2017).
VRS
Ye, H. et al. “Creation of a longitudinally polarized subwavelength hotspot with an ultra-thin planar lens: Vectorial Rayleigh-Sommerfeld method” Laser Phys. Lett. 10, (2013).
CZT
Bluestein, L., “A linear filtering approach to the computation of the discrete Fourier transform,” Northeast Electronics Research and Engineering Meeting Record 10, 218-219 (1968).
Hu Y. et al. “Efficient full-path optical calculation of scalar and vector diffraction using the Bluestein method” Light: Science & Applications 9(119) (2020)
VCZT
Leutenegger M. et al. “Fast focus field calculations” Optics Express 14(23) 11277 (2006).
Hu Y. et al. “Efficient full-path optical calculation of scalar and vector diffraction using the Bluestein method” Light: Science & Applications 9(119) (2020)
VWPM (not implemented yet)
Fertig, M., Brenner, K.-H. “Vector wave propagation method”. J. Opt. Soc. Am. A 27, 709 (2010).
Fertig, M., Brenner, K.-H. “Vector wave propagation method”. PhD thesis (Mannheim, 2010).
Other References
J.W. Goodman, “Introduction to Fourier Optics” McGraw-Hill, 1996.
B.E. Saleh y M. C. Teich, “Fundamentals of photonics” John Wiley & Sons, 2019.
Z.Qiwen, “Vectorial optical fields: Fundamentals and applications” World scientific, 2013.
“Numerical Methods in Photonics Lecture Notes”. http://ecee.colorado.edu/~mcleod/teaching/nmip/lecturenotes.html.
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
pytest –cov=diffractio tests/
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
File details
Details for the file diffractio-0.2.4.tar.gz
.
File metadata
- Download URL: diffractio-0.2.4.tar.gz
- Upload date:
- Size: 45.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cd1307fd856a0bb0c03718e66ab840759e373c9ad21458f0ed40e4b44bdb078 |
|
MD5 | 97b1183532f99834c8a30ddb4a286379 |
|
BLAKE2b-256 | 97e131ad39ea48536fab0cefa08354c037e7de73792f9a170701644e308e17b8 |
File details
Details for the file diffractio-0.2.4-py2.py3-none-any.whl
.
File metadata
- Download URL: diffractio-0.2.4-py2.py3-none-any.whl
- Upload date:
- Size: 187.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b99549fed9a45f121bde3e4fa50beba0ee7c3fe96f0a817500cf637150ec01e |
|
MD5 | aa7321f64294a88fd442412aa3ae7835 |
|
BLAKE2b-256 | aa7060be8b87bf7b6953fee8fb733278d8d8d35b09c245401ea59aa9fbc6e392 |