Skip to content

Commit

Permalink
Merge branch 'deepmodeling:develop' into precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
caic99 authored May 27, 2024
2 parents aad4020 + 79b9111 commit 7036344
Show file tree
Hide file tree
Showing 78 changed files with 2,188 additions and 1,392 deletions.
26 changes: 26 additions & 0 deletions docs/advanced/input_files/input-main.md
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@
- [td\_heavi\_amp](#td_heavi_amp)
- [out\_dipole](#out_dipole)
- [out\_efield](#out_efield)
- [out\_vecpot](#out_vecpot)
- [init\_vecpot\_file](#init_vecpot_file)
- [ocp](#ocp)
- [ocp\_set](#ocp_set)
- [Variables useful for debugging](#variables-useful-for-debugging)
Expand Down Expand Up @@ -1836,6 +1838,14 @@ Warning: this function is not robust enough for the current version. Please try
- **Note**: A trained, traced model file is needed.
- **Default**: False

### deepks_equiv

- **Type**: Boolean
- **Availability**: numerical atomic orbital basis
- **Description**: whether to use equivariant version of DeePKS
- **Note**: the equivariant version of DeePKS-kit is still under development, so this feature is currently only intended for internal usage.
- **Default**: False

### deepks_model

- **Type**: String
Expand Down Expand Up @@ -3254,6 +3264,22 @@ These variables are used to control berry phase and wannier90 interface paramete
- False: do not output efield.
- **Default**: False

### out_vecpot

- **Type**: Boolean
- **Description**: output TDDFT Vector potential or not(a.u.)
- True: output Vector potential in file "OUT.suffix/At.dat"
- False: do not output Vector potential.
- **Default**: False

### init_vecpot_file

- **Type**: Boolean
- **Description**: Init vector potential through file or not
- True: init vector potential from file "At.dat".(a.u.) It consists of four columns, representing istep and vector potential on each direction.
- False: calculate vector potential by integral of Efield
- **Default**: False

### ocp

- **Type**: Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ nbands 12
calculation nscf
scf_nmax 50
pw_diag_thr 1.0e-12
scf_thr 1.0e-15
scf_thr 1.0e-13
init_chg file
symmetry 0
towannier90 1
nnkpfile diamond.nnkp
basis_type lcao
basis_type lcao
wannier_method 2
out_wannier_unk 0
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ ecutwfc 50
calculation scf
scf_thr 1e-13
out_chg 1
basis_type lcao
basis_type lcao
24 changes: 17 additions & 7 deletions examples/interface_wannier90/ABACUS_towannier90_lcao/diamond.win
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
num_bands = 12
num_wann = 8

Begin Projections
C:s;px;py;pz
End Projections
dis_win_min = -7.2
dis_win_max = 45
dis_froz_min = -7.2
dis_froz_max = 20
dis_num_iter = 200

dis_num_iter = 5000
num_iter = 5000
num_print_cycles = 50
begin projections
C:s;px;py;pz
end projections

wannier_plot=.true.
wannier_plot=.false.
wannier_plot_supercell = 3
wvfn_formatted = .true.

Expand All @@ -26,6 +28,14 @@ begin unit_cell_cart
-1.613990 1.613990 0.000000
end unit_cell_cart

bands_plot = true

begin kpoint_path
G 0.0000000000 0.0000000000 0.0000000000 L 0.5000000000 0.5000000000 0.5000000000
L 0.5000000000 0.5000000000 0.5000000000 W 0.5000000000 0.2500000000 0.7500000000
W 0.5000000000 0.2500000000 0.7500000000 X 0.5000000000 0.0000000000 0.5000000000
end kpoint_path

mp_grid : 4 4 4

begin kpoints
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ nbands 12
calculation nscf
scf_nmax 50
pw_diag_thr 1.0e-12
scf_thr 1.0e-15
scf_thr 1.0e-13
init_chg file
symmetry 0
towannier90 1
wannier_method 1
nnkpfile diamond.nnkp
basis_type lcao
basis_type lcao
wannier_method 1
out_wannier_unk 0

Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ ecutwfc 50
calculation scf
scf_thr 1e-13
out_chg 1
basis_type lcao_in_pw
basis_type lcao_in_pw
ks_solver lapack
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
num_bands = 12
num_wann = 8

Begin Projections
C:s;px;py;pz
End Projections
dis_win_min = -7.2
dis_win_max = 45
dis_froz_min = -7.2
dis_froz_max = 20
dis_num_iter = 200

dis_num_iter = 5000
num_iter = 5000
num_print_cycles = 50
begin projections
C:s;px;py;pz
end projections

wannier_plot=.true.
wannier_plot=.false.
wannier_plot_supercell = 3
wvfn_formatted = .true.

Expand All @@ -26,6 +28,14 @@ begin unit_cell_cart
-1.613990 1.613990 0.000000
end unit_cell_cart

bands_plot = true

begin kpoint_path
G 0.0000000000 0.0000000000 0.0000000000 L 0.5000000000 0.5000000000 0.5000000000
L 0.5000000000 0.5000000000 0.5000000000 W 0.5000000000 0.2500000000 0.7500000000
W 0.5000000000 0.2500000000 0.7500000000 X 0.5000000000 0.0000000000 0.5000000000
end kpoint_path

mp_grid : 4 4 4

begin kpoints
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@ orbital_dir ../../../tests/PP_ORB
ntype 1
ecutwfc 50
nbands 4
smearing_method fixed
calculation nscf
scf_nmax 50
pw_diag_thr 1.0e-12
scf_thr 1.0e-15
scf_thr 1.0e-13
init_chg file
symmetry 0
towannier90 1
nnkpfile diamond.nnkp
basis_type pw
out_wannier_unk 0
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
num_wann = 4
num_iter = 20

wannier_plot=.true.
wannier_plot=.false.
wannier_plot_supercell = 3
wvfn_formatted = .true.

Expand Down
3 changes: 1 addition & 2 deletions source/Makefile.Objects
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ OBJS_ESOLVER_LCAO=esolver_ks_lcao.o\
io_npz.o\

OBJS_GINT=gint.o\
gint_gamma.o\
gint_gamma_env.o\
gint_gamma_vl.o\
gint_fvl.o\
Expand Down Expand Up @@ -298,7 +297,7 @@ OBJS_HSOLVER=diago_cg.o\
dngvd_op.o\

OBJS_HSOLVER_LCAO=hsolver_lcao.o\
diago_blas.o\
diago_scalapack.o\
diago_elpa.o\
elpa_new.o\
elpa_new_real.o\
Expand Down
2 changes: 2 additions & 0 deletions source/module_base/global_variable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ bool deepks_scf = false; // caoyu add 2021-10-16 for DeePKS, wenfei 2022-1-16
bool deepks_bandgap = false; // for bandgap label. QO added 2021-12-15
bool deepks_out_unittest = false;

bool deepks_equiv = false;

bool deepks_setorb = false;

bool out_element_info = false; // added by zhengdy 2021-11-26
Expand Down
2 changes: 2 additions & 0 deletions source/module_base/global_variable.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ extern bool
deepks_scf; //(need libnpy and libtorch) if set 1, a trained model would be needed to cal V_delta and F_delta
extern bool deepks_bandgap; // for bandgap label. QO added 2021-12-15

extern bool deepks_equiv; //whether to use equviariant version of DeePKS

extern bool deepks_setorb;

extern bool deepks_out_unittest; // if set 1, prints intermediate quantities that shall be used for making unit test
Expand Down
24 changes: 12 additions & 12 deletions source/module_base/test/timer_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ TEST_F(TimerTest, PrintAll)
EXPECT_THAT(output,testing::HasSubstr("TIME STATISTICS"));
EXPECT_THAT(output,testing::HasSubstr("CLASS_NAME"));
EXPECT_THAT(output,testing::HasSubstr("NAME"));
EXPECT_THAT(output,testing::HasSubstr("TIME(Sec)"));
EXPECT_THAT(output,testing::HasSubstr("TIME/s"));
EXPECT_THAT(output,testing::HasSubstr("CALLS"));
EXPECT_THAT(output,testing::HasSubstr("AVG(Sec)"));
EXPECT_THAT(output,testing::HasSubstr("PER(%)"));
EXPECT_THAT(output,testing::HasSubstr("AVG/s"));
EXPECT_THAT(output,testing::HasSubstr("PER/%"));
// check output in file
ifs.open("tmp");
std::cout << "Capture contents line by line from output file: \n" << std::endl;
Expand All @@ -131,10 +131,10 @@ TEST_F(TimerTest, PrintAll)
getline(ifs,output);
EXPECT_THAT(output,testing::HasSubstr("CLASS_NAME"));
EXPECT_THAT(output,testing::HasSubstr("NAME"));
EXPECT_THAT(output,testing::HasSubstr("TIME(Sec)"));
EXPECT_THAT(output,testing::HasSubstr("TIME/s"));
EXPECT_THAT(output,testing::HasSubstr("CALLS"));
EXPECT_THAT(output,testing::HasSubstr("AVG(Sec)"));
EXPECT_THAT(output,testing::HasSubstr("PER(%)"));
EXPECT_THAT(output,testing::HasSubstr("AVG/s"));
EXPECT_THAT(output,testing::HasSubstr("PER/%"));
ifs.close();
remove("time.json");
}
Expand Down Expand Up @@ -162,10 +162,10 @@ TEST_F(TimerTest, Finish)
EXPECT_THAT(output,testing::HasSubstr("TIME STATISTICS"));
EXPECT_THAT(output,testing::HasSubstr("CLASS_NAME"));
EXPECT_THAT(output,testing::HasSubstr("NAME"));
EXPECT_THAT(output,testing::HasSubstr("TIME(Sec)"));
EXPECT_THAT(output,testing::HasSubstr("TIME/s"));
EXPECT_THAT(output,testing::HasSubstr("CALLS"));
EXPECT_THAT(output,testing::HasSubstr("AVG(Sec)"));
EXPECT_THAT(output,testing::HasSubstr("PER(%)"));
EXPECT_THAT(output,testing::HasSubstr("AVG/s"));
EXPECT_THAT(output,testing::HasSubstr("PER/%"));
// check output in file
ifs.open("tmp");
std::cout << "Capture contents line by line from output file: \n" << std::endl;
Expand All @@ -175,10 +175,10 @@ TEST_F(TimerTest, Finish)
getline(ifs,output);
EXPECT_THAT(output,testing::HasSubstr("CLASS_NAME"));
EXPECT_THAT(output,testing::HasSubstr("NAME"));
EXPECT_THAT(output,testing::HasSubstr("TIME(Sec)"));
EXPECT_THAT(output,testing::HasSubstr("TIME/s"));
EXPECT_THAT(output,testing::HasSubstr("CALLS"));
EXPECT_THAT(output,testing::HasSubstr("AVG(Sec)"));
EXPECT_THAT(output,testing::HasSubstr("PER(%)"));
EXPECT_THAT(output,testing::HasSubstr("AVG/s"));
EXPECT_THAT(output,testing::HasSubstr("PER/%"));
ifs.close();
}

Expand Down
2 changes: 1 addition & 1 deletion source/module_base/timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ void timer::print_all(std::ofstream &ofs)
assert(class_names.size() == calls.size());
assert(class_names.size() == avgs.size());
assert(class_names.size() == pers.size());
std::vector<std::string> titles = {"CLASS_NAME", "NAME", "TIME(Sec)", "CALLS", "AVG(Sec)", "PER(%)"};
std::vector<std::string> titles = {"CLASS_NAME", "NAME", "TIME/s", "CALLS", "AVG/s", "PER/%"};
std::vector<std::string> formats = {"%-10s", "%-10s", "%6.2f", "%8d", "%6.2f", "%6.2f"};
FmtTable time_statistics(titles, pers.size(), formats, {FmtTable::Align::LEFT, FmtTable::Align::CENTER});
time_statistics << class_names << names << times << calls << avgs << pers;
Expand Down
Loading

0 comments on commit 7036344

Please sign in to comment.