User Guide#

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!

Installation#

PyNLO requires Python 3. If you do not already have Python, the Miniconda distribution is a good place to start. PyNLO depends on the numpy, scipy, numba, and mkl_fft packages. The matplotlib package is necessary to view real-time simulation updates and to run the example code.

The most flexible way to install this fork is to download or clone the repository onto your computer, and then add the PyNLO directory to the sys.path variable before importing the package. If you have the Spyder IDE you can add the PyNLO directory with its PYTHONPATH manager, found under “Tools” on the menu bar.

Alternatively, you can install PyNLO using the local project functionality of pip, i.e.:

pip install path/to/PyNLO --no-deps

The path must be replaced with the actual path to the repository on your machine. Only use the --no-deps option if in a conda environment, in which case, you should separately install the dependencies using the conda install command.

Test out your installation with the scripts in the examples folder.

Contributing#

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.

License#

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.