This is a fork of the original PyNLO, a package for modeling the nonlinear interaction of light with matter. It started as an attempt to add 2nd-order nonlinearities to the pulse propagation model and grew into a large-scale rewrite. It is not yet at feature parity with the original, but it is getting close! Contributions and suggestions are welcome.
Complete documentation for PyNLO can be found on the repository's GitHub Pages website.
The PyNLO package provides an easy-to-use, object-oriented set of tools for modeling the nonlinear interaction of light with matter. It provides many functionalities for representing pulses of light and nonlinear materials.
Features:
-
A solver for the propagation of light through materials with both 2nd- and 3rd-order nonlinearities.
-
A highly-efficient adaptive step size algorithm based on the ERK4(3)-IP method from Balac and Mahé (2013).
-
A flexible object-oriented system for treating laser pulses and optical modes.
-
...and much more!
The FFT backend FFTW3 makes this version of PyNLO cross-platform.
PyNLO is designed to work most easily with the miniconda distribution. For a functional installation with conda, run,
git clone https://github.com/UCBoulder/PyNLO.git
cd pynlo
conda activate base
conda install -c conda-forge unidep=3
unidep install -n pynlo .
conda activate pynlo
This command clones the repo to your machine and installs it in a new conda environment named pynlo. Test out your installation with the scripts in the examples folder.
PyNLO is designed to use with conda but uses unidep for packaging, which has compatibility with pip. However, PyNLO relies on FFTW3, which does not ship with the pip distribution of pyfftw by default. This must be installed separately, so using conda (which has FFTW3 packaged with it) is highly recommended.
If you're looking to make changes to the source code of pynlo, add the -e flag so that changes made on the local version of the repository are reflected in your local scripts:
git clone https://github.com/UCBoulder/PyNLO.git
cd pynlo
conda activate base
conda install -c conda-forge unidep=3
unidep install -n pynlo -e .
conda activate pynlo
Open an issue or discussion on the GitHub repository to add suggestions for improvement, ask questions, or make other comments. Additions to the tests, examples, and documentation are highly appreciated. New contributions should be based off the develop branch.
PyNLO is licensed under the GNU LGPLv3 license. This means that you are free to use PyNLO for any project, but all modifications to it must be kept open source. PyNLO is provided "as is" with absolutely no warranty.