Skip to content

Feature: add gga_grad parameter for noncollinear spin GGA functional - #7758

Open
dyzheng wants to merge 3 commits into
deepmodeling:developfrom
dyzheng:feat/issue-7730-gga-grad
Open

Feature: add gga_grad parameter for noncollinear spin GGA functional#7758
dyzheng wants to merge 3 commits into
deepmodeling:developfrom
dyzheng:feat/issue-7730-gga-grad

Conversation

@dyzheng

@dyzheng dyzheng commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

Reminder

  • I have read AGENTS.md and docs/developers_guide/agent_governance.md.
  • I have linked an issue or explained why this PR does not need one.
  • I have added adequate unit tests and/or case tests, or explained why not.
  • I have listed the exact verification commands run and their results.
  • I have described user-visible behavior changes, including INPUT parameter changes.
  • I have explained core-module impact for ESolver, HSolver, ElecState, Hamilt, Operator, Psi, or other source/ changes.
  • I have requested any needed governance exception below.

Linked Issue

Fix #7730

Unit Tests and/or Case Tests for my changes

  • Commands run:
  • Result summary:
  • Checks not run, with reason:

What's changed?

  • Example: brief summary of the user-visible or developer-facing change.

Governance Notes

  • INPUT/docs changes:
  • Core module impact:
  • Exceptions requested:

dyzheng added 3 commits August 2, 2026 11:06
The gga_grad=3 path (default for nspin=4) incorrectly used the
collinear approximation (gga_grad=1) within libxc instead of the
Scalmani-Frisch gradient method (gga_grad=2). This caused inconsistent
results for noncollinear GGA calculations.

Fix: extend libxc_pot.cpp and libxc_tools.cpp gga_grad==2 checks
to also match gga_grad==3, routing both through the SF gradient path.

Also fix input_parameter.h: restore out_hsr/out_hsk/out_hsr_npz_compat
members removed during cherry-pick that were present in newer develop.
- Fix libxc_tools.cpp vtxc: use chr->rho[is][ir] (nspin=4 density)
  instead of libxc-format rho (up/dn spin density)
- Revert libxc_setup.cpp to develop (the accel branch changes
  had map key collision, PBEH param count error, and weakened
  param validation)
- Revert input_parameter.h: restore develop defaults for device,
  sc_* params, xc_exch_ext/xc_corr_ext; keep only gga_grad=3
- Revert docs to develop version
- libxc_pot.cpp: comments for SF gradient decomposition, gga_grad branching
- libxc_tools.cpp: comment for nspin=4 SF dh path with 4-component potential
- xc_pot.cpp: comment for non-libxc SF builtin dispatch
- xc_functional_gga_noncol_sf_builtin.cpp: header comment block with
  Scalmani-Frisch reference, chain-rule formulas, and step-by-step labels
@mohanchen mohanchen added the Feature Discussed The features will be discussed first but will not be implemented soon label Aug 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Discussed The features will be discussed first but will not be implemented soon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Noncollinear GGA gradient methods (gga_grad) and build/test infrastructure cleanup

2 participants