{
  "title": "CustomPoleResidue",
  "public_path": "flex_rf.tidy3d.CustomPoleResidue",
  "lookup_path": "tidy3d.CustomPoleResidue",
  "slug": "flex_rf/tidy3d/CustomPoleResidue",
  "public_url": "/rf/latest/autogenerated/flex_rf/tidy3d/custompoleresidue/",
  "object_kind": "class",
  "introduction": "A spatially varying dispersive medium described by the pole-residue pair model.",
  "notes": "In this method, the frequency-dependent permittivity $$\\epsilon(\\omega)$$ is expressed as a sum of\n    resonant material poles [1].\n\n$$\n\\epsilon(\\omega) = \\epsilon_\\infty - \\sum_i\n\\left[\\frac{c_i}{j \\omega + a_i} +\n\\frac{c_i^*}{j \\omega + a_i^*}\\right]\n$$\n\nFor each of these resonant poles identified by the index $$i$$, an auxiliary differential equation is\nused to relate the auxiliary current $$J_i(t)$$ to the applied electric field $$E(t)$$.\nThe sum of all these auxiliary current contributions describes the total dielectric response of the material.\n\n$$\n\\frac{d}{dt} J_i (t) - a_i J_i (t) = \\epsilon_0 c_i \\frac{d}{dt} E (t)\n$$\n\nHence, the computational cost increases with the number of poles.",
  "examples": "```python\nx = np.linspace(-1, 1, 5)\ny = np.linspace(-1, 1, 6)\nz = np.linspace(-1, 1, 7)\ncoords = dict(x=x, y=y, z=z)\neps_inf = SpatialDataArray(np.ones((5, 6, 7)), coords=coords)\na1 = SpatialDataArray(-np.random.random((5, 6, 7)), coords=coords)\nc1 = SpatialDataArray(np.random.random((5, 6, 7)), coords=coords)\na2 = SpatialDataArray(-np.random.random((5, 6, 7)), coords=coords)\nc2 = SpatialDataArray(np.random.random((5, 6, 7)), coords=coords)\npole_res = CustomPoleResidue(eps_inf=eps_inf, poles=[(a1, c1), (a2, c2)])\neps = pole_res.eps_model(200e12)\n```",
  "references": "**[1]** M. Han, R.W. Dutton and S. Fan, IEEE Microwave and Wireless Component Letters, 16, 119 (2006).\n\n.. TODO add links to notebooks using this.",
  "signature": "class CustomPoleResidue(CustomDispersiveMedium, PoleResidue)",
  "source": {
    "path": "flex/public/tidy3d/tidy3d/components/medium.py",
    "url": "",
    "lineno": 3564,
    "endlineno": 3865
  },
  "bases": [
    "CustomDispersiveMedium",
    "PoleResidue"
  ],
  "parameter_rows": [
    {
      "name": "eps_inf",
      "annotation": "CustomSpatialDataTypeAnnotated",
      "default": "",
      "description": "Relative permittivity at infinite frequency ($$\\epsilon_\\infty$$).",
      "origin": "declared"
    },
    {
      "name": "poles",
      "annotation": "tuple[tuple[CustomSpatialDataTypeAnnotated, CustomSpatialDataTypeAnnotated], ...]",
      "default": "()",
      "description": "Tuple of complex-valued ($$a_i, c_i$$) poles for the model.",
      "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"
    },
    {
      "name": "interp_method",
      "annotation": "InterpMethod",
      "default": "'nearest'",
      "description": "Interpolation method to obtain permittivity values that are not supplied at the Yee grids; For grids outside the range of the supplied data, extrapolation will be applied. When the extrapolated value is smaller (greater) than the minimal (maximal) of the supplied data, the extrapolated value will take the minimal (maximal) of the supplied data.",
      "origin": "inherited"
    },
    {
      "name": "subpixel",
      "annotation": "bool",
      "default": "False",
      "description": "If `True`, apply the subpixel averaging method specified by `Simulation`'s field `subpixel` for this type of material on the interface of the structure, including exterior boundary and intersection interfaces with other structures.",
      "origin": "inherited"
    },
    {
      "name": "derived_from",
      "annotation": "PerturbationMediumType | None",
      "default": "None",
      "description": "If not `None`, it records the parent medium from which this medium was derived.",
      "origin": "inherited"
    }
  ],
  "members": [
    {
      "name": "eps_dataarray_freq",
      "kind": "function",
      "signature": "eps_dataarray_freq(frequency: float)",
      "description": "Permittivity array at `frequency`."
    },
    {
      "name": "from_medium",
      "kind": "function",
      "signature": "from_medium(medium: CustomMedium)",
      "description": "Convert a `CustomMedium` to a pole residue model."
    },
    {
      "name": "is_spatially_uniform",
      "kind": "function",
      "signature": "is_spatially_uniform()",
      "description": "Whether the medium is spatially uniform."
    },
    {
      "name": "loss_upper_bound",
      "kind": "function",
      "signature": "loss_upper_bound()",
      "description": "Not implemented yet."
    },
    {
      "name": "poles_on_grid",
      "kind": "function",
      "signature": "poles_on_grid(coords: Coords)",
      "description": "Spatial profile of poles interpolated at the supplied coordinates."
    },
    {
      "name": "to_medium",
      "kind": "function",
      "signature": "to_medium()",
      "description": "Convert to a `CustomMedium`. Requires the pole residue model to only have a pole at 0 frequency, corresponding to a constant conductivity term."
    }
  ],
  "group": "flex_rf.tidy3d"
}
