Releases: zzhang0123/syncmoments
Release list
SyncMoments 0.5.0
SyncMoments 0.5.0
This release adds a finite-$\gamma$ high-order harmonic route for declared
smooth compact channels. It keeps the discrete helical-orbit harmonic
reference, Stokes
phase. It does not replace the harmonic sum with the leading ultra-relativistic
continuum model.
Added
-
high_order_channel_modesselects direct or accelerated work from the
number of active integer modes in each channel. The broad 0.1–3 GHz,
$B=5,\mu\mathrm G$ ,$\gamma=3000$ fixed-point example evaluated 2,104
continuous-order samples without allocating an array spanning roughly
$10^{10}$ –$10^{12}$ harmonics. This is finite resource evidence; its
accelerated sum, SciPy Bessel and roundoff errors remainunbounded. -
build_high_order_basisprepares a reusable fixed-reference$N\leq1$
moment response matrix, including first$\gamma/B$ derivatives and
line-dependent phase derivatives where requested. Its ordinary numerical
term isunbounded; the response matrix can be reused in prediction and
fitting without repeating the harmonic calculation. -
certify_high_order_basis_coarseoptionally attaches a per-column
fixed-reference numerical envelope to that stored matrix. It covers the
ideal unit-peak bump andTaylorPhaseunder exact-binary inputs and
experimental mpmath interval arithmetic. Changes to certified coefficients
or inputs fail closed, including under JIT. The envelope propagates through
predictwithout rerunning certification. A high-$\gamma$$N=1$ example
produced an error near$9\times10^{35}$ in response units, far above the
signal; a finite certificate is not a useful science tolerance by itself. - The existing low-order
HarmonicKernelprunes support-excluded integer
ranges before Bessel evaluation. A manually truncated potentially active
range keeps anunboundedharmonic-truncation term.
Scope and installation
The optional high-order value and basis route needs SciPy through
syncmoments[high_harmonic]; the offline certificate also needs mpmath.
Nonzero
population tails and downstream inference bias have no bound from this
release. Unsupported channels, modes, tolerances and resource caps raise or
retain unbounded status. The
high-order guide
separates the exploratory point values, exploratory matrix and conditional
coefficient envelope.
Release checks
The focused release gate passed 252 tests; version and documentation checks passed 36 tests (overlapping the focused gate). The strict Sphinx HTML build, Black, Ruff, isolated source/wheel build, strict Twine check, and independent wheel import passed. The broader non-slow suite was interrupted after 621 passing tests and was not completed. These checks do not establish the unbounded scientific error terms described above.
SyncMoments 0.4.0
SyncMoments 0.4.0 adds identifiable moment reconstruction from a spectral energy distribution (SED) and makes the polarised transfer values accurate at large Faraday depth.
Identifiable moment reconstruction
New public API in syncmoments.model.fit:
reduce_responsegroups equal and proportional responses before any data is seen. It returns an explicit mapC = H Twith coefficient labels, units and zero-response slots.fit_combinationsfits the grouped response in a declared coefficient metric (T = L Q, whitened SVD). It returns:- the identifiable combinations
betawith their noise covariance; - the estimator
K; - the resolution projector
Pi; - the full-tensor representative;
- the unresolved directions.
- the identifiable combinations
CoefficientLayout,ResponseReductionandCombinationFitdescribe the inputs and results.
The results keep three claims apart: analytic redundancy of the kernel, numerical rank at a stated tolerance, and recoverability under the noise and precision threshold. Discrepancies propagate as K delta and |K| E. An unresolved direction is reported as unbounded, never as zero. The analytic grouping covers the ultra-relativistic continuum kernel; other kernels use their structural zeros only.
scripts/sed_reconstruction_example.py runs the manuscript's smooth correlated continuum example through these APIs. The mock data come from an independent population integration. The example reproduces the historical research run:
- 60 coefficients, 52 active, 30 grouped, 9 retained;
- numerical rank 26;
- chi2 55.2361 on 63 degrees of freedom, within 4e-13.
In clusters of equal singular values the package uses a canonical basis, so individual beta there differ from the research run by a rotation within the cluster; the subspaces and norms agree. docs/guide/reconstruction.md explains the example. The figure and the CSV are in the repository. The JSON and NPZ records of the run are attached here, generated from the tagged commit with a clean tree.
Transfer accuracy
- Values.
transfer_slabvalues now use the same ceil-count Pade-13 exponential as the derivatives. Against mpmath, the value error was up to 2.8e-5 of the largest Stokes component at large Faraday depth (36.3 MHz,|K ds|_1 = 8.7e4) and is now about 1e-12. Values are no longer bit-identical to 0.3.0. - Path-length derivative.
d out / d dsis computed asPhi (eps - K S). This removes the cancellation that gave O(1) and larger relative errors in ill-conditioned slabs; the errors are now within the stated roundoff bound. - Third derivatives. Tests now cover them.
Validation
- Test suites. Both environments pass the fast and slow suites with no failures:
- JAX 0.10.0, Equinox 0.13.7, NumPy 2.3.5.
- JAX 0.10.2, Equinox 0.13.8, NumPy 2.5.3.
- Docs and build. The documentation builds with
-Wunder Sphinx 8.2.3 and 9.1.0, and rendered headings match the sources. The wheel and sdist passtwine check --strict. - Manuscript numbers. The Section 5.3.1 benchmark numbers are unchanged.
CHANGELOG.md lists every change with measurements, and its "Known limitations" section lists what remains open.
Install
python -m pip install syncmoments==0.4.0Documentation: https://syncmoments.readthedocs.io.
SyncMoments 0.3.0
SyncMoments 0.3.0 is the companion package of Zhang & Chluba, A statistical framework for the modelling of synchrotron emission. This release renames the package and improves the numerics, dependency robustness and model options of syncmoments.model.
Renamed
The package was called synchro; that name on PyPI belongs to an unrelated project. From this release:
- The display name is SyncMoments. Install it with
pip install syncmomentsand import it withimport syncmoments. - There is no compatibility alias. Replace
import synchroandfrom synchro...withsyncmoments. - The slow-test switch is now
SYNCMOMENTS_RUN_SLOW=1. - The v0.2.0 tag keeps the old name.
Highlights
- Memory. At the manuscript benchmark size (
L = 8,N = 2), building the basis now peaks at 0.84 GB on JAX 0.10.0 and 0.97 GB on JAX 0.10.2. 0.2.0 needed 10.9 GB and 45.6 GB. README continuum example (b) needs 1.2 GB and 1.8 GB, against 0.2.0's 6.4 GB and 26.7 GB. - Harmonic-kernel derivatives. Derivatives in field strength come from an analytic Bessel recurrence (
HarmonicKernel(derivatives="analytic"), the default), so no tangent passes through the Bessel quadrature. - Model options. Lower-set truncations are available through
Truncation(..., max_orders=...), with the telescoped remainder marginlower_set_margin. The new symmetry closures arepitch_symmetricandfield_reversal_symmetric. - JAX 0.10.2 robustness. Population weights are normalised without a subnormal reciprocal, which previously returned wrong averages for weights near 1e308 on JAX 0.10.2. float16, bfloat16 and float32 weights are handled.
- Radiative transfer.
transfer_slabandtransfer_losderivatives are exact at every source scale, in every tested AD mode and nesting, including reverse mode throughvmap.- A non-finite slab is refused with its cause.
- Eager calls compile once per shape.
- Tests.
- The suite has 5196 tests: 3561 fast and 1635 opt-in slow.
- A systematic AD-transform matrix covers every entry point with a custom derivative or batching rule.
- The manuscript benchmark reference is included as a hash-checked copy, so the full suite runs from the source distribution.
Behaviour changes
transfer_slabandtransfer_losraiseEquinoxRuntimeErrorfor a non-finite result, where 0.2.0 returned NaN or inf. Under an outerjax.jitthe error isJaxRuntimeError.- A
fixed_tableclosure combined with a symmetry closure takes the full table and represents the symmetrised marginal. - Transfer derivatives changed toward the exact values. On random slabs the change is up to 1.9e-10 relative. In rotation-dominated slabs that need many squarings it is up to 5e-6. Values are bit-identical.
CHANGELOG.md lists every change with measurements, and its "Known limitations" section lists what is deferred to 0.3.1.
Validation
-
Test runs. Both environments were tested:
- JAX 0.10.0, Equinox 0.13.7, NumPy 2.3.5.
- JAX 0.10.2, Equinox 0.13.8, NumPy 2.5.3, without mpmath.
In each, the fast and slow suites pass with no skips. Lint is clean, and the documentation builds with
-Wunder Sphinx 8.2.3 and 9.1.0. -
Source distribution. The full fast suite and the benchmark also pass from the unpacked source distribution in a fresh environment.
-
Manuscript numbers. The Section 5.3.1 numbers are unchanged. At
N = 2,L = 8the errors are 1.644e-4 and 1.753e-3 of channel intensity. The saved finite predictions are matched within 5.6e-10. -
Radiation audit.
review-results/radiation.jsonwas regenerated with the final code; all 2401 numerical entries are identical to the previous record.
Install
python -m pip install syncmomentsThe same release from GitHub:
python -m pip install "syncmoments @ git+https://github.com/zzhang0123/syncmoments@v0.3.0"The wheel and the source distribution are attached to this release. Documentation: https://syncmoments.readthedocs.io.
synchro 0.2.0
First tagged release of synchro, the companion package of Zhang & Chluba, A statistical framework for the modelling of synchrotron emission.
This release adds synchro.model. It predicts channel-integrated Stokes spectra from a finite set of joint population moments (manuscript Section 4 and Appendix B), with an explicit error budget, declared population assumptions and spectral fits.
Highlights
- Forward modelling.
build_basisconstructs Legendre-projected, channel-integrated spectral bases with derivatives in energy, field strength and Faraday depth. It supports the exact harmonic kernel (moving lines, per-line Faraday phase) and the ultra-relativistic continuum kernel.predictcontracts them withJointMoments;direct_channel_averageis the untruncated reference. - Declared assumptions. Independence between groups of
(gamma, B, mu, eta, phi, depth), an independent screen, field independence, azimuth separability, isotropic pitch, Gaussian depth and nodal populations are parametrisations of the moment vector. They are never defaults and are recorded in every output. Screen routes includeGaussianScreen,LaplaceScreenandGammaScreen. - Error budget. Every term is
bound,measured,estimate,unboundedornot_applicable; a missing input isunbounded, and the total isunboundedwhile any term is. Assumptions can be quantified by measured discrepancies, the manuscript's factorisation bounds or caller allowances. - Spectral fits.
synchro.model.fitprovidesfit_linear(closed-form weighted least squares),LogDensityandfit_bfgs,fit_nodal, identifiability and feasibility reports, and a self-describingFitResult. - Documentation on Read the Docs, with the design and acceptance record in
docs/DESIGN.md.
Validation
- 187 existing tests, 1168 new tests and 42 slow tests pass; ruff and black are clean.
- The manuscript's Section 5.3.1 smooth-channel example is reproduced with automatic differentiation. At
N = 2,L = 8the second-order errors are 1.644e-4 and 1.753e-3 of channel intensity; the manuscript reports 1.64e-4 and 1.75e-3. All 18 saved finite predictions are matched to within 5.6e-10 of channel intensity. - An independent six-lens review confirmed 35 findings, all in error-budget reporting and none in the physics. All were fixed over three rounds, with each fix re-verified by reproduction.
Compatibility
Existing APIs are unchanged. stokes_harmonic gains an optional static n_nodes. Slow tests run with -m slow or SYNCHRO_RUN_SLOW=1.
The package is not on PyPI: the name synchro there belongs to an unrelated project. Install from this release or the repository:
python -m pip install "synchro @ git+https://github.com/zzhang0123/synchro@v0.2.0"See CHANGELOG.md for the full list.