tidy3d.NonlinearSpec#
- class NonlinearSpec[source]#
Bases:
ABC,Tidy3dBaseModelAbstract specification for adding nonlinearities to a medium.
- 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 anattrobj.attrs['foo'] = bar. Also note that Tidy3D` will raise aTypeErrorifattrscontain objects that can not be serialized. One can check ifattrsare serializable by callingobj.json().models (Tuple[Union[NonlinearSusceptibility, TwoPhotonAbsorption, KerrNonlinearity], ...] = ()) β The nonlinear models present in this nonlinear spec. Nonlinear models of different types are additive. Multiple nonlinear models of the same type are not allowed.
num_iters (PositiveInt = 5) β Number of iterations for solving nonlinear constitutive relation.
Note
The nonlinear constitutive relation is solved iteratively; it may not converge for strong nonlinearities. Increasing
num_iterscan help with convergence.Example
>>> nonlinear_susceptibility = NonlinearSusceptibility(chi3=1) >>> nonlinear_spec = NonlinearSpec(models=[nonlinear_susceptibility]) >>> medium = Medium(permittivity=2, nonlinear_spec=nonlinear_spec)
Attributes
List of available aux fields in all present models.
Methods
Inherited Common Usage
- models#
- num_iters#
- property aux_fields#
List of available aux fields in all present models.
- __hash__()#
Hash method.