Skip to content

Conversation

@Wuming-HUST
Copy link

Feature: add DFT-1/2 and shell DFT-1/2, currently only support PW esolver_ks_pw.

  • Added Sep, Sep_Cell, and VSep to organize the self-energy potential of DFT-1/2

  • Added a new effective potential pot_sep for calculating the self-energy potential

  • Added initialization of the self-energy potential in the esolver_ks_pw control flow

  • Added the keyword SEP_FILES in the STRU file for reading self-energy potential files

  • Added the dfthalf_type keyword in INPUT to enable DFT-1/2 and shell DFT-1/2

Reminder

  • Have you added adequate unit tests and/or case tests for your pull request?
  • Have you explained the changes of codes in core modules of ESolver, HSolver, ElecState, Hamilt, Operator or Psi? (ignore if not applicable)

Unit Tests and/or Case Tests for my changes

  • Added unit test for Sep and Sep_Cell.

What's changed?

  • I have additionally added the reading and processing of the self-consistent potential, which is currently only available in esolver_ks_pw.
  • The calculation of pot_sep is similar to that of pot_local, completed only during before_scf, having almost no impact on overall performance.
  • The STRU file has been enhanced with a keyword for reading self-energy potential files (.sep), and the format has been described.

…lver_ks_pw.

* Added Sep, Sep_Cell, and VSep to organize the self-energy potential of
DFT-1/2

* Added a new effective potential pot_sep for calculating the
self-energy potential

* Added initialization of the self-energy potential in the esolver_ks_pw
control flow

* Added the keyword SEP_FILES in the STRU file for reading self-energy
potential files

* Added the dfthalf_type keyword in INPUT to enable DFT-1/2 and shell
DFT-1/2
@mohanchen mohanchen added the Features Needed The features are indeed needed, and developers should have sophisticated knowledge label Sep 8, 2025
@mohanchen
Copy link
Collaborator

It seems that this PR breaks some tests for other functionalities. Besides, we should try avoid using GlobalC in the code.

@YuLiu98
Copy link
Collaborator

YuLiu98 commented Sep 11, 2025

I have some questions:

  1. What's the difference between C_ca_50.sep and F_pbe_50.sep, could you remove one of them to make the package smaller?
  2. It may be better to merge VSep_in_PW.* into pot_sep.*, just like efield.*.
  3. We do not recommend the usage of GlobalC .

Wuming-HUST and others added 10 commits September 12, 2025 18:41
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5 to 6.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ing#6494)

* Move hardware initializer out from esolver

* Remove useless codes

* Remove finalize code out
…ing#6495)

* Feature: support NVTX profiling via timer_enable_nvtx flag
Signed-off-by:Tianxiang Wang<[email protected]>, Contributed under MetaX Integrated Circuits (Shanghai) Co., Ltd.

* Add timer_enable_nvtx section in markdown
Signed-off-by:Tianxiang Wang<[email protected]>, Contributed under MetaX Integrated Circuits (Shanghai) Co., Ltd.

* Fix: Use __USE_NVTX macro to avoid NVTX linking errors in tests.
Clarify in docs that timer_enable_nvtx parameter only takes effect on CUDA platforms.
Signed-off-by:Tianxiang Wang<[email protected]>, Contributed under MetaX Integrated Circuits (Shanghai) Co., Ltd.
…on to GPU, and reducing memory transfers (deepmodeling#6493)

* Perf: Optimize Diago_DavSubspace with GPU operators by adding and fusing custom kernels.
Signed-off-by:Tianxiang Wang<[email protected]>, Contributed under MetaX Integrated Circuits (Shanghai) Co., Ltd.

* Perf: reduce memory allocation and copy in Diago_DavSubspace::diag_zhegvx
Signed-off-by:Tianxiang Wang<[email protected]>, Contributed under MetaX Integrated Circuits (Shanghai) Co., Ltd.

* Perf: Replace loop-based 2D copy and memset with memcpy_2d_op, memset_2d_op
Signed-off-by:Tianxiang Wang<[email protected]>, Contributed under MetaX Integrated Circuits (Shanghai) Co., Ltd.

* Perf: use warp reduce instead of shared memory for better efficiency
Signed-off-by:Tianxiang Wang<[email protected]>, Contributed under MetaX Integrated Circuits (Shanghai) Co., Ltd.

* Fix compilation error
Signed-off-by:Tianxiang Wang<[email protected]>, Contributed under MetaX Integrated Circuits (Shanghai) Co., Ltd.
…witch to nvtx3 headers when CUDA_VERSION >= 12090 (deepmodeling#6497)

* Fix: switch to nvtx3 headers when CUDA_VERSION >= 12090
Signed-off-by:Tianxiang Wang<[email protected]>, Contributed under MetaX Integrated Circuits (Shanghai) Co., Ltd.

* Fix: resolve compile error with USE_ELPA=OFF + BUILD_TESTING=ON
Signed-off-by:Tianxiang Wang<[email protected]>, Contributed under MetaX Integrated Circuits (Shanghai) Co., Ltd.
…ice(0) (deepmodeling#6498)

Signed-off-by:Tianxiang Wang<[email protected]>, Contributed under MetaX Integrated Circuits (Shanghai) Co., Ltd.
…D block parallelism to serial in Hcontainer(develop) (deepmodeling#6489)

* delete tem Hcontainer to reduce memory usage

* simplify the compute code

* change DM2D_tmp to dm2d_tmp, use vector instead of new
* Removed GlobalC::sep_cell and GlobalC::vsep_cell from GlobalC

* Integrated sep_cell into UnitCell

* Integrated vsep_cell into esolver_ks_pw

* Added empty constructors and destructors for Sep_Pot and Sep_Cell to
facilitate unit testing compilation
@mohanchen mohanchen merged commit 002786e into deepmodeling:develop Sep 20, 2025
14 checks passed
@mohanchen mohanchen added Refactor Refactor ABACUS codes Useful Information Useful information for others to learn/study labels Sep 20, 2025
@mohanchen mohanchen changed the title Feature: add DFT-1/2 and shell DFT-1/2, only support PW esolvers_ks_pw. Feature: add DFT-1/2 and shell DFT-1/2, only support PW esolvers_ks_pw. (Useful information to support DFT-1/2 method with pw basis set) Sep 20, 2025
@mohanchen
Copy link
Collaborator

#6470 solved

kluonj pushed a commit to kluonj/abacus-develop that referenced this pull request Sep 28, 2025
…w. (deepmodeling#6490)

* Feature: add DFT-1/2 and shell DFT-1/2, currently only support PW esolver_ks_pw.

* Added Sep, Sep_Cell, and VSep to organize the self-energy potential of
DFT-1/2

* Added a new effective potential pot_sep for calculating the
self-energy potential

* Added initialization of the self-energy potential in the esolver_ks_pw
control flow

* Added the keyword SEP_FILES in the STRU file for reading self-energy
potential files

* Added the dfthalf_type keyword in INPUT to enable DFT-1/2 and shell
DFT-1/2

* Fix: Compilation error in DeepKS unit tests after adding DFT-1/2

* Fix: Add the additional files to Makefile.Objects

* Build(deps): Bump actions/setup-python from 5 to 6 (deepmodeling#6492)

Bumps [actions/setup-python](https://github.com/actions/setup-python) from 5 to 6.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v5...v6)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* [Refactor] Move hardware initializer out from esolver code (deepmodeling#6494)

* Move hardware initializer out from esolver

* Remove useless codes

* Remove finalize code out

* Feature: support NVTX profiling via timer_enable_nvtx flag (deepmodeling#6495)

* Feature: support NVTX profiling via timer_enable_nvtx flag
Signed-off-by:Tianxiang Wang<[email protected]>, Contributed under MetaX Integrated Circuits (Shanghai) Co., Ltd.

* Add timer_enable_nvtx section in markdown
Signed-off-by:Tianxiang Wang<[email protected]>, Contributed under MetaX Integrated Circuits (Shanghai) Co., Ltd.

* Fix: Use __USE_NVTX macro to avoid NVTX linking errors in tests.
Clarify in docs that timer_enable_nvtx parameter only takes effect on CUDA platforms.
Signed-off-by:Tianxiang Wang<[email protected]>, Contributed under MetaX Integrated Circuits (Shanghai) Co., Ltd.

* Perf: Optimize Davidson by fusing operators, offloading CPU computation to GPU, and reducing memory transfers (deepmodeling#6493)

* Perf: Optimize Diago_DavSubspace with GPU operators by adding and fusing custom kernels.
Signed-off-by:Tianxiang Wang<[email protected]>, Contributed under MetaX Integrated Circuits (Shanghai) Co., Ltd.

* Perf: reduce memory allocation and copy in Diago_DavSubspace::diag_zhegvx
Signed-off-by:Tianxiang Wang<[email protected]>, Contributed under MetaX Integrated Circuits (Shanghai) Co., Ltd.

* Perf: Replace loop-based 2D copy and memset with memcpy_2d_op, memset_2d_op
Signed-off-by:Tianxiang Wang<[email protected]>, Contributed under MetaX Integrated Circuits (Shanghai) Co., Ltd.

* Perf: use warp reduce instead of shared memory for better efficiency
Signed-off-by:Tianxiang Wang<[email protected]>, Contributed under MetaX Integrated Circuits (Shanghai) Co., Ltd.

* Fix compilation error
Signed-off-by:Tianxiang Wang<[email protected]>, Contributed under MetaX Integrated Circuits (Shanghai) Co., Ltd.

* Fix: resolve compile error with USE_ELPA=OFF + BUILD_TESTING=ON and switch to nvtx3 headers when CUDA_VERSION >= 12090 (deepmodeling#6497)

* Fix: switch to nvtx3 headers when CUDA_VERSION >= 12090
Signed-off-by:Tianxiang Wang<[email protected]>, Contributed under MetaX Integrated Circuits (Shanghai) Co., Ltd.

* Fix: resolve compile error with USE_ELPA=OFF + BUILD_TESTING=ON
Signed-off-by:Tianxiang Wang<[email protected]>, Contributed under MetaX Integrated Circuits (Shanghai) Co., Ltd.

* Fix dsp compilation problem (deepmodeling#6499)

* Fix: Fix crash in Debug build with multi-GPU due to forced cudaSetDevice(0) (deepmodeling#6498)

Signed-off-by:Tianxiang Wang<[email protected]>, Contributed under MetaX Integrated Circuits (Shanghai) Co., Ltd.

* Removed the temporary variable DMRGint_full when transitioning from 2D block parallelism to serial in Hcontainer(develop) (deepmodeling#6489)

* delete tem Hcontainer to reduce memory usage

* simplify the compute code

* change DM2D_tmp to dm2d_tmp, use vector instead of new

* Update version to 3.9.0.14 (deepmodeling#6504)

* Refactor: Remove the GlobalC from sep_cell and vsep_cell

* Removed GlobalC::sep_cell and GlobalC::vsep_cell from GlobalC

* Integrated sep_cell into UnitCell

* Integrated vsep_cell into esolver_ks_pw

* Added empty constructors and destructors for Sep_Pot and Sep_Cell to
facilitate unit testing compilation

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Critsium <[email protected]>
Co-authored-by: Tianxiang Wang <[email protected]>
Co-authored-by: zgn-26714 <[email protected]>
Co-authored-by: Erjie Wu <[email protected]>
Co-authored-by: Mohan Chen <[email protected]>
@Wuming-HUST Wuming-HUST deleted the feature/dft-half branch September 30, 2025 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Features Needed The features are indeed needed, and developers should have sophisticated knowledge Refactor Refactor ABACUS codes Useful Information Useful information for others to learn/study

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants