Skip to content

Add PZ two-jet norm diagnostics - #185

Merged
MoritzMaibaum merged 1 commit into
better-intfrom
codex/add-diagnostic-layer-for-pz-norm-computations
Jul 23, 2026
Merged

Add PZ two-jet norm diagnostics#185
MoritzMaibaum merged 1 commit into
better-intfrom
codex/add-diagnostic-layer-for-pz-norm-computations

Conversation

@MoritzMaibaum

Copy link
Copy Markdown
Collaborator

Motivation

  • Provide a small diagnostic API so callers can inspect the final polynomial-zonotope two-jet before the norm integrand construction and subsequent integration steps.
  • Make it easy to collect structural metadata and rendered snippets for debugging term growth and approximation noise without changing propagation semantics.

Description

  • Add build_pz_twojet_norm_diagnostics(jet: PZTwoJet, *, include_integrands=True, render=True, max_terms=12, precision=4) in src/intervalnets/pz_norms.py that returns raw Y, J, H references, metadata summaries, optional LaTeX/Markdown renderings, and optional cached l2_integrand, w12_integrand, and w22_integrand objects.
  • Introduce _pz_metadata_summary to compute term counts, max degree, shapes, num_noise, and noise-kind counts using collections.Counter.
  • Export build_pz_twojet_norm_diagnostics from the package public API in src/intervalnets/__init__.py.
  • Add tests in tests/test_pz_norms.py asserting the diagnostics helper does not mutate the input PZTwoJet and that the produced integrands match the existing pz_twojet_l2_integrand, pz_twojet_w12_integrand, and pz_twojet_w22_integrand helpers, and update the notebook notebooks/affine_pz_twojet_adaquad_benchmarks.ipynb to build diagnostics before integrating cached integrands.

Testing

  • Ran the unit tests with python -m pytest tests/test_pz_norms.py -q and all tests passed (17 passed).
  • Verified syntax/byte-compile with python -m compileall -q src/intervalnets tests/test_pz_norms.py which completed successfully.

Codex Task

@MoritzMaibaum
MoritzMaibaum merged commit 14e0863 into better-int Jul 23, 2026
1 check passed
@MoritzMaibaum
MoritzMaibaum deleted the codex/add-diagnostic-layer-for-pz-norm-computations branch July 23, 2026 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant