tidy3d.plugins.dispersion.AdvancedFastFitterParam#

class AdvancedFastFitterParam[source]#

Bases: Tidy3dBaseModel

Advanced fast fitter parameters.

Parameters:
  • attrs (dict = {}) – 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.json().

  • loss_bounds (Tuple[float, float] = (0, inf)) – Bounds (lower, upper) on Im[eps]. Default corresponds to only passivity. A lower bound of 0 or greater ensures passivity. To fit a gain medium without additional constraints, use loss_bounds=(-np.inf, np.inf). Increasing the lower bound could help with simulation stability. A finite upper bound may be helpful when fitting lossless materials. In this case, consider also increasing the weight for fitting the imaginary part.

  • weights (Optional[Tuple[NonNegativeFloat, NonNegativeFloat]] = None) – Weights (real, imag) in objective function for fitting. The weights are applied to the real and imaginary parts of the permittivity epsilon. The weights will be rescaled together so they average to 1. If None, the weights are calculated according to the typical value of the real and imaginary part, so that the relative error in the real and imaginary part of the fit should be comparable. More precisely, the RMS value rms of the real and imaginary parts are calculated, and the default weights are 1 / max(rms, RMS_MIN). Changing this can be helpful if fitting either the real or imaginary part is more important than the other.

  • show_progress (bool = True) – Whether to show progress bar during fitter run.

  • show_unweighted_rms (bool = False) – Whether to show unweighted RMS error in addition to the default weighted RMS error. Requires td.config.logging_level = "INFO".

  • relaxed (Optional[bool] = None) – Whether to use relaxed fitting algorithm, which has better pole relocation properties. If None, will try both original and relaxed algorithms.

  • smooth (Optional[bool] = None) – Whether to use real starting poles, which can help when fitting smooth data. If None, will try both real and complex starting poles.

  • logspacing (Optional[bool] = None) – Whether to space the poles logarithmically. If None, will try both log and linear spacing.

  • num_iters (PositiveInt = 20) – Number of iterations of the fitting algorithm. Make this smaller to speed up fitter, or make it larger to try to improve fit.

  • passivity_num_iters (PositiveInt = 50) – Number of loss bounds enforcement iterations of the fitting algorithm. Make this smaller to speed up fitter. There will be a warning if this value is too small. To fit a gain medium, use the loss_bounds parameter instead.

  • slsqp_constraint_scale (PositiveFloat = 1e+35) – Passivity constraint is weighted relative to fit quality by this factor, before running passivity optimization using the SLSQP algorithm. There will be a warning if this value is too small.

Attributes

Methods

Inherited Common Usage

loss_bounds#
weights#
show_progress#
show_unweighted_rms#
relaxed#
smooth#
logspacing#
num_iters#
passivity_num_iters#
slsqp_constraint_scale#
__hash__()#

Hash method.