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 an attr obj.attrs['foo'] = bar. Also note that Tidy3D` will raise a TypeError if attrs contain objects that can not be serialized. One can check if attrs are serializable by calling obj.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.