Skip to content

Commit dc28b4a

Browse files
committed
Merge branch 'master' of https://github.com/sunliang98/abacus-develop into ML_KEDF_merge
2 parents ffa2dcf + aacf171 commit dc28b4a

File tree

304 files changed

+14747
-8376
lines changed

Some content is hidden

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

304 files changed

+14747
-8376
lines changed

.github/pull_request_template.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
### Reminder
22
- [ ] Have you linked an issue with this pull request?
3+
- [ ] Have you added adequate unit tests and/or case tests for your pull request?
34
- [ ] Have you noticed possible changes of behavior below or in the linked issue?
45
- [ ] Have you explained the changes of codes in core modules of ESolver, HSolver, ElecState, Hamilt, Operator or Psi? (ignore if not applicable)
56

67
### Linked Issue
78
Fix #...
89

10+
### Unit Tests and/or Case Tests for my changes
11+
- A unit test is added for each new feature or bug fix.
12+
913
### What's changed?
1014
- Example: My changes might affect the performance of the application under certain conditions, and I have tested the impact on various scenarios...
1115

.github/workflows/pytest.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Pyabacus Build and Test
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
test:
8+
name: PyTest
9+
runs-on: ubuntu-latest
10+
container:
11+
image: ghcr.io/deepmodeling/abacus-gnu
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: 3.8
19+
- name: Build Pyabacus
20+
run: |
21+
cd python/pyabacus
22+
python -m pip install -v .[test]
23+
- name: Test Pyabacus
24+
run: |
25+
cd python/pyabacus/tests
26+
pytest -v

CMakeLists.txt

+1-11
Original file line numberDiff line numberDiff line change
@@ -397,19 +397,9 @@ if(MKLROOT)
397397
list(APPEND math_libs -lifcore)
398398
endif()
399399
else()
400-
# In compatibility to builtin FindLAPACK.cmake before v3.5.4
401-
if(DEFINED LAPACK_DIR)
402-
string(APPEND CMAKE_PREFIX_PATH ";${LAPACK_DIR}")
403-
endif()
404-
if(DEFINED LAPACK_LIBRARY)
405-
set(LAPACK_LIBRARIES ${LAPACK_LIBRARY})
406-
endif()
407-
if(DEFINED BLAS_DIR)
408-
string(APPEND CMAKE_PREFIX_PATH ";${BLAS_DIR}")
409-
endif()
410400

411401
find_package(FFTW3 REQUIRED)
412-
find_package(LAPACK REQUIRED)
402+
find_package(Lapack REQUIRED)
413403
include_directories(${FFTW3_INCLUDE_DIRS})
414404
list(APPEND math_libs FFTW3::FFTW3 LAPACK::LAPACK BLAS::BLAS)
415405

Dockerfile.cuda

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ADD https://api.github.com/repos/deepmodeling/abacus-develop/git/refs/heads/deve
1717

1818
RUN git clone https://github.com/deepmodeling/abacus-develop.git --depth 1 && \
1919
cd abacus-develop && \
20-
cmake -B build -DUSE_CUDA=ON && \
20+
cmake -B build -DUSE_CUDA=ON -DENABLE_RAPIDJSON=ON && \
2121
cmake --build build -j`nproc` && \
2222
cmake --install build && \
2323
rm -rf build && \

Dockerfile.gnu

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ ADD https://api.github.com/repos/deepmodeling/abacus-develop/git/refs/heads/deve
2121

2222
RUN git clone https://github.com/deepmodeling/abacus-develop.git --depth 1 && \
2323
cd abacus-develop && \
24-
cmake -B build -DENABLE_DEEPKS=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON && \
24+
cmake -B build -DENABLE_DEEPKS=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_RAPIDJSON=ON && \
2525
cmake --build build -j`nproc` && \
2626
cmake --install build && \
2727
rm -rf build && \

Dockerfile.intel

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ ADD https://api.github.com/repos/deepmodeling/abacus-develop/git/refs/heads/deve
5656
RUN source /opt/intel/oneapi/setvars.sh && \
5757
git clone https://github.com/deepmodeling/abacus-develop.git --depth 1 && \
5858
cd abacus-develop && \
59-
cmake -B build -DENABLE_DEEPKS=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON && \
59+
cmake -B build -DENABLE_DEEPKS=ON -DENABLE_LIBXC=ON -DENABLE_LIBRI=ON -DENABLE_RAPIDJSON=ON && \
6060
cmake --build build -j`nproc` && \
6161
cmake --install build && \
6262
rm -rf build && \

cmake/FindBlas.cmake

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
if(DEFINED BLAS_DIR)
2+
string(APPEND CMAKE_PREFIX_PATH ";${BLAS_DIR}")
3+
endif()
4+
if(DEFINED BLAS_LIBRARY)
5+
set(BLAS_LIBRARIES ${BLAS_LIBRARY})
6+
endif()
7+
8+
find_package(BLAS REQUIRED)
9+
10+
if(NOT TARGET BLAS::BLAS)
11+
add_library(BLAS::BLAS UNKNOWN IMPORTED)
12+
set_target_properties(BLAS::BLAS PROPERTIES
13+
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
14+
IMPORTED_LOCATION "${BLAS_LIBRARIES}")
15+
endif()

cmake/FindLapack.cmake

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# In compatibility to builtin FindLAPACK.cmake before v3.5.4
2+
if(DEFINED LAPACK_DIR)
3+
string(APPEND CMAKE_PREFIX_PATH ";${LAPACK_DIR}")
4+
endif()
5+
if(DEFINED LAPACK_LIBRARY)
6+
set(LAPACK_LIBRARIES ${LAPACK_LIBRARY})
7+
endif()
8+
9+
find_package(Blas REQUIRED)
10+
find_package(LAPACK REQUIRED)
11+
12+
if(NOT TARGET LAPACK::LAPACK)
13+
add_library(LAPACK::LAPACK UNKNOWN IMPORTED)
14+
set_target_properties(LAPACK::LAPACK PROPERTIES
15+
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
16+
IMPORTED_LOCATION "${LAPACK_LIBRARIES}")
17+
endif()

cmake/FindLibxc.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ endif()
1111
find_package(PkgConfig)
1212
if(PKG_CONFIG_FOUND)
1313
pkg_search_module(Libxc IMPORTED_TARGET GLOBAL libxc)
14-
find_package_handle_standard_args(Libxc DEFAULT_MSG Libxc_LINK_LIBRARIES Libxc_INCLUDE_DIRS)
14+
find_package_handle_standard_args(Libxc DEFAULT_MSG Libxc_LINK_LIBRARIES Libxc_FOUND)
1515
endif()
1616
if(NOT Libxc_FOUND)
1717
find_package(Libxc REQUIRED HINTS

docs/advanced/input_files/input-main.md

+25-9
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@
276276
- [hubbard\_u](#hubbard_u)
277277
- [yukawa\_potential](#yukawa_potential)
278278
- [yukawa\_lambda](#yukawa_lambda)
279+
- [uramping](#uramping)
279280
- [omc](#omc)
280281
- [onsite\_radius](#onsite_radius)
281282
- [vdW correction](#vdw-correction)
@@ -338,8 +339,8 @@
338339
- [td\_trigo\_amp](#td_trigo_amp)
339340
- [td\_heavi\_t0](#td_heavi_t0)
340341
- [td\_heavi\_amp](#td_heavi_amp)
341-
- [td\_out\_dipole](#td_out_dipole)
342-
- [td\_out\_efield](#td_out_efield)
342+
- [out\_dipole](#out_dipole)
343+
- [out\_efield](#out_efield)
343344
- [ocp](#ocp)
344345
- [ocp\_set](#ocp_set)
345346
- [Variables useful for debugging](#variables-useful-for-debugging)
@@ -441,8 +442,9 @@ These variables are used to control general system parameters.
441442
- 0: Only time reversal symmetry would be considered in symmetry operations, which implied k point and -k point would be treated as a single k point with twice the weight.
442443
- 1: Symmetry analysis will be performed to determine the type of Bravais lattice and associated symmetry operations. (point groups, space groups, primitive cells, and irreducible k-points)
443444
- **Default**:
444-
- -1: if (*[dft_fuctional](#dft_functional)==hse/hf/pbe0/scan0/opt_orb* or *[rpa](#rpa)==True*) and *[calculation](#calculation)!=nscf*. Currently symmetry is not supported in EXX (exact exchange) calculation.
445-
- 0: if *[calculation](#calculation)==md/nscf/get_pchg/get_wf/get_S* or *[gamma_only]==True*
445+
- 0:
446+
- if *[calculation](#calculation)==md/nscf/get_pchg/get_wf/get_S* or *[gamma_only]==True*;
447+
- If (*[dft_fuctional](#dft_functional)==hse/hf/pbe0/scan0/opt_orb* or *[rpa](#rpa)==True*). Currently *symmetry==1* is not supported in EXX (exact exchange) calculation.
446448
- 1: else
447449

448450
### symmetry_prec
@@ -1452,6 +1454,8 @@ These variables are used to control the output of properties.
14521454
- npsin = 4: SPIN1_CHG.cube, SPIN2_CHG.cube, SPIN3_CHG.cube, and SPIN4_CHG.cube.
14531455

14541456
The circle order of the charge density on real space grids is: x is the outer loop, then y and finally z (z is moving fastest).
1457+
1458+
If EXX(exact exchange) is calculated, (i.e. *[dft_fuctional](#dft_functional)==hse/hf/pbe0/scan0/opt_orb* or *[rpa](#rpa)==True*), the Hexx(R) files will be output in the folder `OUT.${suffix}` too, which can be read in NSCF calculation.
14551459
- **Default**: False
14561460

14571461
### out_pot
@@ -1655,16 +1659,20 @@ These variables are used to control the output of properties.
16551659

16561660
- **Type**: Boolean
16571661
- **Availability**: Numerical atomic orbital basis
1658-
- **Description**: Whether to save charge density files and Hamiltonian matrix files per ionic step, which are used to restart calculations. According to the value of [read_file_dir](#read_file_dir):
1662+
- **Description**: Whether to save charge density files per ionic step, which are used to restart calculations. According to the value of [read_file_dir](#read_file_dir):
16591663
- auto: These files are saved in folder `OUT.${suffix}/restart/`;
16601664
- other: These files are saved in folder `${read_file_dir}/restart/`.
1665+
1666+
If EXX(exact exchange) is calculated (i.e. *[dft_fuctional](#dft_functional)==hse/hf/pbe0/scan0/opt_orb* or *[rpa](#rpa)==True*), the Hexx(k) files for each k-point will also be saved in the above folder, which can be read in EXX calculation with *[restart_load](#restart_load)==True*.
16611667
- **Default**: False
16621668

16631669
### restart_load
16641670

16651671
- **Type**: Boolean
16661672
- **Availability**: Numerical atomic orbital basis
1667-
- **Description**: If [restart_save](#restart_save) is set to true and an electronic iteration is finished, calculations can be restarted from the charge density file and Hamiltonian matrix file, which are saved in the former calculation. Please ensure [read_file_dir](#read_file_dir) is correct, and the charge density file and Hamiltonian matrix file exist.
1673+
- **Description**: If [restart_save](#restart_save) is set to true and an electronic iteration is finished, calculations can be restarted from the charge density file, which are saved in the former calculation. Please ensure [read_file_dir](#read_file_dir) is correct, and the charge density file exist.
1674+
1675+
If EXX(exact exchange) is calculated (i.e. *[dft_fuctional](#dft_functional)==hse/hf/pbe0/scan0/opt_orb* or *[rpa](#rpa)==True*), the Hexx(k) files in the same folder for each k-point will also be read.
16681676
- **Default**: False
16691677

16701678
### rpa
@@ -2603,6 +2611,14 @@ These variables are used to control DFT+U correlated parameters
26032611
- **Description**: The screen length of Yukawa potential. If left to default, the screen length will be calculated as an average of the entire system. It's better to stick to the default setting unless there is a very good reason.
26042612
- **Default**: Calculated on the fly.
26052613

2614+
### uramping
2615+
2616+
- **Type**: Real
2617+
- **Unit**: eV
2618+
- **Availability**: DFT+U calculations with `mixing_restart > 0`.
2619+
- **Description**: Once `uramping` > 0.15 eV. DFT+U calculations will start SCF with U = 0 eV, namely normal LDA/PBE calculations. Once SCF restarts when `drho<mixing_restart`, U value will increase by `uramping` eV. SCF will repeat above calcuations until U values reach target defined in `hubbard_u`. As for `uramping=1.0 eV`, the recommendations of `mixing_restart` is around `5e-4`.
2620+
- **Default**: -1.0.
2621+
26062622
### omc
26072623

26082624
- **Type**: Integer
@@ -3170,18 +3186,18 @@ These variables are used to control berry phase and wannier90 interface paramete
31703186
E = 0.0 , t>t0
31713187
- **Default**: 2.74
31723188

3173-
### td_out_dipole
3189+
### out_dipole
31743190

31753191
- **Type**: Boolean
31763192
- **Description**:
31773193
- True: output dipole.
31783194
- False: do not output dipole.
31793195
- **Default**: False
31803196

3181-
### td_out_efield
3197+
### out_efield
31823198

31833199
- **Type**: Boolean
3184-
- **Description**: The unit of output file is atomic unit (1 a.u. = 1 Ry/(bohr $\cdot$ e) = 51.422 V/Angstrom).
3200+
- **Description**: output TDDFT Efield or not(V/Angstrom)
31853201
- True: output efield.
31863202
- False: do not output efield.
31873203
- **Default**: False

0 commit comments

Comments
 (0)