flex_rf.tidy3d.ModeInterpSpec
Type: class │ Base(s): Tidy3dBaseModel
Description
Section titled “Description”Specification for mode frequency interpolation.
Allows computing modes at a reduced set of frequencies and interpolating to obtain results at all requested frequencies. This can significantly reduce computational cost for broadband simulations where modes vary smoothly with frequency.
Requires frequency tracking to be enabled (mode_spec.sort_spec.track_freq
must not be None) to ensure mode ordering is consistent across frequencies.
Example(s)
Section titled “Example(s)”# Uniform sampling with linear interpolationinterp_spec = ModeInterpSpec( method='linear', sampling_spec=UniformSampling(num_points=10))# Chebyshev sampling with polynomial interpolationinterp_spec = ModeInterpSpec.cheb(num_points=10)# Custom sampling with cubic interpolationcustom_freqs = [1e14, 1.5e14, 2e14, 2.5e14]interp_spec = ModeInterpSpec.custom(method='cubic', freqs=custom_freqs)Parameters
Section titled “Parameters”sampling_spec [UniformSampling | ChebSampling | CustomSampling] |
|
Specification for frequency sampling points. |
method [Literal['linear', 'cubic', 'poly']] = 'linear' |
|
Method for interpolating mode data between computed frequencies. ‘linear’ uses linear interpolation (faster, requires 2+ points). ‘cubic’ uses cubic spline interpolation (smoother, more accurate, requires 4+ points). ‘poly’ uses polynomial interpolation with barycentric formula (optimal for Chebyshev nodes, requires 3+ points). For complex-valued data, real and imaginary parts are interpolated independently. |
reduce_data [bool] = False |
|
Applies only to |
Attributes
Section titled “Attributes”num_points [int] |
|
Number of sampling points. |
Methods
Section titled “Methods”cheb(num_points: int, reduce_data: bool = False) |
|
Create a ModeInterpSpec with Chebyshev node sampling and polynomial interpolation. |
custom(freqs: FreqArray, method: Literal['linear', 'cubic', 'poly'] = 'linear', reduce_data: bool = False) |
|
Create a ModeInterpSpec with custom frequency sampling. |
sampling_points(freqs: FreqArray) |
|
Compute frequency sampling points. |
uniform(num_points: int, method: Literal['linear', 'cubic', 'poly'] = 'linear', reduce_data: bool = False) |
|
Create a ModeInterpSpec with uniform frequency sampling. |