Package Overview#

In PyNLO, object-oriented programming is used to emulate physical objects. Whenever possible each physical entity with intrinsic properties is mapped to a Python class, e.g. an optical pulse or nonlinear fiber. These classes keep track of the objects’ properties and provide simple calculator-type helper functions.

Time and Frequency Grids#

The core functionality of this package is built off of the time and frequency grids given by the pynlo.utility.TFGrid class. These grids represent physical coordinate spaces. Critically, the frequency grid is only defined for positive frequencies and is aligned to the origin. This facilitates inverse Fourier transforms using both real-valued representations and analytic, or complex-envelope representations. See the notes on Fourier transforms for more details.

Pulses#

Optical pulses are represented in PyNLO with pynlo.light.Pulse objects. These contain methods for accessing the time and frequency domain properties of the pulse and the underlying time and frequency grids. There are several convenience methods for generating pulses from pre-defined shapes (Sech(), Gaussian(), etc.) and from existing spectral data (FromPowerSpectrum()).

Modes#

PyNLO represents the modes within an optical medium as pynlo.medium.Mode objects. In addition to the linear properties (i.e. the phase and gain coefficients \(\beta\) and \(\alpha\)), they also contain an optical mode’s effective 2nd- and 3rd-order nonlinearity. If a material has properties that are \(z\) dependent, those properties can be input as functions who’s first argument is the propagation distance.

Models#

The propagation models implemented in PyNLO are found in pynlo.model. While derived through multi-mode expansion of Maxwell’s equations (see the notes on nonlinear optics for more details), only single-mode simulations are currently supported. Models are initialized with Pulse and Mode objects. Simulation specific parameters (propagation distance, local error, etc.) should be entered when running a model’s simulate() method. Real-time visualizations of a simulation are available by setting the simulate method’s plot keyword.

Utilities#

The pynlo.utility module includes the TFGrid class, miscellaneous helper functions (taylor_series(), vacuum(), etc.), as well as other calculator-type utilities. The utilities are organized into submodules based on their relationship to the linear (chi1) or nonlinear (chi2 and chi3) susceptibilities. The fast Fourier transforms used in PyNLO are defined in the fft submodule.