-
Notifications
You must be signed in to change notification settings - Fork 3
Fix Spectral combination
#18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@obackhouse I've opened a new pull request, #19, to work on those changes. Once the pull request is ready, I'll request review from you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes the Spectral.combine method to properly concatenate Dyson orbitals and handle the linear algebra for constructing full eigenvectors. It also removes the GW/TDAGW expression (which should live in momentGW instead), fixes non-Dyson classification for ADC expressions, and adds typing improvements.
Key changes:
- Reimplements
Spectral.combineto concatenate Dyson orbitals and useproject_eigenvectorsfor proper eigenspace construction - Removes the TDAGW/GW expression from the codebase as it breaks Spectral logic
- Fixes ADC
non_dysonproperty fromFalsetoTrueand removes HF_Dyson class - Moves
project_eigenvectorsfromexact.pytoutil/linalg.pywith improved signature allowingeigvecs=None - Adds
typing-extensionsdependency and usesSelftype for better type hints
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| dyson/representations/spectral.py | Reimplements combine() method to concatenate Dyson orbitals and construct eigenvectors; fixes typo in error message |
| dyson/util/linalg.py | Adds project_eigenvectors() function (moved from exact.py) with support for eigvecs=None parameter |
| dyson/util/init.py | Exports new project_eigenvectors function |
| dyson/solvers/static/exact.py | Removes project_eigenvectors() (moved to util/linalg.py) and updates import |
| dyson/solvers/static/davidson.py | Updates import to use project_eigenvectors from util |
| dyson/solvers/static/mblse.py | Updates return type annotations from MBLSE to MLSE for MLSE class methods |
| dyson/solvers/solver.py | Adds Self type import and uses it for return type annotations |
| dyson/expressions/expression.py | Removes "dyson"/"central" expression support from ExpressionCollection, adds Self type usage |
| dyson/expressions/hf.py | Removes HF_Dyson class as it's no longer needed |
| dyson/expressions/adc.py | Changes non_dyson property from False to True |
| dyson/expressions/gw.py | File completely removed (TDAGW expression) |
| dyson/expressions/init.py | Removes TDAGW import |
| dyson/init.py | Removes TDAGW from public API and documentation |
| tests/test_expressions.py | Removes TDAGW tests, adds comprehensive combine() tests for HF/CCSD/FCI/ADC2/ADC2x with both Exact and Davidson solvers, adds incomplete comment |
| tests/test_mblse.py | Removes skip conditions for "Dyson only" expressions |
| tests/test_mblgf.py | Removes skip conditions for "Dyson only" expressions |
| tests/test_exact.py | Removes skip conditions for "Dyson only" expressions |
| tests/test_downfolded.py | Removes skip conditions for "Dyson only" expressions |
| tests/test_density.py | Removes skip conditions for "Dyson only" expressions |
| tests/test_davidson.py | Removes skip conditions for "central Hamiltonian" and "Dyson only" expressions |
| tests/test_cpgf.py | Removes skip conditions for "central Hamiltonian" |
| tests/test_corrvec.py | Removes skip conditions for "central Hamiltonian" |
| tests/conftest.py | Removes TDAGW from METHODS list and simplifies _get_central_result() by removing dyson-specific logic |
| pyproject.toml | Adds typing-extensions>=4.0.0 to dev dependencies |
Comments suppressed due to low confidence (1)
dyson/representations/spectral.py:288
- This assignment to 'eigvecs' is unnecessary as it is redefined before this value is used.
eigvecs = util.project_eigenvectors(
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
ok this has broken stuff for higher order moments after recombinations 😢 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #18 +/- ##
==========================================
- Coverage 72.37% 71.89% -0.48%
==========================================
Files 38 37 -1
Lines 3873 3790 -83
Branches 494 493 -1
==========================================
- Hits 2803 2725 -78
+ Misses 869 859 -10
- Partials 201 206 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 30 out of 30 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Spectral.combine, which is now separated intoSpectral.combine_for_self_energyandSpectral.combine_for_greens_function. The choice of functions depends on which quantity you want to exactly conserve when combining theSpectralobjects, which may not allow conservation of both in many cases.GWexpression. This is not rigorously wavefunction-based and breaks theSpectrallogic. It should live inmomentGWand combination handled there (as it already is).