Rewrite QGQ into DQ module#16
Conversation
There was a problem hiding this comment.
Pull request overview
This PR rewrites the stacie.qgq (Quasi-Gaussian Quadrature) module into a new stacie.dq (Designed Quadrature) module. The new module uses a fundamentally different optimization approach — a custom modified Levenberg-Marquardt algorithm with an orthogonal regularization scheme — replacing the previous L-BFGS-B optimizer from scipy. This results in better numerical stability and more control over the optimization. An analytical dq3 helper for 3-point quadrature is also added.
Changes:
- New
src/stacie/dq.py: Complete rewrite of the QGQ algorithm with the new DQ formulation using fixed (equal or user-specified) weights, a custom LM solver, and a newEquationsclass encapsulating the constraint system. - Updated tests:
tests/test_qgq.pyremoved and replaced by the more comprehensivetests/test_dq.py, adding unit tests for individual methods (apply_sym,backprop_sym,proj,pen,solve_weights,dq3). - Updated documentation:
docs/source/examples/qgq.pyreplaced bydocs/source/examples/dq.pywith an expanded tutorial, new BibTeX references added, changelog updated.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
src/stacie/dq.py |
New DQ module (699 lines) replacing qgq.py; new Equations class, solve_modified_lm, dq3 function, and public API |
tests/test_dq.py |
New test file with more granular unit tests for the DQ internals |
tests/test_qgq.py |
Removed (replaced by test_dq.py) |
src/stacie/qgq.py |
Removed (replaced by dq.py) |
docs/source/examples/dq.py |
New example notebook (450 lines) with DQ tutorial and regression tests |
docs/source/examples/qgq.py |
Removed (replaced by dq.py) |
docs/source/examples/index.md |
Updated to reference dq.py instead of qgq.py |
docs/source/references.bib |
Added two new BibTeX entries for Chebyshev quadrature literature |
docs/source/development/changelog.md |
Added changelog entry for the new stacie.dq module |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.