Skip to content

Apply space-group symmetry transform in X2C GW and HF kernels #14

Open
gauravharsha wants to merge 6 commits into
mainfrom
symm-x2c
Open

Apply space-group symmetry transform in X2C GW and HF kernels #14
gauravharsha wants to merge 6 commits into
mainfrom
symm-x2c

Conversation

@gauravharsha
Copy link
Copy Markdown
Contributor

  • Applies the full space-group symmetry transform G(k) = U_k G(ik) U_k† in the X2C GPU HF and GW kernels. get_dm_fbz and copy_Gk_2c previously handled time-reversal via a hardcoded spin-flip without applying the spatial rotation U_k; both now use value_AO uniformly, removing all manual tr_conj branching.
  • Adds check_x2c_hubbard_symmetry tests for HF and GW using custom_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

gauravharsha and others added 2 commits May 18, 2026 21:17
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>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 thread test/cu_solver_test.cpp
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 thread test/cu_solver_test.cpp
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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants