tidy3d.PerturbationAnisotropicMedium#

class PerturbationAnisotropicMedium[source]#

Bases: AnisotropicMedium, AbstractPerturbationMedium

Diagonally anisotropic medium with perturbations. Each diagonal component is a uniform isotropic medium, and may carry its own heat and charge perturbations as a PerturbationMedium or PerturbationPoleResidue. The electro_optic_spec model 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 in Simulation’s field subpixel. 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 an electric_field is given to perturbed_copy. The medium then becomes a CustomAnisotropicMedium, to which the heat and charge perturbations add. A medium with electro_optic_spec cannot have a nonlinear_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_gain in each component

  • nonlinear_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: Use MultiPhysicsMedium. Specification of the medium heat properties. They are used for solving the heat equation via the HeatSimulation interface. 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 using HeatSimulation object, Simulation.perturbed_mediums_copy() can be used to convert mediums with perturbation models defined into spatially dependent custom mediums. Otherwise, the heat_spec does not directly affect the running of an optical Simulation.

  • 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

subpixel applies to every component of the resulting custom medium, and the components cannot have their own electro_optic_spec model.

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

xx

yy

zz

allow_gain

name

frequency_range

nonlinear_spec

modulation_spec

viz_spec

heat_spec

subpixel

electro_optic_spec

Methods

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:

PerturbationAnisotropicMedium

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, and electric_field can be None. If all passed arguments are None, or only electric_field is given to a medium without electro_optic_spec, the medium is returned unchanged. All provided fields must have identical coords.

Parameters:
Returns:

Medium specification after application of heat, charge, and electric field data.

Return type:

Union[AbstractMedium, AbstractCustomMedium]