Material

Main class

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

Bases: Material

This class describes the optical parameters of nonlinear medium. Default contructor takes arrays of wavelengths and complex refractive indices and does linear interpolation. For shortcut __call__ is defined as 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.

Methods

GetN(wl)

Returns refractive index of material at specified wavelength.

IsNonlinear()

This method returns True if material nonlinearity tensor chi2 is nonzero, False otherwise.

Static(n)

Helper method to make material with constant refractive index.

__call__(*args, **kwargs)

Call self as a function.

FromLabPy

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()

This method returns True if material nonlinearity tensor chi2 is nonzero, False otherwise.

Returns:
bool

True if chi2 tensor is nonzero, False otherwise.

static Static(n)[source]

Helper method to make material with constant refractive index.

Parameters:
nfloat or complex

Constant value for refractive index

Returns:
None

Examples

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

Helper classes

class NonlinearTMM._Chi2Tensor

Bases: object

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

Methods

GetChi2Tensor

Returns rotated 3x3x3 second-order nonlinearity tensor.

Update(**kwargs)

This method changes the values of second-order nonlinearity tensor.

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)