Skip to content

Commit

Permalink
Merge branch 'develop' into hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
Qianruipku authored Jan 6, 2025
2 parents 4785da0 + 4009f6a commit 22da03d
Show file tree
Hide file tree
Showing 89 changed files with 8,111 additions and 104 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_test_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:
name: "Build with Intel toolchain"

- tag: gnu
build_args: "-DENABLE_LIBXC=1 -DENABLE_DEEPKS=1 -DENABLE_LIBRI=1 -DENABLE_PAW=1"
build_args: "-DENABLE_LIBXC=1 -DENABLE_DEEPKS=1 -DENABLE_MLKEDF=1 -DENABLE_LIBRI=1 -DENABLE_PAW=1"
name: "Build extra components with GNU toolchain"
- tag: intel
build_args: "-DENABLE_LIBXC=1 -DENABLE_DEEPKS=1 -DENABLE_LIBRI=1"
build_args: "-DENABLE_LIBXC=1 -DENABLE_DEEPKS=1 -DENABLE_MLKEDF=1 -DENABLE_LIBRI=1"
name: "Build extra components with Intel toolchain"

- tag: cuda
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Configure
run: |
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
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
- uses: pre-commit/[email protected]
with:
Expand Down
22 changes: 21 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ project(

option(ENABLE_LCAO "Enable LCAO calculation." ON)
option(ENABLE_DEEPKS "Enable DeePKS functionality" OFF)
option(ENABLE_MLKEDF "Enable Machine Learning based KEDF for OFDFT" OFF)
option(ENABLE_LIBXC "Enable LibXC functionality" OFF)
option(USE_CUDA "Enable support to CUDA for ABACUS." OFF)
option(ENABLE_FLOAT_FFTW "Enable support to single precision FFTW library." OFF)
Expand Down Expand Up @@ -469,10 +470,29 @@ if(ENABLE_DEEPKS)
add_compile_definitions(__DEEPKS)
endif()

if(ENABLE_MLKEDF)
target_link_libraries(${ABACUS_BIN_NAME} hamilt_mlkedf)

find_path(libnpy_SOURCE_DIR npy.hpp HINTS ${libnpy_INCLUDE_DIR})
if(NOT libnpy_SOURCE_DIR)
include(FetchContent)
FetchContent_Declare(
libnpy
GIT_REPOSITORY https://github.com/llohse/libnpy.git
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE)
FetchContent_MakeAvailable(libnpy)
else()
include_directories(${libnpy_INCLUDE_DIR})
endif()
include_directories(${libnpy_SOURCE_DIR}/include)
add_compile_definitions(__MLKEDF)
endif()

# Torch uses outdated components to detect CUDA arch, causing failure on
# latest CUDA kits. Set CMake variable TORCH_CUDA_ARCH_LIST in the form of
# "major.minor" if required.
if(ENABLE_DEEPKS OR DEFINED Torch_DIR)
if(ENABLE_DEEPKS OR ENABLE_MLKEDF OR DEFINED Torch_DIR)
find_package(Torch REQUIRED)
if(NOT Torch_VERSION VERSION_LESS "2.1.0")
set_if_higher(CMAKE_CXX_STANDARD 17)
Expand Down
6 changes: 6 additions & 0 deletions docs/CITATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@ The following references are required to be cited when using ABACUS. Specificall
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.

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.

- **If ML-KEDF is used:**

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.

Sun, Liang, and Mohan Chen. "Multi-channel machine learning based nonlocal kinetic energy density functional for semiconductors." Electronic Structure 6.4 (2024): 045006.
Loading

0 comments on commit 22da03d

Please sign in to comment.