tidy3d.PerturbationAnisotropicMedium#
- class PerturbationAnisotropicMedium[source]#
Bases:
AnisotropicMedium,AbstractPerturbationMediumDiagonally anisotropic medium with perturbations. Each diagonal component is a uniform isotropic medium, and may carry its own heat and charge perturbations as a
PerturbationMediumorPerturbationPoleResidue. Theelectro_optic_specmodel of the medium changes the three components differently.- Parameters:
subpixel (bool = True) – This value will be transferred to the resulting custom medium. That is, if
True, the subpixel averaging will be applied to the custom medium. The type of subpixel averaging method applied is specified inSimulation’s fieldsubpixel. If the resulting medium is not a custom medium (no perturbations), this field does not have an effect.electro_optic_spec (Optional[
ElectroOpticPerturbation] = None) – Change of the refractive index by a static electric field, applied when anelectric_fieldis given toperturbed_copy. The medium then becomes aCustomAnisotropicMedium, to which the heat and charge perturbations add. A medium withelectro_optic_speccannot have anonlinear_spec.name (Optional[str] = None) – Optional unique name for medium.
frequency_range (Optional[tuple[float, float]] = None) – [units = (Hz, Hz)]. Optional range of validity for the medium.
allow_gain (Optional[bool] = None) – This field is ignored. Please set
allow_gainin each componentnonlinear_spec (Optional[Union[
NonlinearSpec,NonlinearSusceptibility]] = None) – Nonlinear spec applied on top of the base medium properties.modulation_spec (Optional[
ModulationSpec] = None) – Modulation spec applied on top of the base medium properties.viz_spec (Optional[
VisualizationSpec] = None) – Plotting specification for visualizing medium.heat_spec (Optional[Union[
FluidSpec,SolidSpec,SolidMedium,FluidMedium]] = None) – DEPRECATED: UseMultiPhysicsMedium. Specification of the medium heat properties. They are used for solving the heat equation via theHeatSimulationinterface. Such simulations can beused for investigating the influence of heat propagation on the properties of optical systems. Once the temperature distribution in the system is found usingHeatSimulationobject,Simulation.perturbed_mediums_copy()can be used to convert mediums with perturbation models defined into spatially dependent custom mediums. Otherwise, theheat_specdoes not directly affect the running of an opticalSimulation.xx (Union[
Medium,PoleResidue,Sellmeier,Lorentz,Debye,Drude,PerturbationMedium,PerturbationPoleResidue]) – Medium describing the xx-component of the diagonal permittivity tensor.yy (Union[
Medium,PoleResidue,Sellmeier,Lorentz,Debye,Drude,PerturbationMedium,PerturbationPoleResidue]) – Medium describing the yy-component of the diagonal permittivity tensor.zz (Union[
Medium,PoleResidue,Sellmeier,Lorentz,Debye,Drude,PerturbationMedium,PerturbationPoleResidue]) – Medium describing the zz-component of the diagonal permittivity tensor.
Note
subpixelapplies to every component of the resulting custom medium, and the components cannot have their ownelectro_optic_specmodel.Example
>>> import numpy as np >>> from tidy3d import C_0, ElectroOpticPerturbation, Medium, RotationAroundAxis >>> eo = ElectroOpticPerturbation.from_trigonal_3m( ... r13=10e-6, ... r22=5e-6, ... r33=30e-6, ... r51=30e-6, ... freq=C_0 / 1.55, ... rotation=RotationAroundAxis(axis=0, angle=-np.pi / 2), ... ) >>> crystal = PerturbationAnisotropicMedium( ... xx=Medium(permittivity=4.9), ... yy=Medium(permittivity=4.6), ... zz=Medium(permittivity=4.9), ... electro_optic_spec=eo, ... )
Attributes
allow_gainnamefrequency_rangenonlinear_specmodulation_specviz_specheat_specsubpixelelectro_optic_specMethods
from_unperturbed(medium[, subpixel])Construct a medium with perturbation models from an unperturbed anisotropic one.
perturbed_copy([temperature, ...])Sample perturbations on provided heat, charge, and electric field data and create a custom medium.
- xx#
- yy#
- zz#
- classmethod from_unperturbed(medium, subpixel=True, **kwargs)[source]#
Construct a medium with perturbation models from an unperturbed anisotropic one.
- Parameters:
medium (
AnisotropicMedium) – A medium with no perturbation models.subpixel (bool = True) – Subpixel averaging of derivative custom medium.
**kwargs – Perturbation models of the new medium, such as
electro_optic_spec.
- Returns:
Resulting medium with perturbation model.
- Return type:
- perturbed_copy(temperature=None, electron_density=None, hole_density=None, interp_method='linear', electric_field=None)[source]#
Sample perturbations on provided heat, charge, and electric field data and create a custom medium. Any of
temperature,electron_density,hole_density, andelectric_fieldcan beNone. If all passed arguments areNone, or onlyelectric_fieldis given to a medium withoutelectro_optic_spec, the medium is returned unchanged. All provided fields must have identical coords.- Parameters:
temperature (Union[
SpatialDataArray,TriangularGridDataset,TetrahedralGridDataset] = None) – Temperature field data.electron_density (Union[
SpatialDataArray,TriangularGridDataset,TetrahedralGridDataset] = None) – Electron density field data.hole_density (Union[
SpatialDataArray,TriangularGridDataset,TetrahedralGridDataset] = None) – Hole density field data.interp_method (
Literal['nearest', 'linear'], optional) – Interpolation method to obtain heat and/or charge values that are not supplied at the Yee grids.electric_field (Union[tuple,
TriangularGridDataset,TetrahedralGridDataset] = None) – Static electric field (V/um), applied throughelectro_optic_spec. Either a tuple(Ex, Ey, Ez)of spatial fields,Nonefor a zero component, or an unstructured dataset with anaxisdimension, such asSteadyElectricFieldData.Eat one voltage.
- Returns:
Medium specification after application of heat, charge, and electric field data.
- Return type:
Union[AbstractMedium, AbstractCustomMedium]