Material

Main class

class NonlinearTMM.Material(wls, ns)[source]

Bases: Material

This class describes the optical parameters of a nonlinear medium. The default constructor takes arrays of wavelengths and complex refractive indices and performs linear interpolation. As a shortcut, __call__ is defined as an alias for GetN.

Parameters:
wlsndarray of floats

Array of wavelengths (m)

nsndarray of complex floats

Corresponding complex refractive indices to the wls array.

Attributes:
chi2_Chi2Tensor

Instance of the _Chi2Tensor helper class to store second-order nonlinearity tensor.

static FromLabPy(materialLabPy: Any) Material[source]

Create a Material from a LabPy Material instance.

Parameters:
materialLabPyLabPy.Material

Source material object from the LabPy test helpers.

Returns:
Material
GetN(wl)

Returns refractive index of material at specified wavelength.

Parameters:
wlfloat

Wavelength in meters.

Returns:
complex

Complex refractive index at wavelength wl.

Examples

>>> wls = np.array([400e-9, 600e-9, 800e-9], dtype = float)
>>> ns = np.array([1.5 + 0.3j, 1.7 + 0.2j, 1.8 + 0.1j], dtype = complex)
>>> mat = Material(wls, ns)
>>> mat(600e-9)
1.7 + 0.2j
IsNonlinear()

Returns True if the material nonlinearity tensor chi2 is nonzero, False otherwise.

Returns:
bool

True if chi2 tensor is nonzero, False otherwise.

static Static(n: complex | float) Material[source]

Helper method to make material with constant refractive index.

Parameters:
nfloat or complex

Constant value for refractive index

Returns:
Material

Examples

>>> mat = Material.Static(1.5)
>>> mat.GetN(532e-9)
1.5

Helper classes

class NonlinearTMM._Chi2Tensor

Bases: object

This is a helper class for Material to accommodate the second-order susceptibility tensor. Allows setting nonlinearities by chi2- and by d-values. The initial tensor can be rotated around all three axes.

GetChi2Tensor()

Returns rotated 3x3x3 second-order nonlinearity tensor.

Returns:
ndarray(3, 3, 3) of floats
Update(**kwargs)

This method changes the values of second-order nonlinearity tensor. By default the tensor is zero, not rotated and distinctFields set to True.

Parameters:
chiXYZfloat, optional

Updates tensor value of second-order nonlinearity, where X, Y, Z denote numbers from 1..3 corresponding to x-, y-, z-axis.

dXKfloat, optional

Updates tensor values by contracted notation, where dXK = 0.5 * chiXYZ and K is defined as: 1 = 11; 2 = 22; 3 = 33; 4 = 23, 32; 5 = 31, 13; 6 = 12, 21.

distinctFieldsbool, optional

If set to True, then assumes that two input waves in nonlinear process are the same (e.g second harmonic generation). If False, then the input fields are not equal (as a result the result will be multiplied by 2). Default is true.

phiXfloat, optional

The rotation angle (radians) around x-axis of the second order nonlinear tensor.

phiYfloat, optional

The rotation angle (radians) around y-axis of the second order nonlinear tensor.

phiZfloat, optional

The rotation angle (radians) around z-axis of the second order nonlinear tensor.

Examples

Updates nonlinear tensor of material and then rotates it.

>>> mat = Material.Static(1.5)
>>> mat.chi2.Update(d11 = 1e-12, d22 = 2e-12, chi23 = 3e-12)
>>> mat.chi2.Update(phiX = 0.2, phiY = 0.5, phiZ = -0.1)