feat(math): add Hochschild chain complex and homology operations - #2250
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 09d362337a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cac2c4e4e8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ca79b238e4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 465c41e56f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- geometry: exclude collinear quadruples from concyclicity, bound circumradius/pinned-distance/inversion inputs to keep exact results within CanonicalRational limits, bind circumradius and forbidden-pattern results to source configurations with replay, fix pinned line formatting to use format_canonical_integer, and correct the forbidden-pattern example - hochschild: reject noncanonical residues, enforce tensor budget for max_degree+1, and clarify the reduced bar differential vs Hochschild with trivial action - moments: restrict recurrence to consumed moments, bound Christoffel-Darboux inputs, keep beta0 above underflow, and mark Gaussian quadrature as approximate - prime_field: cap prime modulus to bound work and serialized size - inversion: return geometry.RationalPoint2D and bound inversion growth Fixes: review threads PRRT_kwDOThEfjc6bVa-o, PRRT_kwDOThEfjc6bVa-q, PRRT_kwDOThEfjc6bVa-s, PRRT_kwDOThEfjc6bVa-u, PRRT_kwDOThEfjc6bVa-v, PRRT_kwDOThEfjc6bVi-a, PRRT_kwDOThEfjc6bVi-c, PRRT_kwDOThEfjc6bVi-d, PRRT_kwDOThEfjc6bVi-e, PRRT_kwDOThEfjc6bW93G, PRRT_kwDOThEfjc6bW93I, PRRT_kwDOThEfjc6bW93K, PRRT_kwDOThEfjc6bW93L, PRRT_kwDOThEfjc6bW93N
465c41e to
d365377
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d36537772c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…source - hochschild: bound the densest boundary matrix by an explicit entry budget so elimination work stays admitted before expansion, share one bar-differential kernel between the operation and the result contract, and retain the source algebra on chain-complex results with full replay of group dimensions, shapes, residues, and differential entries - geometry: parse pinned squared distances through parse_canonical_integer above CPython's conversion limit, and derive circumradius (819-digit) coordinate bounds from the worst-case R^2 growth instead of a per-component guess - inversion: derive the input digit bound (2730) from the full rational inversion expression rather than component size alone - moments: admit Christoffel-Darboux requests by running the exact bounded recurrence at validation, rejecting any order whose kernel or polynomial values exceed canonical rational limits - geometry models: extract replay helpers to satisfy complexity lint Fixes: review threads PRRT_kwDOThEfjc6bXWHL, PRRT_kwDOThEfjc6bXWHN, PRRT_kwDOThEfjc6bXWHO, PRRT_kwDOThEfjc6bXWHP, PRRT_kwDOThEfjc6bXWHQ, PRRT_kwDOThEfjc6bXWHR Refs: #2250
…source - hochschild: bound the densest boundary matrix by an explicit entry budget so elimination work stays admitted before expansion, share one bar-differential kernel between the operation and the result contract, and retain the source algebra on chain-complex results with full replay of group dimensions, shapes, residues, and differential entries - geometry: parse pinned squared distances through parse_canonical_integer above CPython's conversion limit, and derive circumradius (819-digit) coordinate bounds from the worst-case R^2 growth instead of a per-component guess - inversion: derive the input digit bound (2730) from the full rational inversion expression rather than component size alone - moments: admit Christoffel-Darboux requests by running the exact bounded recurrence at validation, rejecting any order whose kernel or polynomial values exceed canonical rational limits - geometry models: extract replay helpers to satisfy complexity lint Fixes: review threads PRRT_kwDOThEfjc6bXWHL, PRRT_kwDOThEfjc6bXWHN, PRRT_kwDOThEfjc6bXWHO, PRRT_kwDOThEfjc6bXWHP, PRRT_kwDOThEfjc6bXWHQ, PRRT_kwDOThEfjc6bXWHR Refs: #2250
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 05e59ff42e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…source-bind Hochschild homology - commutative algebra: apply the per-term exponent-sum (total degree) bound to the saturation polynomial before invoking Singular - geometry: pinned-distance results replay the exact pair-spanned-line profile from the retained anchor and points, binding entries, pairs, counts, and the minimum to their source - hochschild: homology results retain the source algebra and requested degree and replay the bounded differential ranks; the enumeration budget is reapplied before replay
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6f4848f6e4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…_0, source-bind saturation - geometry: forbidden-pattern point bound derived from an enumeration budget (C(32,3)+C(32,4) exact predicate evaluations across screen and replay) instead of permitting 128-point exhaustive scans - moments: a nonpositive zeroth moment is rejected at admission before the kernel's short-sequence return can emit beta_0 = mu_0 < 0 - commutative algebra: computed saturation results retain the input ideal, saturation polynomial, and budget, and replay the bounded Singular call so an authored payload cannot claim an arbitrary ideal
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 701423f24d
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…lay gracefully - moments: m moments determine floor(m/2) coefficient pairs; the loop now stops before computing the unavailable next norm so even-length sequences return their final determinable pair with complete=True - commutative algebra: when the validation replay of a COMPUTED saturation fails transiently (timeout, unavailable backend, output limit), fall back to the deterministic defining-invariant subset check instead of raising; exact equality is still required on healthy replays
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 266cec4aca
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- geometry: profile point count capped at 24 jointly with the coordinate height so aggregate exact output stays inside a transport budget across execution and replay - commutative algebra: when backend replay is unavailable, the retained certificate must satisfy both I subset-of S and S subset-of I:d^inf (bounded multiply-and-reduce witness), so unit-ideal forgeries are rejected instead of silently validating
a999c8d to
dd2a236
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dd2a236372
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ion replay - geometry: pinned-distance requests cap points at the C(32,2)=496 pair budget with 512-digit coordinates, bounding aggregate exact output - commutative algebra: validation replay runs with an amplified wall-time ceiling and requires exact equality; the unsound subset fallback is removed so non-COMPUTED replays reject the payload
6710747 to
16ffdc4
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 16ffdc4a3e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- commutative algebra: remove the duplicated discarded replay and restore the correct typed-outcome fields so UNAVAILABLE/TIMEOUT replays surface as the declared outcome shape; odd-length moment prefixes keep their determinable final beta via an availability-gated norm computation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2419035ca7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ce value Hochschild chains now carry the augmentation defining the trivial module K = GF(p): AlgebraStructure validates epsilon as an algebra homomorphism and the bar differential includes both augmentation-dependent endpoint faces, so reported groups are exact HH_n(A,K) instead of homology of the adjacent-face complex. moments.recurrence_coefficients.compute returns the domain-owned RecurrenceCoefficientsValue, accepted unchanged by the Jacobi-matrix, Christoffel-Darboux, and quadrature requests alongside their own x/y parameters.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1a942caec0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…ut (#2250) - moments_orthogonal: cap RecurrenceCoefficientsRequest at 32 moments; a 33rd harmonic moment determines a 17th beta entry that the canonical coefficient value cannot carry, and admission now constructs that value from the exact kernel output so requests whose coefficients exceed the canonical component limits are rejected at the typed boundary. - geometry: couple CircumradiusProfileRequest point count to observed coordinate width under a 4M-character aggregate output budget; the 24x819-digit reciprocal configuration emitted ~46M characters across 2024 radii and replayed them in validation. Validated: pytest tests/math/{moments_orthogonal,geometry} tests/catalog, ruff, mypy.
…circumradius aggregate output - RecurrenceCoefficientsRequest admits at most 2*MAX_RECURRENCE_ORDER moments (33 moments would derive a 17th beta entry outside the canonical value) and replays derived coefficients through RecurrenceCoefficientsValue so growth past the canonical rational domain is rejected during admission. - CircumradiusProfileRequest couples point count and coordinate size through an aggregate character budget so no admitted request can emit an unbounded exact radius profile. - Register the audited domains and saturation operation in the root namespace and catalog tests.
2641bc6 to
a60ddbc
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a60ddbc2ef
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2a48abff53
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…cal main; retain hochschild-1902 feature operations
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e0e19616b0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- moments: an odd-length moment prefix determines the final squared-norm ratio through its last moment; append it to beta after the positivity check so complete results carry every coefficient the retained moments determine - packaging: numpy is imported directly by the Gaussian quadrature kernel, so declare it in project dependencies instead of suppressing DEP003
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c76f16a932
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…atrix IDs - christoffel_darboux: admit only positive subdiagonal beta ratios so the documented sum of squared polynomial values cannot turn negative through direct native calls - gaussian_quadrature: bound coefficient magnitude and subdiagonal underflow before IEEE-double conversion so an accepted native call cannot overflow - catalog: remove the parallel prime_field_matrix_ops operation family; the source-bound prime_field.matrix.* operations remain the single vocabulary - move quadrature double-conversion bounds into the canonical values module
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 412f2434f0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… the domain value Native jacobi_matrix now validates every consumed subdiagonal beta entry as a positive squared-norm ratio, and jacobi_matrix, christoffel_darboux, and gaussian_quadrature accept the domain-owned RecurrenceCoefficients value unchanged so serialized results compose without unpacking. The canonical value validator now also rejects nonpositive trailing beta entries that an odd moment prefix determines beyond the consumed subdiagonal.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4afc957360
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2c85dd34a3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- carry each Hochschild differential as the canonical PrimeFieldMatrix value (prime, entries, declared column axis) so serialized boundaries feed GF(p) rank/RREF/nullspace consumers unchanged; degree remains separate chain-complex metadata
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 005d427fb0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
- Use maintained prime-field rank backend (python-flint nmod_mat via finite_fields._flint.matrix_rank adapter) instead of bespoke dense Gaussian elimination (~9.8M Python modular updates for 125x625). Handles largest admitted homology boundary without duplicating kernel; fallback via SymPy DomainMatrix without PrimeFieldMatrix dimension check so homology still decides when flint is absent. - Enforce PrimeFieldMatrix axis limit (256) during Hochschild chain-complex admission so 5-dim zero algebra max_degree=4 is rejected at admission rather than raising ValueError at PrimeFieldMatrix construction (625 cols). Fixes review threads for PR 2250.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0473362305
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 01496a1fc7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
01496a1 to
ed678d2
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
ed678d2 to
c0b7485
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…ive dimension admission (#1902) Comment A (P1, differential prime binding): the chain-complex result validator compared each differential matrix only by dimensions and raw entries, so an authored or deserialized payload whose matrix.prime differed from algebra.prime was accepted: exact GF(p) entries remain canonical residues of any larger GF(q), and passing that payload to rank/RREF/nullspace then silently performed arithmetic over GF(q). Root cause: source binding replayed the differential without checking the field it lives in. Fix: require differential.matrix.prime == algebra.prime in require_bound_to_algebra. Verified pre-fix that both a nonzero dual-numbers differential and an all-zero differential primed 7 over a GF(5) algebra were accepted; both are now rejected with a clear validation error, while matching-prime round-trips still validate. Comment B (P2, dimension ceiling): AlgebraStructure imposed a fixed dimension <= 8 ceiling (also on the table/augmentation field lengths), rejecting e.g. the coordinatewise algebra GF(5)^9 with projection augmentation at max_degree=1 even though its 729 structure constants, 81 highest tensor elements, 9x81 largest homology boundary, and 9-wide chain-complex matrix all fit the declared budgets - an implementation cap masquerading as a mathematical restriction. Root cause: admission was keyed on dimension instead of predicted work. Fix: remove the ceiling and derive admission from measured work - structure input shares MAX_HOCHSCHILD_MATRIX_ENTRIES because the n^3-entry table has exactly the size of the densest admitted max_degree=1 homology boundary d_2 (n <= 50), and associativity validation is bounded by an explicit MAX_ASSOCIATIVITY_DOT_STEPS = 20M on its actual 2*n^5 modular multiply-add walk (~38M steps/s measured; n <= 25 at sub-second cost). Larger dimensions are documented as a backend gap requiring an accelerated associativity kernel, not a domain restriction. Per-request tensor/boundary-matrix/matrix-dimension envelopes and all result-side budget rechecks are unchanged. Validation: uv run --locked pytest tests/math/hochschild_complexes -q (31 passed), tests/catalog (27 passed), make lint, mypy clean. New tests cover both mismatched-prime variants plus matching acceptance, GF(5)^9 end-to-end homology known answer [1, 0] and complex round-trip, both derived-budget boundaries (n=25/26 associativity, n=51 structure input), and per-request budgets still binding above the old ceiling. (#2250 review threads; task ref #1902)
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Closes #1902
Adds two Hochschild homology operations to a new hochschild_complexes domain.
Operations
hochschild.chain_complex.compute -- Given a finite-dimensional algebra over GF(p) with structure constants, compute the Hochschild chain complex with trivial bimodule coefficients. The chain groups are C_n = A^⊗n and the differential uses the algebra multiplication and the standard Hochschild boundary formula.
hochschild.homology.compute -- Compute the exact Hochschild homology groups HH_n(A, K) with trivial bimodule coefficients using Gaussian elimination over GF(p).
Design
Mathematical foundation
The Hochschild complex is the canonical chain complex for associative algebra homology. For an algebra A with trivial bimodule K, the chain groups are C_n = A^⊗n and the Hochschild boundary b: C_n -> C_{n-1} is the alternating sum of face maps using the algebra multiplication: b = sum_{k=0}^{n-1} (-1)^k d_k where d_k multiplies adjacent tensor factors.
Continue this on Linzumi