reduction_numpy ¤
NumPy/SciPy S-domain AAA, compact pole screening, and relaxed VF.
By default all numerical work here runs on the CPU without JAX operations. Optional aaa_backend="jax" selects JAX support discovery only. Returned VFModel fields are NumPy arrays; conversion to a Circulax realization is an explicit downstream operation. Uniform complex-S error and proper models (constant term, no proportional term) are used throughout.
Functions:
| Name | Description |
|---|---|
basis_numpy | Real-coefficient basis for conjugate poles, plus a constant column. |
candidate_subsets | Enumerate distinct contribution-ranked budgets, including full order. |
discover_numpy | Discover a common pole set from the largest response, as in the S path. |
errors_numpy | Return normalized complex RMS and maximum absolute S error. |
evaluate_numpy | Evaluate the S-domain pole-residue model without constructing states. |
fit_s_numpy | Discover once, screen compact subsets, refine passing candidates. |
pole_groups | Return real poles and complete conjugate pairs; reject broken pairs. |
refine_numpy | Traditional fast relaxed VF using NumPy QR/LS and SciPy eigenvalues. |
refit_numpy | Fit all ordered responses together using one multi-RHS least squares. |
screen_masked_numpy | Refit all candidates with a padded stacked SVD and compact the results. |
basis_numpy ¤
Real-coefficient basis for conjugate poles, plus a constant column.
Source code in circulax/fitting/reduction_numpy.py
candidate_subsets ¤
Enumerate distinct contribution-ranked budgets, including full order.
Source code in circulax/fitting/reduction_numpy.py
discover_numpy ¤
discover_numpy(
S: ndarray,
freqs: ndarray,
*,
tol=1e-08,
mmax=12,
reciprocal=True,
aaa_backend="numpy"
) -> tuple[VFModel, dict]
Discover a common pole set from the largest response, as in the S path.
Source code in circulax/fitting/reduction_numpy.py
errors_numpy ¤
Return normalized complex RMS and maximum absolute S error.
Source code in circulax/fitting/reduction_numpy.py
evaluate_numpy ¤
Evaluate the S-domain pole-residue model without constructing states.
Source code in circulax/fitting/reduction_numpy.py
fit_s_numpy ¤
fit_s_numpy(
S: ndarray,
freqs: ndarray,
*,
tol=1e-08,
mmax=12,
normalized_rmse=0.02,
max_absolute_error=0.05,
iterations=6,
reciprocal=True,
screening="compact",
reduction_stage="initial",
aaa_backend="numpy"
) -> tuple[VFModel, dict]
Discover once, screen compact subsets, refine passing candidates.
Selection uses training S error only. If no screen passes, refine full order; if no refined candidate passes, raise instead of claiming success. Passivity and the eventual admittance realization must be checked outside this fitting routine. No held-out samples participate in order selection. screening='masked' uses padded stacked SVD instead of compact solves. reduction_stage='refined' first relocates the full pole set, then refines candidate budgets in ascending order regardless of screening error. This can expose real poles and smaller accurate odd-order models. aaa_backend selects support discovery only; all later work is NumPy/SciPy.
Source code in circulax/fitting/reduction_numpy.py
pole_groups ¤
Return real poles and complete conjugate pairs; reject broken pairs.
Source code in circulax/fitting/reduction_numpy.py
refine_numpy ¤
refine_numpy(
S: ndarray, freqs: ndarray, poles: ndarray, *, iterations=6, reciprocal=True
) -> VFModel
Traditional fast relaxed VF using NumPy QR/LS and SciPy eigenvalues.
Source code in circulax/fitting/reduction_numpy.py
refit_numpy ¤
Fit all ordered responses together using one multi-RHS least squares.
Source code in circulax/fitting/reduction_numpy.py
screen_masked_numpy ¤
screen_masked_numpy(
S: ndarray, freqs: ndarray, initial: VFModel, subsets: list[ndarray]
) -> list[VFModel]
Refit all candidates with a padded stacked SVD and compact the results.