tidy3d.CustomAnisotropicMedium#

class CustomAnisotropicMedium[source]#

Bases: AbstractCustomMedium, AnisotropicMedium

Diagonally anisotropic medium with spatially varying permittivity in each component.

Parameters:
  • name (Attribute: name) –

    Type

    Optional[str]

    Default

    = None

    Description

    Optional unique name for medium.

  • frequency_range (Attribute: frequency_range) –

    Type

    Optional[Tuple[float, float]]

    Default

    = None

    Units

    (Hz, Hz)

    Description

    Optional range of validity for the medium.

  • allow_gain (Attribute: allow_gain) –

    Type

    Optional[bool]

    Default

    = None

    Description

    This field is ignored. Please set allow_gain in each component

  • nonlinear_spec (Attribute: nonlinear_spec) –

    Type

    Union[NonlinearSpec, NonlinearSusceptibility]

    Default

    = None

    Description

    Nonlinear spec applied on top of the base medium properties.

  • modulation_spec (Attribute: modulation_spec) –

    Type

    Optional[ModulationSpec]

    Default

    = None

    Description

    Modulation spec applied on top of the base medium properties.

  • heat_spec (Attribute: heat_spec) –

    Type

    Union[FluidSpec, SolidSpec, NoneType]

    Default

    = None

    Description

    Specification of the medium heat properties. They are used for solving the heat equation via the HeatSimulation interface. Such simulations can be used 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 (Attribute: xx) –

    Type

    Union[CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomMedium]

    Default

    Description

    Medium describing the xx-component of the diagonal permittivity tensor.

  • yy (Attribute: yy) –

    Type

    Union[CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomMedium]

    Default

    Description

    Medium describing the yy-component of the diagonal permittivity tensor.

  • zz (Attribute: zz) –

    Type

    Union[CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomMedium]

    Default

    Description

    Medium describing the zz-component of the diagonal permittivity tensor.

  • interp_method (Attribute: interp_method) –

    Type

    Optional[Literal[β€˜nearest’, β€˜linear’]]

    Default

    = None

    Description

    When the value is β€˜None’, each component will follow its own interpolation method. When the value is other than β€˜None’, the interpolation method specified by this field will override the one in each component.

  • subpixel (Attribute: subpixel) –

    Type

    Optional[bool]

    Default

    = None

    Description

    This field is ignored. Please set subpixel in each component

Note

Only diagonal anisotropy is currently supported.

Example

>>> Nx, Ny, Nz = 10, 9, 8
>>> x = np.linspace(-1, 1, Nx)
>>> y = np.linspace(-1, 1, Ny)
>>> z = np.linspace(-1, 1, Nz)
>>> coords = dict(x=x, y=y, z=z)
>>> permittivity= SpatialDataArray(np.ones((Nx, Ny, Nz)), coords=coords)
>>> conductivity= SpatialDataArray(np.ones((Nx, Ny, Nz)), coords=coords)
>>> medium_xx = CustomMedium(permittivity=permittivity, conductivity=conductivity)
>>> medium_yy = CustomMedium(permittivity=permittivity, conductivity=conductivity)
>>> d_epsilon = SpatialDataArray(np.random.random((Nx, Ny, Nz)), coords=coords)
>>> f = SpatialDataArray(1+np.random.random((Nx, Ny, Nz)), coords=coords)
>>> delta = SpatialDataArray(np.random.random((Nx, Ny, Nz)), coords=coords)
>>> medium_zz = CustomLorentz(eps_inf=permittivity, coeffs=[(d_epsilon,f,delta),])
>>> anisotropic_dielectric = CustomAnisotropicMedium(xx=medium_xx, yy=medium_yy, zz=medium_zz)

Attributes

is_isotropic

Whether the medium is isotropic.

n_cfl

This property computes the index of refraction related to CFL condition, so that the FDTD with this medium is stable when the time step size that doesn't take material factor into account is multiplied by n_cfl.

Methods

eps_dataarray_freq(frequency)

Permittivity array at frequency.

xx#
yy#
zz#
interp_method#
allow_gain#
subpixel#
property n_cfl#

This property computes the index of refraction related to CFL condition, so that the FDTD with this medium is stable when the time step size that doesn’t take material factor into account is multiplied by n_cfl.

For this medium, it takes the minimal of n_clf in all components.

property is_isotropic#

Whether the medium is isotropic.

eps_dataarray_freq(frequency)[source]#

Permittivity array at frequency.

Parameters:

frequency (float) – Frequency to evaluate permittivity at (Hz).

Returns:

The permittivity evaluated at frequency.

Return type:

Tuple[SpatialDataArray, SpatialDataArray, SpatialDataArray]

__hash__()#

Hash method.