Skip to content

Commit 6c23342

Browse files
dyzhengdyzheng
authored andcommitted
Feature: DFT+U for noncollinear spin calculation with PW base (deepmodeling#5703)
* Feature: DFT+U for noncollinear spin calculation with PW base * add test case for DFT+U in PW base * Fix: bug of cmakelist * Fix: error in CI * Fix: GPU error in CI --------- Co-authored-by: dyzheng <[email protected]>
1 parent 6aeb447 commit 6c23342

File tree

88 files changed

+5847
-652
lines changed

Some content is hidden

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

88 files changed

+5847
-652
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -711,17 +711,17 @@ target_link_libraries(
711711
esolver
712712
vdw
713713
device
714-
container)
714+
container
715+
dftu
716+
deltaspin)
715717
if(ENABLE_LCAO)
716718
target_link_libraries(
717719
${ABACUS_BIN_NAME}
718720
hamilt_lcao
719721
tddft
720722
orb
721723
gint
722-
dftu
723724
hcontainer
724-
deltaspin
725725
numerical_atomic_orbitals
726726
lr
727727
rdmft)

docs/advanced/input_files/input-main.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,6 +1235,12 @@ Note: In new angle mixing, you should set `mixing_beta_mag >> mixing_beta`. The
12351235
- **Description**: To determine the number of old iterations' `drho` used in slope calculations.
12361236
- **Default**: `mixing_ndim`
12371237

1238+
### sc_os_ndim
1239+
1240+
- **Type**: int
1241+
- **Description**: To determine the number of old iterations to judge oscillation, it occured, more accurate lambda with DeltaSpin method would be calculated, only for PW base.
1242+
- **Default**: 5
1243+
12381244
### chg_extrap
12391245

12401246
- **Type**: String

python/pyabacus/src/ModuleNAO/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ list(APPEND _naos
1212
${NAO_PATH}/two_center_bundle.cpp
1313
${NAO_PATH}/two_center_integrator.cpp
1414
${NAO_PATH}/two_center_table.cpp
15-
${NAO_PATH}/projgen.cpp
1615
# dependency
1716
${ABACUS_SOURCE_DIR}/module_base/kernels/math_op.cpp
1817
# ${ABACUS_SOURCE_DIR}/module_psi/kernels/psi_memory_op.cpp

source/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ list(APPEND device_srcs
4747

4848
module_hamilt_pw/hamilt_pwdft/kernels/force_op.cpp
4949
module_hamilt_pw/hamilt_pwdft/kernels/stress_op.cpp
50+
module_hamilt_pw/hamilt_pwdft/kernels/onsite_op.cpp
5051
module_hamilt_pw/hamilt_pwdft/kernels/wf_op.cpp
5152
module_hamilt_pw/hamilt_pwdft/kernels/vnl_op.cpp
5253
module_base/kernels/math_op.cpp
@@ -60,6 +61,7 @@ if(USE_CUDA)
6061
module_hamilt_pw/hamilt_pwdft/kernels/cuda/ekinetic_op.cu
6162
module_hamilt_pw/hamilt_pwdft/kernels/cuda/meta_op.cu
6263
module_hamilt_pw/hamilt_stodft/kernels/cuda/hpsi_norm_op.cu
64+
module_hamilt_pw/hamilt_pwdft/kernels/cuda/onsite_op.cu
6365
module_basis/module_pw/kernels/cuda/pw_op.cu
6466
module_hsolver/kernels/cuda/dngvd_op.cu
6567
module_hsolver/kernels/cuda/math_kernel_op.cu
@@ -83,6 +85,7 @@ if(USE_ROCM)
8385
module_hamilt_pw/hamilt_pwdft/kernels/rocm/veff_op.hip.cu
8486
module_hamilt_pw/hamilt_pwdft/kernels/rocm/ekinetic_op.hip.cu
8587
module_hamilt_pw/hamilt_pwdft/kernels/rocm/meta_op.hip.cu
88+
module_hamilt_pw/hamilt_pwdft/kernels/rocm/onsite_op.hip.cu
8689
module_hamilt_pw/hamilt_stodft/kernels/rocm/hpsi_norm_op.hip.cu
8790
module_basis/module_pw/kernels/rocm/pw_op.hip.cu
8891
module_hsolver/kernels/rocm/dngvd_op.hip.cu

source/Makefile.Objects

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,10 +635,13 @@ OBJS_SRCPW=H_Ewald_pw.o\
635635
forces_nl.o\
636636
forces_cc.o\
637637
forces_scc.o\
638+
forces_onsite.o\
639+
onsite_proj_pw.o\
638640
fs_nonlocal_tools.o\
639641
fs_kin_tools.o\
640642
force_op.o\
641643
stress_op.o\
644+
onsite_op.o\
642645
wf_op.o\
643646
vnl_op.o\
644647
global.o\
@@ -663,6 +666,7 @@ OBJS_SRCPW=H_Ewald_pw.o\
663666
stress_func_loc.o\
664667
stress_func_nl.o\
665668
stress_func_us.o\
669+
stress_func_onsite.o\
666670
stress_pw.o\
667671
of_stress_pw.o\
668672
symmetry_rho.o\
@@ -673,7 +677,9 @@ OBJS_SRCPW=H_Ewald_pw.o\
673677
elecond.o\
674678
sto_tool.o\
675679
sto_elecond.o\
676-
sto_dos.o
680+
sto_dos.o\
681+
onsite_projector.o\
682+
onsite_proj_tools.o
677683

678684
OBJS_VDW=vdw.o\
679685
vdwd2_parameters.o\
@@ -691,7 +697,8 @@ OBJS_DFTU=dftu.o\
691697
dftu_io.o\
692698
dftu_tools.o\
693699
dftu_occup.o\
694-
dftu_hamilt.o
700+
dftu_hamilt.o\
701+
dftu_pw.o
695702

696703
OBJS_DELTASPIN=basic_funcs.o\
697704
cal_mw_from_lambda.o\

source/module_base/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ add_library(
5454
spherical_bessel_transformer.cpp
5555
cubic_spline.cpp
5656
parallel_2d.cpp
57+
projgen.cpp
5758
module_mixing/mixing_data.cpp
5859
module_mixing/mixing.cpp
5960
module_mixing/plain_mixing.cpp
File renamed without changes.
File renamed without changes.

source/module_basis/module_nao/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ if(ENABLE_LCAO)
1414
two_center_table.cpp
1515
two_center_integrator.cpp
1616
two_center_bundle.cpp
17-
projgen.cpp
1817
)
1918

2019
if(ENABLE_COVERAGE)

source/module_basis/module_nao/atomic_radials.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// FIXME: should update with pyabacus
88
// #include "module_io/orb_io.h"
99

10-
#include "projgen.h"
10+
#include "module_base/projgen.h"
1111

1212
#include <fstream>
1313
#include <iostream>

0 commit comments

Comments
 (0)