tidy3d.KerrNonlinearity#
- class KerrNonlinearity[source]#
- Bases: - NonlinearModel- Model for Kerr nonlinearity which gives an intensity-dependent refractive index of the form \(n = n_0 + n_2 I\). The expression for the nonlinear polarization is given below. - Parameters:
- attrs (dict = {}) โ Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, - attrsare mutable. For example, the following is allowed for setting an- attr- obj.attrs['foo'] = bar. Also note that Tidy3D` will raise a- TypeErrorif- attrscontain objects that can not be serialized. One can check if- attrsare serializable by calling- obj.json().
- use_complex_fields (bool = False) โ Whether to use the old deprecated complex-fields implementation. The default real-field implementation is more physical and is always recommended; this option is only available for backwards compatibility with Tidy3D version < 2.8 and may be removed in a future release. 
- n2 (Union[tidycomplex, ComplexNumber] = 0) โ [units = um^2 / W]. Nonlinear refractive index in the Kerr nonlinearity. 
- n0 (Union[tidycomplex, ComplexNumber, NoneType] = None) โ Complex linear refractive index of the medium, computed for instance using โmedium.nk_modelโ. If not provided, it is calculated automatically using the central frequencies of the simulation sources (as long as these are all equal). 
 
 - Notes - This model uses real time-domain fields, so \(\n_2\) must be real. - This model is equivalent to a - NonlinearSusceptibility; the relation between the parameters is given below.\[\begin{split}P_{NL} = \varepsilon_0 \chi_3 |E|^2 E \\ n_2 = \frac{3}{4 n_0^2 \varepsilon_0 c_0} \chi_3\end{split}\]- In these equations, \(n_0\) means the real part of the linear refractive index of the medium. - To simulate nonlinear loss, consider instead using a - TwoPhotonAbsorptionmodel, which implements a more physical dispersive loss of the form \(\chi_{TPA} = i \frac{c_0 n_0 \beta}{\omega} I\).- The nonlinear constitutive relation is solved iteratively; it may not converge for strong nonlinearities. Increasing - tidy3d.NonlinearSpec.num_iterscan help with convergence.- For complex fields (e.g. when using Bloch boundary conditions), the nonlinearity is applied separately to the real and imaginary parts, so that the above equation holds when both \(E\) and \(P_{NL}\) are replaced by their real or imaginary parts. The nonlinearity is only applied to the real-valued fields since they are the physical fields. - Different field components do not interact nonlinearly. For example, when calculating \(P_{NL, x}\), we approximate \(|E|^2 \approx |E_x|^2\). This approximation is valid when the \(E\) field is predominantly polarized along one of the - x,- y, or- zaxes.- Example - >>> kerr_model = KerrNonlinearity(n2=1) - Attributes - Whether the model uses complex fields. - Methods - Inherited Common Usage - use_complex_fields#
 - n2#
 - n0#
 - property complex_fields#
- Whether the model uses complex fields. 
 - __hash__()#
- Hash method.