Skip to content

Commit b0cd8cd

Browse files
authored
Merge branch 'develop' into out-pLpR-1
2 parents 4c6e7c8 + 06cffb7 commit b0cd8cd

File tree

1,972 files changed

+96444
-97780
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,972 files changed

+96444
-97780
lines changed

.github/workflows/build_test_cmake.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ jobs:
1717
name: "Build with Intel toolchain"
1818

1919
- tag: gnu
20-
build_args: "-DENABLE_LIBXC=1 -DENABLE_DEEPKS=1 -DENABLE_LIBRI=1 -DENABLE_PAW=1"
20+
build_args: "-DENABLE_LIBXC=1 -DENABLE_DEEPKS=1 -DENABLE_MLKEDF=1 -DENABLE_LIBRI=1 -DENABLE_PAW=1"
2121
name: "Build extra components with GNU toolchain"
2222
- tag: intel
23-
build_args: "-DENABLE_LIBXC=1 -DENABLE_DEEPKS=1 -DENABLE_LIBRI=1"
23+
build_args: "-DENABLE_LIBXC=1 -DENABLE_DEEPKS=1 -DENABLE_MLKEDF=1 -DENABLE_LIBRI=1"
2424
name: "Build extra components with Intel toolchain"
2525

2626
- tag: cuda

.github/workflows/coverage.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
uses: actions/checkout@v4
1616
- name: Install Requirements for Coverage Testing
1717
run: |
18-
apt update && apt install -y lcov gpg
18+
apt update && apt install -y lcov gpg curl jq ca-certificates
1919
- name: Building
2020
run: |
2121
cmake -B build -DENABLE_COVERAGE=ON -DBUILD_TESTING=ON -DENABLE_DEEPKS=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_PAW=ON -DENABLE_GOOGLEBENCH=ON -DENABLE_RAPIDJSON=ON
@@ -27,8 +27,10 @@ jobs:
2727
run: |
2828
cmake --build build --target test ARGS="-V --timeout 21600" || exit 0
2929
- name: Upload Coverage to Codecov
30-
uses: codecov/codecov-action@v4
30+
uses: codecov/codecov-action@v5
3131
if: ${{ ! cancelled() }}
3232
with:
33-
gcov: true
33+
fail_ci_if_error: true
3434
token: ${{ secrets.CODECOV_TOKEN }}
35+
skip_validation: true
36+
verbose: true

.github/workflows/test.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,18 @@ jobs:
3131
3232
- name: Configure
3333
run: |
34-
cmake -B build -DBUILD_TESTING=ON -DENABLE_DEEPKS=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_PAW=ON -DENABLE_GOOGLEBENCH=ON -DENABLE_RAPIDJSON=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=1
34+
cmake -B build -DBUILD_TESTING=ON -DENABLE_DEEPKS=ON -DENABLE_MLKEDF=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_PAW=ON -DENABLE_GOOGLEBENCH=ON -DENABLE_RAPIDJSON=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=1
3535
36-
- uses: pre-commit/[email protected]
37-
with:
38-
extra_args:
39-
--from-ref ${{ github.event.pull_request.base.sha }}
40-
--to-ref ${{ github.event.pull_request.head.sha }}
41-
continue-on-error: true
42-
- uses: pre-commit-ci/[email protected]
36+
# Temporarily removed because no one maintains this now.
37+
# And it will break the CI test workflow.
38+
39+
# - uses: pre-commit/[email protected]
40+
# with:
41+
# extra_args:
42+
# --from-ref ${{ github.event.pull_request.base.sha }}
43+
# --to-ref ${{ github.event.pull_request.head.sha }}
44+
# continue-on-error: true
45+
# - uses: pre-commit-ci/[email protected]
4346

4447
- name: Build
4548
run: |

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@ STRU_READIN_ADJUST.cif
1717
build
1818
dist
1919
.idea
20-
toolchain.tar.gz
2120
time.json
2221
*.pyc
2322
__pycache__
2423
abacus.json
2524
*.npy
25+
toolchain/install/
26+
toolchain/abacus_env.sh

CMakeLists.txt

Lines changed: 59 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ project(
1212

1313
option(ENABLE_LCAO "Enable LCAO calculation." ON)
1414
option(ENABLE_DEEPKS "Enable DeePKS functionality" OFF)
15+
option(ENABLE_MLKEDF "Enable Machine Learning based KEDF for OFDFT" OFF)
1516
option(ENABLE_LIBXC "Enable LibXC functionality" OFF)
1617
option(USE_CUDA "Enable support to CUDA for ABACUS." OFF)
1718
option(ENABLE_FLOAT_FFTW "Enable support to single precision FFTW library." OFF)
@@ -40,6 +41,8 @@ option(ENABLE_CNPY "Enable cnpy usage." OFF)
4041
option(ENABLE_PEXSI "Enable support for PEXSI." OFF)
4142
option(ENABLE_CUSOLVERMP "Enable cusolvermp." OFF)
4243
option(USE_DSP "Enable DSP usage." OFF)
44+
option(USE_CUDA_ON_DCU "Enable CUDA on DCU" OFF)
45+
option(USE_CUDA_MPI "Enable CUDA-aware MPI" OFF)
4346

4447
# enable json support
4548
if(ENABLE_RAPIDJSON)
@@ -126,6 +129,14 @@ if (USE_DSP)
126129
set(ABACUS_BIN_NAME abacus_dsp)
127130
endif()
128131

132+
if (USE_CUDA_ON_DCU)
133+
add_compile_definitions(__CUDA_ON_DCU)
134+
endif()
135+
136+
if (USE_CUDA_MPI)
137+
add_compile_definitions(__CUDA_MPI)
138+
endif()
139+
129140
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
130141

131142
if(ENABLE_COVERAGE)
@@ -230,6 +241,9 @@ if(ENABLE_LCAO)
230241
add_compile_definitions(__PEXSI)
231242
set(CMAKE_CXX_STANDARD 14)
232243
endif()
244+
if(NEW_GINT)
245+
add_compile_definitions(__NEW_GINT)
246+
endif()
233247
else()
234248
set(ENABLE_DEEPKS OFF)
235249
set(ENABLE_LIBRI OFF)
@@ -248,8 +262,12 @@ if(ENABLE_MPI)
248262
endif()
249263

250264
if (USE_DSP)
251-
target_link_libraries(${ABACUS_BIN_NAME} ${DIR_MTBLAS_LIBRARY})
252265
add_compile_definitions(__DSP)
266+
target_link_libraries(${ABACUS_BIN_NAME} ${OMPI_LIBRARY1})
267+
include_directories(${MTBLAS_FFT_DIR}/libmtblas/include)
268+
include_directories(${MT_HOST_DIR}/include)
269+
target_link_libraries(${ABACUS_BIN_NAME} ${MT_HOST_DIR}/hthreads/lib/libhthread_device.a)
270+
target_link_libraries(${ABACUS_BIN_NAME} ${MT_HOST_DIR}/hthreads/lib/libhthread_host.a)
253271
endif()
254272

255273
find_package(Threads REQUIRED)
@@ -334,9 +352,19 @@ if(USE_CUDA)
334352
endif()
335353
if (ENABLE_CUSOLVERMP)
336354
add_compile_definitions(__CUSOLVERMP)
355+
find_library(CAL_LIBRARY
356+
NAMES cal
357+
PATHS ${CAL_CUSOLVERMP_PATH}
358+
NO_DEFAULT_PATH
359+
)
360+
find_library(CUSOLVERMP_LIBRARY
361+
NAMES cusolverMp
362+
PATHS ${CAL_CUSOLVERMP_PATH}
363+
NO_DEFAULT_PATH
364+
)
337365
target_link_libraries(${ABACUS_BIN_NAME}
338-
cal
339-
cusolverMp
366+
${CAL_LIBRARY}
367+
${CUSOLVERMP_LIBRARY}
340368
)
341369
endif()
342370
endif()
@@ -420,12 +448,8 @@ else()
420448
find_package(Lapack REQUIRED)
421449
include_directories(${FFTW3_INCLUDE_DIRS})
422450
list(APPEND math_libs FFTW3::FFTW3 LAPACK::LAPACK BLAS::BLAS)
423-
424-
if(ENABLE_LCAO)
425-
find_package(ScaLAPACK REQUIRED)
426-
list(APPEND math_libs ScaLAPACK::ScaLAPACK)
427-
endif()
428-
451+
find_package(ScaLAPACK REQUIRED)
452+
list(APPEND math_libs ScaLAPACK::ScaLAPACK)
429453
if(USE_OPENMP)
430454
list(APPEND math_libs FFTW3::FFTW3_OMP)
431455
endif()
@@ -466,10 +490,29 @@ if(ENABLE_DEEPKS)
466490
add_compile_definitions(__DEEPKS)
467491
endif()
468492

493+
if(ENABLE_MLKEDF)
494+
target_link_libraries(${ABACUS_BIN_NAME} hamilt_mlkedf)
495+
496+
find_path(libnpy_SOURCE_DIR npy.hpp HINTS ${libnpy_INCLUDE_DIR})
497+
if(NOT libnpy_SOURCE_DIR)
498+
include(FetchContent)
499+
FetchContent_Declare(
500+
libnpy
501+
GIT_REPOSITORY https://github.com/llohse/libnpy.git
502+
GIT_SHALLOW TRUE
503+
GIT_PROGRESS TRUE)
504+
FetchContent_MakeAvailable(libnpy)
505+
else()
506+
include_directories(${libnpy_INCLUDE_DIR})
507+
endif()
508+
include_directories(${libnpy_SOURCE_DIR}/include)
509+
add_compile_definitions(__MLKEDF)
510+
endif()
511+
469512
# Torch uses outdated components to detect CUDA arch, causing failure on
470513
# latest CUDA kits. Set CMake variable TORCH_CUDA_ARCH_LIST in the form of
471514
# "major.minor" if required.
472-
if(ENABLE_DEEPKS OR DEFINED Torch_DIR)
515+
if(ENABLE_DEEPKS OR ENABLE_MLKEDF OR DEFINED Torch_DIR)
473516
find_package(Torch REQUIRED)
474517
if(NOT Torch_VERSION VERSION_LESS "2.1.0")
475518
set_if_higher(CMAKE_CXX_STANDARD 17)
@@ -709,22 +752,24 @@ target_link_libraries(
709752
hamilt_stodft
710753
psi
711754
psi_initializer
755+
psi_overall_init
712756
esolver
713757
vdw
714758
device
715-
container)
759+
container
760+
dftu
761+
deltaspin)
716762
if(ENABLE_LCAO)
717763
target_link_libraries(
718764
${ABACUS_BIN_NAME}
719765
hamilt_lcao
720766
tddft
721767
orb
722768
gint
723-
dftu
724769
hcontainer
725-
deltaspin
726770
numerical_atomic_orbitals
727-
lr)
771+
lr
772+
rdmft)
728773
if(USE_ELPA)
729774
target_link_libraries(${ABACUS_BIN_NAME} genelpa)
730775
endif()

Dockerfile.intel

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ RUN source /opt/intel/oneapi/setvars.sh && \
4444
ln -s /usr/local/include/elpa_openmp-$ELPA_VER/elpa /usr/local/include/ && \
4545
cd /tmp && rm -rf elpa-$ELPA_VER
4646

47+
RUN cd /tmp && git clone https://github.com/Tencent/rapidjson.git && cp -r rapidjson/include/rapidjson /usr/include/ \
48+
&& rm -rf rapidjson
49+
4750
RUN wget https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-2.0.0%2Bcpu.zip \
4851
--no-check-certificate --quiet -O libtorch.zip && \
4952
unzip -q libtorch.zip -d /opt && rm libtorch.zip

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
# About ABACUS
1414

15-
ABACUS (Atomic-orbital Based Ab-initio Computation at UStc) is an open-source package based on density functional theory (DFT). The package utilizes both plane wave and numerical atomic basis sets with the usage of norm-conserving pseudopotentials to describe the interactions between nuclear ions and valence electrons. ABACUS supports LDA, GGA, meta-GGA, and hybrid functionals. Apart from single-point calculations, the package allows geometry optimizations and ab-initio molecular dynamics with various ensembles. The package also provides a variety of advanced functionalities for simulating materials, including the DFT+U, VdW corrections, and implicit solvation model, etc. In addition, ABACUS strives to provide a general infrastructure to facilitate the developments and applications of novel machine-learning-assisted DFT methods (DeePKS, DP-GEN, DeepH, DeePTB etc.) in molecular and material simulations.
15+
ABACUS (**A**tomic-orbital **B**ased **A**b-initio **C**omputation at **US**tc) is an open-source package based on density functional theory (DFT). The package utilizes both plane wave and numerical atomic basis sets with the usage of pseudopotentials to describe the interactions between nuclear ions and valence electrons. ABACUS supports LDA, GGA, meta-GGA, and hybrid functionals. Apart from single-point calculations, the package allows geometry optimizations and ab-initio molecular dynamics with various ensembles. The package also provides a variety of advanced functionalities for simulating materials, including the DFT+U, VdW corrections, and implicit solvation model, etc. In addition, ABACUS strives to provide a general infrastructure to facilitate the developments and applications of novel machine-learning-assisted DFT methods (DeePKS, DP-GEN, DeepH, DeePTB etc.) in molecular and material simulations.
1616

1717
# Online Documentation
1818
For detailed documentation, please refer to [our documentation website](https://abacus.deepmodeling.com/).

cmake/FindMKL.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ endif()
8383
endif() # MKL::MKL
8484

8585
# For compatibility with legacy libpaw_interface CMakeLists.txt
86-
if(TARGET MKL::MKL)
86+
if(TARGET MKL::MKL AND NOT TARGET IntelMKL::MKL)
8787
add_library(IntelMKL::MKL ALIAS MKL::MKL)
8888
endif()
8989

docs/CITATIONS.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,18 @@ The following references are required to be cited when using ABACUS. Specificall
44

55
- **For general purpose:**
66

7+
*For LCAO basis:*
8+
79
Mohan Chen, G. C. Guo, and Lixin He. "Systematically improvable optimized atomic basis sets for ab initio calculations." Journal of Physics: Condensed Matter 22.44 (2010): 445501.
810

911
Pengfei Li, et al. "Large-scale ab initio simulations based on systematically improvable atomic basis." Computational Materials Science 112 (2016): 503-517.
1012

13+
Peize Lin, Xinguo Ren, Xiaohui Liu, Lixin He. Ab initio electronic structure calculations based on numerical atomic orbitals: Basic fomalisms and recent progresses. Wiley Interdisciplinary Reviews: Computational Molecular Science, 2024, 14(1): e1687.
14+
15+
*For LCAO and PW basis:*
16+
17+
Weiqing Zhou, Deye Zheng, Qianrui Liu, et al. ABACUS: An Electronic Structure Analysis Package for the AI Era. arXiv preprint arXiv:2501.08697, 2025.
18+
1119
- **If Stochastic DFT is used:**
1220

1321
Qianrui Liu, and Mohan Chen. "Plane-Wave-Based Stochastic-Deterministic Density Functional Theory for Extended Systems." <https://arxiv.org/abs/2204.05662>.
@@ -33,3 +41,9 @@ The following references are required to be cited when using ABACUS. Specificall
3341
Peize Lin, Xinguo Ren, and Lixin He. "Efficient Hybrid Density Functional Calculations for Large Periodic Systems Using Numerical Atomic Orbitals." Journal of Chemical Theory and Computation 2021, 17(1), 222–239.
3442

3543
Peize Lin, Xinguo Ren, and Lixin He. "Accuracy of Localized Resolution of the Identity in Periodic Hybrid Functional Calculations with Numerical Atomic Orbitals." Journal of Physical Chemistry Letters 2020, 11, 3082-3088.
44+
45+
- **If ML-KEDF is used:**
46+
47+
Sun, Liang, and Mohan Chen. "Machine learning based nonlocal kinetic energy density functional for simple metals and alloys." Physical Review B 109.11 (2024): 115135.
48+
49+
Sun, Liang, and Mohan Chen. "Multi-channel machine learning based nonlocal kinetic energy density functional for semiconductors." Electronic Structure 6.4 (2024): 045006.

docs/DevelopingTeam.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ The current development team consists the following research groups/affiliations
44
- University of Science and Technology of China (Dr. Lixin He)
55
- Peking University (Dr. Mohan Chen)
66
- Institute of Physics, Chinese Academy of Sciences (Dr. Xinguo Ren)
7-
- Beijing AI for Science Institute
8-
- Institute of Artificial Intelligence, Hefei Comprehensive National Science Center.
7+
- Beijing AI for Science Institute (Dr. Daye Zheng)
8+
- Institute of Artificial Intelligence, Hefei Comprehensive National Science Center (Dr. Lixin He).

0 commit comments

Comments
 (0)