tidy3d.Medium#

class Medium[source]#

Bases: AbstractMedium

Dispersionless medium. Mediums define the optical properties of the materials within the simulation.

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 (bool = False) – Allow the medium to be active. Caution: simulations with a gain medium are unstable, and are likely to diverge.Simulations where allow_gain is set to True will still be charged even if diverged. Monitor data up to the divergence point will still be returned and can be useful in some cases.

  • 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.

  • permittivity (Union[float, autograd.tracer.Box] = 1.0) – [units = None (relative permittivity)]. Relative permittivity.

  • conductivity (Union[float, autograd.tracer.Box] = 0.0) – [units = S/um]. Electric conductivity. Defined such that the imaginary part of the complex permittivity at angular frequency omega is given by conductivity/omega.

Notes

In a dispersion-less medium, the displacement field \(D(t)\) reacts instantaneously to the applied electric field \(E(t)\).

\[D(t) = \epsilon E(t)\]

The permittivity parameter is the relative permittivity (dimensionless). The conductivity parameter has units of S/μm (siemens per micrometer), consistent with Tidy3D’s micrometer-based unit system. To convert from standard S/m, divide by 1e6.

Practical Advice

Choosing a Material Type

  • Material is in td.material_library? → Use it directly (e.g. td.material_library['cSi']['Li1993_293K']).

  • Lossless, wavelength-independent refractive index? → td.Medium(permittivity=n**2).

  • Known n and k at a specific frequency? → td.Medium.from_nk(n=2.4, k=0.01, freq=freq0). Note: when k > 0, the resulting medium has wavelength-independent n but wavelength-dependent k.

  • You have n,k data vs wavelength? → Use FastDispersionFitter from tidy3d.plugins.dispersion to fit a pole-residue model.

  • Permittivity varies spatially? → Use CustomMedium with a SpatialDataArray.

  • Need an analytical dispersive model? → Use Sellmeier, Lorentz, Drude, Debye, or PoleResidue directly.

Common Library Materials (telecom, ~1.55 μm)

  • Silicon: td.material_library['cSi']['Li1993_293K'] (n ≈ 3.48)

  • SiO2: td.material_library['SiO2']['Palik_Lossless'] (n ≈ 1.44)

  • Si3N4: td.material_library['Si3N4']['Luke2015PMLStable'] (n ≈ 2.0)

  • Gold: td.material_library['Au']['JohnsonChristy1972']

  • Silver: td.material_library['Ag']['JohnsonChristy1972']

Example

>>> dielectric = Medium(permittivity=4.0, name='my_medium')
>>> eps = dielectric.eps_model(200e12)

Attributes

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.

permittivity

conductivity

name

frequency_range

allow_gain

nonlinear_spec

modulation_spec

viz_spec

heat_spec

Methods

eps_model(frequency)

Complex-valued permittivity as a function of frequency.

from_nk(n, k, freq, **kwargs)

Convert n and k values at frequency freq to Medium.

permittivity#
conductivity#
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 dispersiveless medium, it equals sqrt(permittivity).

eps_model(frequency)[source]#

Complex-valued permittivity as a function of frequency.

classmethod from_nk(n, k, freq, **kwargs)[source]#

Convert n and k values at frequency freq to Medium.

Parameters:
  • n (float) – Real part of refractive index.

  • k (float = 0) – Imaginary part of refrative index.

  • freq (float) – Frequency to evaluate permittivity at (Hz).

  • kwargs (dict) – Keyword arguments passed to the medium construction.

Returns:

medium containing the corresponding permittivity and conductivity.

Return type:

Medium