ndispers, Dispersion calculation package for nonlinear/ultrafast optics

ndispers is a Python package for calculating refractive index dispersion of various crystals and glasses used in nonlinear/ultrafast optics. It is based on Sellmeier equartions \(n(\lambda)\) and thermo-optic coefficients (dn/dT) reported in literature.

As an example, calculation of refractive indices of \(\beta\)-BBO crystal as a function of wavelength of light, when the polar (\(\theta\)) angle is \(\pi/2\) radians, the crystal temperature is 40 degree C. and the light polarization is extraordinary, is written as following lines of code:

>>> import ndispers
>>> import numpy as np
>>> bbo = ndispers.media.crystals.BetaBBO_Eimerl1987()
>>> wl_ar = np.arange(0.2, 1.2, 0.2) # wavelength in micrometer
>>> bbo.n(wl_ar, 0.5*np.pi, 40, pol='e')
array([1.70199324, 1.56855192, 1.55177472, 1.54599759, 1.54305826])

General Overview

There are some softwares available for nonlinear optics. Probably the most famous and extensive one is SNLO, by Arlee V. Smith (https://as-photonics.com/products/snlo/ for Windows OS only). Other web applications exist to calculate refractive indices simply as a function of wavelength (https://refractiveindex.info/) or phase-matching conditions (http://toolbox.lightcon.com/ for uniaxial crystals only, https://apps.apple.com/jp/app/iphasematch/id492370060 for iOS only). These apps are easy and quick to use, but most of them are not open source and black box; users could not look into how it was calculated and often what paper it is based on, and are not allowed to extend the software by themselves for their particular purpose.

This open-source Python project, ndispers, was created for those reasearchers, engineers and students who want to study and employ in depth nonlinear/anisotropic crystals and dispersive media, and is intended to be built in their numerical simulation programs and Jupyter notebooks. At the moment of this writing, the variety of crystals and glasses available is limited, but you can request or contribute on GitHub to add more, new crystals and methods.

User guide

This section introduces users to basic usage of ndispers package.

Installation

ndispers works on Python 3.7 or higher.

You can install it using pip:

$ pip install ndispers

Check the version installed is the latest. If not, specify the latest version by:

$ pip install ndispers==x.y.z

To uninstall:

$ pip uninstall ndispers

To update version:

$ pip install -U ndispers
Testing your installation

You can check that ndispers is working correctly by starting up a python shell.

In [1]: import ndispers as nd

In [2]: nd.media.crystals.BetaBBO_Eimerl1987()
Out[2]: <ndispers.media.crystals._betaBBO_Eimerl1987.BetaBBO at 0x105368d50>

Here you can see that beta-BBO object is created (Please do not forget that in In[2] () is needed to get a mediaum object). If it fails, feel free to open an issue in issue tracker.

Note

It is strongly reccomended using IPython shell or JupyterLab because they have Tab completion function, which is very useful to search for available crystals and glasses.

Basic usage

Indices and tables