{
  "title": "FastDispersionFitter",
  "public_path": "flex_rf.tidy3d.FastDispersionFitter",
  "lookup_path": "tidy3d.plugins.dispersion.FastDispersionFitter",
  "slug": "flex_rf/tidy3d/FastDispersionFitter",
  "public_url": "/rf/latest/autogenerated/flex_rf/tidy3d/fastdispersionfitter/",
  "object_kind": "class",
  "introduction": "Tool for fitting refractive index data to get a\ndispersive medium described by `PoleResidue` model.",
  "notes": "**Practical Advice**\n\n**Typical Usage**:\n\n```python\nfitter = FastDispersionFitter(wvl_um=wavelengths, n_data=n_values, k_data=k_values)\nmedium, rms_error = fitter.fit(min_num_poles=1, max_num_poles=5, tolerance_rms=1e-2)\n```\n\n**Tips**\n\n- Start with fewer poles (1-2) and increase only if the RMS error is too high.\n- Use `wvl_range` to focus the fit on your wavelength range of interest.\n- For PML stability, verify that the fitted model is passive (no gain).\n- Visualize the fit with `fitter.plot(medium)` before using it in a simulation.",
  "examples": "",
  "references": "",
  "signature": "class FastDispersionFitter(DispersionFitter)",
  "source": {
    "path": "flex/public/tidy3d/tidy3d/plugins/dispersion/fit_fast.py",
    "url": "",
    "lineno": 41,
    "endlineno": 188
  },
  "bases": [
    "DispersionFitter"
  ],
  "parameter_rows": [
    {
      "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": "wvl_um",
      "annotation": "ArrayFloat1D",
      "default": "",
      "description": "Wavelength data in micrometers.",
      "origin": "inherited"
    },
    {
      "name": "n_data",
      "annotation": "ArrayFloat1D",
      "default": "",
      "description": "Real part of the complex index of refraction.",
      "origin": "inherited"
    },
    {
      "name": "k_data",
      "annotation": "ArrayFloat1D | None",
      "default": "None",
      "description": "Imaginary part of the complex index of refraction.",
      "origin": "inherited"
    },
    {
      "name": "wvl_range",
      "annotation": "tuple[float | None, float | None]",
      "default": "(None, None)",
      "description": "Truncate the wavelength, n and k data to the wavelength range '[wvl_min, wvl_max]' for fitting.",
      "origin": "inherited"
    }
  ],
  "members": [
    {
      "name": "constant_loss_tangent_model",
      "kind": "function",
      "signature": "constant_loss_tangent_model(eps_real: float, loss_tangent: float, frequency_range: tuple[float, float], max_num_poles: PositiveInt = DEFAULT_MAX_POLES, number_sampling_frequency: PositiveInt = 10, tolerance_rms: NonNegativeFloat = DEFAULT_TOLERANCE_RMS, show_progress: bool = True)",
      "description": "Fit a constant loss tangent material model."
    },
    {
      "name": "fit",
      "kind": "function",
      "signature": "fit(min_num_poles: PositiveInt = 1, max_num_poles: PositiveInt = DEFAULT_MAX_POLES, eps_inf: float | None = None, tolerance_rms: NonNegativeFloat = DEFAULT_TOLERANCE_RMS, advanced_param: AdvancedFastFitterParam = None)",
      "description": "Fit data using a fast fitting algorithm."
    }
  ],
  "group": "flex_rf.tidy3d"
}
