Skip to content

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

Description

@dyzheng

Background

Background

Two independent, low-risk items: (a) a new gga_grad input parameter selecting among 3 gradient evaluation methods for noncollinear GGA functionals, including a built-in spin-flip (SF) formulation; (b) a batch of build/compatibility/test-infrastructure fixes that are prerequisites for a clean CI but unrelated to any single feature.

Part A: Noncollinear GGA gga_grad

  • New input parameter gga_grad for noncollinear GGA calculations with 3 gradient methods.
  • gga_grad=3 uses a built-in spin-flip formulation (xc_functional_gga_noncol_sf_builtin.{h,cpp}, ~300 lines) instead of relying on libxc internals; SF builtin dispatch is disabled for other gga_grad values.
  • libxc interface updates (libxc_abacus.h, libxc_pot.cpp, libxc_tools.cpp) and xc_pot.cpp plumbing.
  • Docs: gga_grad documentation for noncollinear calculations.

Part B: Build / compatibility / test infrastructure

  1. C++11 compatibility: replace make_unique with explicit new, use C++11-compatible is_same and unique_ptr::reset.
  2. Remove stale use_paw parameter from HSolverPW/DiagoDavid constructor calls in esolver_ks_pw, esolver_sdft_pw, and hsolver_lrtd (libpaw was removed in PR delete libpaw (useless) #7273).
  3. catch_properties.sh stress parsing: exclude the TOTAL-PRESSURE: line by matching numeric lines only, and use tail -3 (not head -3) to take the final converged stress in cell-relax runs.
  4. MPI/FFTW cleanup order: restore proper finalization order to fix the segfault at MPI_Finalize.
  5. Uninitialized local variables in hamilt2rho_single.
  6. SDFT-GPU: restore the lazy-allocation guard for vkb in getgradq_vnl.
  7. CI: fix pyabacus link error and CMake CMP0177 policy; sync pw_basis_k.cpp warning message with develop.
  8. Restore develop's DeepKS files to fix LIBRI compilation; remove the obsolete, never-run NO_GO_deepks_UT/NO_KP_deepks_UT unit test scaffolding.
  9. reserveresize UB fixes in basic_funcs.cpp (3 occurrences).
  10. Register the tests/17_DS_DFTU/ integration test suite skeleton (CASES_CPU.txt, CMakeLists registration, shared tests/PP_ORB/O.upf) so feature PRs can add cases incrementally.

Scope

  • source/source_hamilt/module_xc/
  • source/source_esolver/esolver_ks_pw.cpp, esolver_sdft_pw.cpp, source/source_hsolver/hsolver_lrtd.cpp
  • tests/integrate/tools/catch_properties.sh, tests/CMakeLists.txt, tests/PP_ORB/O.upf
  • source/source_lcao/module_deepks/test/ (cleanup)
  • Misc build fixes listed above

Testing

  • Noncollinear GGA cases with gga_grad=1/2/3 (energies and forces consistent across methods).
  • Full CI matrix (GNU toolchain, GPU build, pyabacus).

Dependencies

  • None; independent of Issues 1-4 and can be merged in parallel.

Related

Split out from PR #7693.

Describe the solution you'd like

Above.

Task list only for developers

  • Notice possible changes of behavior
  • Explain the changes of codes in core modules of ESolver, HSolver, ElecState, Hamilt, Operator or Psi

Notice Possible Changes of Behavior (Reminder only for developers)

No response

Notice any changes of core modules (Reminder only for developers)

No response

Notice Possible Changes of Core Modules (Reminder only for developers)

No response

Additional Context

No response

Task list for Issue attackers (only for developers)

  • Review and understand the proposed feature and its importance.
  • Research on the existing solutions and relevant research articles/resources.
  • Discuss with the team to evaluate the feasibility of implementing the feature.
  • Create a design document outlining the proposed solution and implementation details.
  • Get feedback from the team on the design document.
  • Develop the feature following the agreed design.
  • Write unit tests and integration tests for the feature.
  • Update the documentation to include the new feature.
  • Perform code review and address any issues.
  • Merge the feature into the main branch.
  • Monitor for any issues or bugs reported by users after the feature is released.
  • Address any issues or bugs reported by users and continuously improve the feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature DiscussedThe features will be discussed first but will not be implemented soon

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions