tidy3d.CustomAnisotropicMedium#

class CustomAnisotropicMedium[source]#

Bases: AbstractCustomMedium, AnisotropicMedium

Diagonally anisotropic medium with spatially varying permittivity in each component.

Parameters:
  • 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 (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.

  • heat_spec (Union[FluidSpec, SolidSpec, NoneType] = None) – 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 (Union[CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomMedium]) – Medium describing the xx-component of the diagonal permittivity tensor.

  • yy (Union[CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomMedium]) – Medium describing the yy-component of the diagonal permittivity tensor.

  • zz (Union[CustomPoleResidue, CustomSellmeier, CustomLorentz, CustomDebye, CustomDrude, CustomMedium]) – Medium describing the zz-component of the diagonal permittivity tensor.

  • interp_method (Optional[Literal['nearest', 'linear']] = None) – 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 (Optional[bool] = None) – 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.