Draft
Conversation
Closed
Contributor
There was a problem hiding this comment.
Pull request overview
This PR enables ROHF (restricted open-shell) support in the SCF GDM/DIIS_GDM convergence path by adding ROHF-specific convergence matrix handling to the SCFAlgorithm base and extending GDM to handle ROHF orbital rotations/gradients.
Changes:
- Allow ROHF runs to use
SCFAlgorithmName::GDMandSCFAlgorithmName::DIIS_GDM(previously blocked). - Centralize ROHF “effective Fock + total density” convergence-matrix caching in
SCFAlgorithmand reuse it from DIIS/convergence checks. - Add ROHF-specific kappa packing, orbital rotation, pseudo-canonical transformations, and gradient computation in GDM.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| cpp/tests/test_scf.cpp | Removes the test that asserted ROHF+GDM is invalid (no replacement added). |
| cpp/src/qdk/chemistry/algorithms/microsoft/scf/src/scf_algorithm/scf_algorithm.cpp | Enables ROHF+GDM/DIIS_GDM in the factory; adds ROHF convergence-matrix caching in base algorithm. |
| cpp/src/qdk/chemistry/algorithms/microsoft/scf/src/scf_algorithm/gdm.cpp | Implements ROHF-specific rotations, gradients, and pseudo-canonical/Hessian logic for GDM line search + iteration. |
| cpp/src/qdk/chemistry/algorithms/microsoft/scf/src/scf_algorithm/diis.h | Removes DIIS-owned ROHF cache API and updates internal helper signature. |
| cpp/src/qdk/chemistry/algorithms/microsoft/scf/src/scf_algorithm/diis.cpp | Switches DIIS ROHF handling to use SCFAlgorithm’s shared ROHF convergence cache. |
| cpp/src/qdk/chemistry/algorithms/microsoft/scf/src/scf/scf_impl.h | Exposes core Hamiltonian accessor and a J/K build helper for use by GDM ROHF gradient code. |
| cpp/src/qdk/chemistry/algorithms/microsoft/scf/src/scf/scf_impl.cpp | Updates trial-density Fock build to treat ROHF like unrestricted; implements build_jk_matrices. |
| cpp/src/qdk/chemistry/algorithms/microsoft/scf/include/qdk/chemistry/scf/core/scf_algorithm.h | Adds ROHF convergence-matrix hook + cache accessors and stores ROHF caches in base class. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📊 Coverage Summary
Detailed Coverage ReportsC++ Coverage DetailsPython Coverage DetailsPybind11 Coverage Details |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.