Material¶
Main class¶
- class NonlinearTMM.Material(wls, ns)[source]¶
Bases:
MaterialThis 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 forGetN.- 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
_Chi2Tensorhelper class to store second-order nonlinearity tensor.
- chi2
- 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
chi2is nonzero, False otherwise.- Returns:
- bool
True if chi2 tensor is nonzero, False otherwise.
Helper classes¶
- class NonlinearTMM._Chi2Tensor¶
Bases:
objectThis 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)