tidy3d.ParameterPerturbation#
- class ParameterPerturbation[source]#
Bases:
Tidy3dBaseModelStores 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,
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().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
Whether perturbation is complex valued.
Provided perturbations as a list.
Range of possible parameter perturbation values due to both heat and charge effects.
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, andhole_densitymust be notNone. All provided fields must have identical coords.- Parameters:
temperature (Union[) β
] = None Temperature field data.
electron_density (Union[) β
] = None Electron density field data.
hole_density (Union[) β
] = None Hole density field data.
- Returns:
Union[ β
SpatialDataArray,TriangularGridDataset,TetrahedralGridDataset,] = None β Sampled perturbation field.
- property is_complex#
Whether perturbation is complex valued.
- __hash__()#
Hash method.