Apply space-group symmetry transform in X2C GW and HF kernels #14
Open
gauravharsha wants to merge 6 commits into
Open
Apply space-group symmetry transform in X2C GW and HF kernels #14gauravharsha wants to merge 6 commits into
gauravharsha wants to merge 6 commits into
Conversation
Use value_AO in copy_Gk_2c and get_dm_fbz; restore off-diagonal Madelung in add_Ewald. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
check_x2c_hubbard_symmetry mirrors the green-mbpt test: verifies that one SCF step with space-group or TR-only symmetry gives the same Sigma at every IBZ k-point as the no-symmetry full-BZ run (tol=1e-8). s-type orbitals only; SU(2) spinor transform exercised but not higher angular-momentum orbital representations. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Applies full space-group (including time-reversal) AO-basis symmetry reconstruction G(k_full) = U_k G(k_ibz) U_k† in the X2C GPU HF/GW paths, and adds regression tests to ensure self-energies are symmetry-consistent across “no symmetry”, “TR-only”, and full space-group symmetry inputs.
Changes:
- X2C HF: reconstruct full-BZ density matrix blocks via
k_symmetry().value_AO(...)rather than manual TR-only spin-flip branching. - X2C GW: reconstruct full-BZ Green’s function blocks via
k_symmetry().value_AO(...)for both double and single precision overloads. - Tests: add Hubbard+Rashba symmetry-consistency checks for both HF and GW kernels.
Reviewed changes
Copilot reviewed 3 out of 13 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/cu_solver_test.cpp | Adds new Hubbard+Rashba symmetry consistency test sections for HF and GW. |
| src/hf_gpu_kernel.cpp | Updates X2C HF density-matrix reconstruction to use value_AO for full symmetry transforms. |
| src/gw_gpu_kernel.cpp | Updates X2C GW copy_Gk_2c to use value_AO for full symmetry transforms (double + float). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+164
to
+172
| if (scf_type == "GW") { | ||
| green::grids::transformer_t ft(p); | ||
| auto [kernel, solver] = green::gpu::custom_gw_kernel(true, p, nao, nso, ns, NQ, ft, bz, Sk); | ||
| solver(G_shared, S_shared); | ||
| result.resize(nts, ns, ink, nso, nso); | ||
| S_shared.fence(); | ||
| if (!green::utils::context().node_rank) result << S_shared.object(); | ||
| S_shared.fence(); | ||
| } else { |
Comment on lines
+107
to
+112
| const std::string dir = TEST_PATH + "/GW_X2C_Hubbard"s; | ||
| const std::string df_path = dir + (scf_type == "GW" ? "/df_int"s : "/df_hf_int"s); | ||
| const std::string grid_file = GRID_PATH + "/ir/1e4.h5"s; | ||
| constexpr size_t ns = 1, nk = 36, nso = 4, nao = 2; | ||
| constexpr double tol = 1e-8; | ||
|
|
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ed ns/nk/nso/nao/ink
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.
G(k) = U_k G(ik) U_k†in the X2C GPU HF and GW kernels.get_dm_fbzandcopy_Gk_2cpreviously handled time-reversal via a hardcoded spin-flip without applying the spatial rotationU_k; both now usevalue_AOuniformly, removing all manualtr_conjbranching.check_x2c_hubbard_symmetrytests for HF and GW usingcustom_hf_kernel/custom_gw_kernel, verifying Sigma consistency across symmetry cases at tolerance 1e-8 on the same Hubbard+Rashba test data.Follows up on Green-Phys/green-mbpt#50