tidy3d.ParameterPerturbation#

class ParameterPerturbation[source]#

Bases: Tidy3dBaseModel

Stores information about parameter perturbations due to different physical effect. If both heat and charge perturbation models are included their effects are superimposed.

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().

  • heat (Union[LinearHeatPerturbation, CustomHeatPerturbation] = None) – Heat perturbation to apply.

  • charge (Union[LinearChargePerturbation, CustomChargePerturbation] = None) – Charge perturbation to apply.

Example

>>> from tidy3d import LinearChargePerturbation, CustomHeatPerturbation, HeatDataArray
>>>
>>> perturbation_data = HeatDataArray([0.001, 0.002, 0.004], coords=dict(T=[250, 300, 350]))
>>> heat_perturb = CustomHeatPerturbation(
...     perturbation_values=perturbation_data
... )
>>> charge_perturb = LinearChargePerturbation(
...     electron_ref=0,
...     electron_coeff=0.0001,
...     electron_range=[0, 1e19],
...     hole_ref=0,
...     hole_coeff=0.0002,
...     hole_range=[0, 2e19],
... )
>>> param_perturb = ParameterPerturbation(heat=heat_perturb, charge=charge_perturb)

Attributes

is_complex

Whether perturbation is complex valued.

perturbation_list

Provided perturbations as a list.

perturbation_range

Range of possible parameter perturbation values due to both heat and charge effects.

attrs

Methods

apply_data([temperature,Β electron_density,Β ...])

Sample perturbations on provided heat and/or charge data.

Inherited Common Usage

heat#
charge#
property perturbation_list#

Provided perturbations as a list.

property perturbation_range#

Range of possible parameter perturbation values due to both heat and charge effects.

apply_data(temperature=None, electron_density=None, hole_density=None)[source]#

Sample perturbations on provided heat and/or charge data. At least one of temperature, electron_density, and hole_density must be not None. All provided fields must have identical coords.

Parameters:
Returns:

property is_complex#

Whether perturbation is complex valued.

__hash__()#

Hash method.