{
  "title": "Medium2D",
  "public_path": "flex_rf.tidy3d.Medium2D",
  "lookup_path": "tidy3d.Medium2D",
  "slug": "flex_rf/tidy3d/Medium2D",
  "public_url": "/rf/latest/autogenerated/flex_rf/tidy3d/medium2d/",
  "object_kind": "class",
  "introduction": "2D diagonally anisotropic medium.",
  "notes": "Only diagonal anisotropy is currently supported.",
  "examples": "```python\ndrude_medium = Drude(eps_inf=2.0, coeffs=[(1,2), (3,4)])\nmedium2d = Medium2D(ss=drude_medium, tt=drude_medium)\n```",
  "references": "",
  "signature": "class Medium2D(AbstractMedium)",
  "source": {
    "path": "flex/public/tidy3d/tidy3d/components/medium.py",
    "url": "",
    "lineno": 7337,
    "endlineno": 7744
  },
  "bases": [
    "AbstractMedium"
  ],
  "parameter_rows": [
    {
      "name": "ss",
      "annotation": "IsotropicUniformMediumFor2DType",
      "default": "",
      "description": "Medium describing the ss-component of the diagonal permittivity tensor. The ss-component refers to the in-plane dimension of the medium that is the first component in order of 'x', 'y', 'z'. If the 2D material is normal to the y-axis, for example, then this determines the xx-component of the corresponding 3D medium.",
      "origin": "declared"
    },
    {
      "name": "tt",
      "annotation": "IsotropicUniformMediumFor2DType",
      "default": "",
      "description": "Medium describing the tt-component of the diagonal permittivity tensor. The tt-component refers to the in-plane dimension of the medium that is the second component in order of 'x', 'y', 'z'. If the 2D material is normal to the y-axis, for example, then this determines the zz-component of the corresponding 3D medium.",
      "origin": "declared"
    },
    {
      "name": "attrs",
      "annotation": "dict",
      "default": "factory: dict",
      "description": "Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, `attrs` are mutable. For example, the following is allowed for setting an `attr` `obj.attrs['foo'] = bar`. Also note that Tidy3D will raise a `TypeError` if `attrs` contain objects that can not be serialized. One can check if `attrs` are serializable by calling `obj.model_dump_json()`.",
      "origin": "inherited"
    },
    {
      "name": "name",
      "annotation": "str | None",
      "default": "None",
      "description": "Optional unique name for medium.",
      "origin": "inherited"
    },
    {
      "name": "frequency_range",
      "annotation": "FreqBound | None",
      "default": "None",
      "description": "Optional range of validity for the medium.",
      "origin": "inherited"
    },
    {
      "name": "allow_gain",
      "annotation": "bool",
      "default": "False",
      "description": "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.",
      "origin": "inherited"
    },
    {
      "name": "nonlinear_spec",
      "annotation": "NonlinearSpec | NonlinearSusceptibility | None",
      "default": "None",
      "description": "Nonlinear spec applied on top of the base medium properties.",
      "origin": "inherited"
    },
    {
      "name": "modulation_spec",
      "annotation": "ModulationSpec | None",
      "default": "None",
      "description": "Modulation spec applied on top of the base medium properties.",
      "origin": "inherited"
    },
    {
      "name": "viz_spec",
      "annotation": "VisualizationSpec | None",
      "default": "None",
      "description": "Plotting specification for visualizing medium.",
      "origin": "inherited"
    },
    {
      "name": "heat_spec",
      "annotation": "ThermalSpecType | None",
      "default": "None",
      "description": "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`.",
      "origin": "inherited"
    }
  ],
  "members": [
    {
      "name": "elements",
      "kind": "attribute",
      "signature": "elements: dict[str, IsotropicUniformMediumFor2DType]",
      "description": "The diagonal elements of the 2D medium as a dictionary."
    },
    {
      "name": "eps_diagonal",
      "kind": "function",
      "signature": "eps_diagonal(frequency: float)",
      "description": "Main diagonal of the complex-valued permittivity tensor as a function of frequency."
    },
    {
      "name": "eps_diagonal_numerical",
      "kind": "function",
      "signature": "eps_diagonal_numerical(frequency: float)",
      "description": "Main diagonal of the complex-valued permittivity tensor for numerical considerations such as meshing and runtime estimation."
    },
    {
      "name": "eps_model",
      "kind": "function",
      "signature": "eps_model(frequency: float)",
      "description": "Complex-valued permittivity as a function of frequency."
    },
    {
      "name": "from_anisotropic_medium",
      "kind": "function",
      "signature": "from_anisotropic_medium(medium: AnisotropicMedium, axis: Axis, thickness: float)",
      "description": "Generate a `Medium2D` equivalent of a `AnisotropicMedium` with given normal axis and thickness. The `ss` and `tt` components of the resulting 2D medium correspond to the first of the `xx`, `yy`, and `zz` components of the 3D medium, with the `axis` component removed."
    },
    {
      "name": "from_dispersive_medium",
      "kind": "function",
      "signature": "from_dispersive_medium(medium: DispersiveMedium, thickness: float)",
      "description": "Generate a `Medium2D` equivalent of a `DispersiveMedium` with a given thickness."
    },
    {
      "name": "from_medium",
      "kind": "function",
      "signature": "from_medium(medium: Medium, thickness: float)",
      "description": "Generate a `Medium2D` equivalent of a `Medium` with a given thickness."
    },
    {
      "name": "is_comp_pec_2d",
      "kind": "function",
      "signature": "is_comp_pec_2d(comp: Axis, axis: Axis)",
      "description": "Whether the medium is a PEC."
    },
    {
      "name": "is_pec",
      "kind": "function",
      "signature": "is_pec()",
      "description": "Whether the medium is a PEC."
    },
    {
      "name": "n_cfl",
      "kind": "function",
      "signature": "n_cfl()",
      "description": "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`."
    },
    {
      "name": "plot",
      "kind": "function",
      "signature": "plot(freqs: float, ax: Ax = None)",
      "description": "Plot n, k of a `Medium` as a function of frequency."
    },
    {
      "name": "plot_sigma",
      "kind": "function",
      "signature": "plot_sigma(freqs: float, ax: Ax = None)",
      "description": "Plot the surface conductivity of the 2D material."
    },
    {
      "name": "sigma_model",
      "kind": "function",
      "signature": "sigma_model(freq: float)",
      "description": "Complex-valued conductivity as a function of frequency."
    },
    {
      "name": "to_anisotropic_medium",
      "kind": "function",
      "signature": "to_anisotropic_medium(axis: Axis, thickness: float)",
      "description": "Generate a 3D `AnisotropicMedium` equivalent of a given thickness."
    },
    {
      "name": "to_medium",
      "kind": "function",
      "signature": "to_medium(thickness: float)",
      "description": "Generate a `Medium` equivalent of a given thickness. The 2D medium must be isotropic in-plane (otherwise the components are averaged) and non-dispersive besides a constant conductivity."
    },
    {
      "name": "to_pole_residue",
      "kind": "function",
      "signature": "to_pole_residue(thickness: float)",
      "description": "Generate a `PoleResidue` equivalent of a given thickness. The 2D medium to be isotropic in-plane (otherwise the components are averaged)."
    },
    {
      "name": "volumetric_equivalent",
      "kind": "function",
      "signature": "volumetric_equivalent(axis: Axis, adjacent_media: tuple[MediumType3D, MediumType3D], adjacent_dls: tuple[float, float])",
      "description": "Produces a 3D volumetric equivalent medium. The new medium has thickness equal to the average of the `dls` in the `axis` direction. The ss and tt components of the 2D material are mapped in order onto the xx, yy, and zz components of the 3D material, excluding the `axis` component. The conductivity and residues (in the case of a dispersive 2D material) are rescaled by `1/dl`. The neighboring media `neighbors` enter in as a background for the resulting volumetric equivalent."
    }
  ],
  "group": "flex_rf.tidy3d"
}
