tidy3d.NonlinearSpec#
- class NonlinearSpec[source]#
Bases:
ABC
,Tidy3dBaseModel
Abstract 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,
attrs
are mutable. For example, the following is allowed for setting anattr
obj.attrs['foo'] = bar
. Also note that Tidy3D` will raise aTypeError
ifattrs
contain objects that can not be serialized. One can check ifattrs
are 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_iters
can help with convergence.Example
>>> nonlinear_susceptibility = NonlinearSusceptibility(chi3=1) >>> nonlinear_spec = NonlinearSpec(models=[nonlinear_susceptibility]) >>> medium = Medium(permittivity=2, nonlinear_spec=nonlinear_spec)
Attributes
Methods
Inherited Common Usage
- models#
- num_iters#
- __hash__()#
Hash method.