Skip to content

flex_rf.tidy3d.FastDispersionFitter

Type: class Base(s): DispersionFitter

Tool for fitting refractive index data to get a dispersive medium described by PoleResidue model.

Practical Advice

Typical Usage:

fitter = FastDispersionFitter(wvl_um=wavelengths, n_data=n_values, k_data=k_values)
medium, rms_error = fitter.fit(min_num_poles=1, max_num_poles=5, tolerance_rms=1e-2)

Tips

  • Start with fewer poles (1-2) and increase only if the RMS error is too high.
  • Use wvl_range to focus the fit on your wavelength range of interest.
  • For PML stability, verify that the fitted model is passive (no gain).
  • Visualize the fit with fitter.plot(medium) before using it in a simulation.
wvl_um [ArrayFloat1D]

Wavelength data in micrometers.

n_data [ArrayFloat1D]

Real part of the complex index of refraction.

k_data [ArrayFloat1D | None] = None

Imaginary part of the complex index of refraction.

wvl_range [tuple[float | None, float | None]] = (None, None)

Truncate the wavelength, n and k data to the wavelength range ‘[wvl_min, wvl_max]’ for fitting.

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)

Fit a constant loss tangent material model.

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)

Fit data using a fast fitting algorithm.