Conversation
There was a problem hiding this comment.
Pull request overview
This pull request adds support for Restricted Open-shell Hartree-Fock (ROHF) calculations with DIIS (Direct Inversion in the Iterative Subspace) convergence acceleration. The implementation refactors the existing DIIS code into a more flexible architecture that supports RHF, UHF, and the newly added ROHF methods.
Changes:
- Refactored DIIS implementation into a base class (DIISBase) with derived classes for different SCF flavors (RestrictedUnrestrictedDIIS for RHF/UHF, ROHFDIIS for ROHF)
- Added ROHF-specific effective Fock matrix construction following Guest-Saunders (1974) formalism
- Introduced
rohf_enabledflag throughout the codebase (SCFConfig, SCFImpl, SCFAlgorithm, ERI classes) to enable ROHF support - Added validation to prevent unsupported ROHF+GDM and ROHF+DIIS_GDM combinations
- Separated density matrix update logic from eigenproblem solving into a new virtual method
update_density_matrix
Reviewed changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
cpp/include/.../scf_algorithm.h |
Added rohf_enabled parameter, update_density_matrix method, and updated documentation |
cpp/include/.../scf.h |
Added rohf_enabled boolean flag to SCFConfig |
cpp/include/.../eri.h |
Added rohf_enabled parameter to ERI base class constructor |
cpp/src/.../scf_algorithm.cpp |
Implemented rohf_enabled support in create(), added update_density_matrix(), updated check_convergence with ROHF handling |
cpp/src/.../diis_base.h/cpp |
Created DIISBase abstract base class from refactored DIIS implementation |
cpp/src/.../rohf_diis.h/cpp |
Implemented ROHFDIIS class with effective Fock matrix construction for ROHF |
cpp/src/.../restricted_unrestricted_diis.h/cpp |
Implemented RestrictedUnrestrictedDIIS for RHF/UHF cases |
cpp/src/.../diis.h |
Removed (replaced by diis_base.h and derived classes) |
cpp/src/.../asahf.h/cpp |
Updated to derive from DIISBase instead of DIIS |
cpp/src/.../gdm.h/cpp |
Added rohf_enabled parameter (for future support) |
cpp/src/.../diis_gdm.h/cpp |
Added rohf_enabled parameter and validation to reject ROHF temporarily |
cpp/src/.../scf_impl.h/cpp |
Added rohf_enabled flag, num_orbital_sets tracking, updated initialization logic |
cpp/src/.../eri/*.h/cpp |
Added rohf_enabled parameter to all ERI implementations |
cpp/src/.../scf.cpp |
Enabled ROHF when scf_type="restricted" and system is open-shell |
cpp/tests/ut_common.hpp |
Added create_oh_structure() helper function |
cpp/tests/test_scf.cpp |
Added tests for ROHF with DIIS and ROHF+GDM error handling |
python/tests/test_scf.py |
Added Python test for ROHF with DIIS |
cpp/src/.../CMakeLists.txt |
Updated to include new source files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cpp/src/qdk/chemistry/algorithms/microsoft/scf/src/scf_algorithm/scf_algorithm.cpp
Show resolved
Hide resolved
cpp/src/qdk/chemistry/algorithms/microsoft/scf/src/scf_algorithm/scf_algorithm.cpp
Outdated
Show resolved
Hide resolved
cpp/src/qdk/chemistry/algorithms/microsoft/scf/src/scf_algorithm/scf_algorithm.cpp
Show resolved
Hide resolved
cpp/src/qdk/chemistry/algorithms/microsoft/scf/src/scf_algorithm/scf_algorithm.cpp
Show resolved
Hide resolved
cpp/src/qdk/chemistry/algorithms/microsoft/scf/src/scf_algorithm/rohf_diis.cpp
Outdated
Show resolved
Hide resolved
cpp/src/qdk/chemistry/algorithms/microsoft/scf/src/scf/scf_impl.cpp
Outdated
Show resolved
Hide resolved
cpp/src/qdk/chemistry/algorithms/microsoft/scf/include/qdk/chemistry/scf/core/scf_algorithm.h
Show resolved
Hide resolved
cpp/src/qdk/chemistry/algorithms/microsoft/scf/src/scf_algorithm/rohf_diis.cpp
Outdated
Show resolved
Hide resolved
cpp/src/qdk/chemistry/algorithms/microsoft/scf/src/scf_algorithm/rohf_diis.cpp
Outdated
Show resolved
Hide resolved
cpp/src/qdk/chemistry/algorithms/microsoft/scf/src/scf_algorithm/rohf_diis.cpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 32 out of 32 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cpp/src/qdk/chemistry/algorithms/microsoft/scf/src/scf_algorithm/rohf_diis.cpp
Outdated
Show resolved
Hide resolved
cpp/src/qdk/chemistry/algorithms/microsoft/scf/src/scf/scf_impl.cpp
Outdated
Show resolved
Hide resolved
cpp/src/qdk/chemistry/algorithms/microsoft/scf/include/qdk/chemistry/scf/core/eri.h
Outdated
Show resolved
Hide resolved
cpp/src/qdk/chemistry/algorithms/microsoft/scf/include/qdk/chemistry/scf/core/scf_algorithm.h
Outdated
Show resolved
Hide resolved
…is_unrestricted...
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 31 out of 31 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cpp/src/qdk/chemistry/algorithms/microsoft/scf/src/scf_algorithm/diis.cpp
Show resolved
Hide resolved
cpp/src/qdk/chemistry/algorithms/microsoft/scf/include/qdk/chemistry/scf/core/scf.h
Outdated
Show resolved
Hide resolved
cpp/src/qdk/chemistry/algorithms/microsoft/scf/src/scf_algorithm/scf_algorithm.cpp
Outdated
Show resolved
Hide resolved
|
@v-boqinzhang I've opened a new pull request, #371, to work on those changes. Once the pull request is ready, I'll request review from you. |
|
@copilot No, I just need a new OVERVIEW for the current PR, not a new PR. Please generate the new overview and close the PR you created. |
|
@v-boqinzhang I've opened a new pull request, #372, to work on those changes. Once the pull request is ready, I'll request review from you. |
No description provided.