Skip to content

Commit 8aee777

Browse files
authored
Merge branch 'develop' into tests/out-wfc
2 parents d5ea9e7 + 992f39e commit 8aee777

File tree

34 files changed

+1824
-103
lines changed

34 files changed

+1824
-103
lines changed

examples/hse/pw_Si2/INPUT

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
INPUT_PARAMETERS
2+
pseudo_dir ../../../tests/PP_ORB
3+
orbital_dir ../../../tests/PP_ORB
4+
nbands 4
5+
nspin 1
6+
calculation scf
7+
basis_type pw
8+
ks_solver dav
9+
ecutwfc 50
10+
scf_thr 1e-9
11+
scf_nmax 100
12+
gamma_only 0
13+
symmetry -1
14+
smearing_method fixed
15+
mixing_type broyden
16+
mixing_beta 0.7
17+
18+
dft_functional hse
19+
20+
# init_wfc file
21+
# init_chg file
22+
23+
pseudo_mesh 1
24+
pseudo_rcut 10
25+
26+
# out_wfc_pw 1
27+
# out_chg 1
28+
29+
exx_hybrid_alpha 0.25
30+
31+
cal_stress 1
32+
# cal_force 1

examples/hse/pw_Si2/KPT

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
K_POINTS
2+
0
3+
Gamma
4+
3 3 3 0 0 0

examples/hse/pw_Si2/STRU

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
ATOMIC_SPECIES
2+
Si 1 Si_ONCV_PBE_FR-1.1.upf #Pseudopotentials are downloaded from http://www.quantum-simulation.org/potentials/sg15_oncv/upf/
3+
4+
NUMERICAL_ORBITAL
5+
orb_Si.dat
6+
7+
LATTICE_CONSTANT
8+
1.889766
9+
10+
LATTICE_VECTORS
11+
0.0 2.708337 2.708337
12+
2.708337 0.0 2.708337
13+
2.708337 2.708337 0.0
14+
15+
16+
17+
ATOMIC_POSITIONS
18+
Direct
19+
20+
Si
21+
0
22+
2
23+
0.125 0.125 0.125 0 0 0
24+
0.875 0.875 0.875 0 0 0

examples/spin_polarized/ATOM/INPUT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ basis_type lcao # lcao or pw
2626
gamma_only 1 # 0/1, replace KPT
2727

2828
#Parameters (4.Smearing)
29-
smearing_method gau # mp/gau/fd/fixed, mp for metal gau for semicon
29+
smearing_method gauss # mp/gau/fd/fixed, mp for metal gau for semicon
3030
smearing_sigma 0.001 # Rydberg, 0.002 for mp 0.001 for gau
3131

3232
#Parameters (5.Mixing)

source/Makefile.Objects

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ VPATH=./src_global:\
5050
./module_hamilt_pw/hamilt_stodft:\
5151
./module_hamilt_pw/hamilt_pwdft/operator_pw:\
5252
./module_hamilt_pw/hamilt_pwdft/kernels:\
53+
./module_hamilt_pw/hamilt_pwdft/module_exx_helper:\
5354
./module_hamilt_pw/hamilt_stodft/kernels:\
5455
./module_hamilt_lcao/module_hcontainer:\
5556
./module_hamilt_lcao/hamilt_lcaodft:\
@@ -295,6 +296,7 @@ OBJS_HAMILT=hamilt_pw.o\
295296
hamilt_sdft_pw.o\
296297
operator.o\
297298
operator_pw.o\
299+
op_exx_pw.o\
298300
ekinetic_pw.o\
299301
ekinetic_op.o\
300302
hpsi_norm_op.o\
@@ -306,6 +308,7 @@ OBJS_HAMILT=hamilt_pw.o\
306308
meta_op.o\
307309
velocity_pw.o\
308310
radial_proj.o\
311+
exx_helper.o\
309312

310313
OBJS_HAMILT_OF=kedf_tf.o\
311314
kedf_vw.o\
@@ -671,6 +674,7 @@ OBJS_SRCPW=H_Ewald_pw.o\
671674
sto_stress_pw.o\
672675
stress_func_cc.o\
673676
stress_func_ewa.o\
677+
stress_func_exx.o\
674678
stress_func_gga.o\
675679
stress_func_mgga.o\
676680
stress_func_har.o\

source/module_elecstate/elecstate.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,8 @@ class ElecState
131131
bool vnew_exist = false;
132132
void cal_converged();
133133
void cal_energies(const int type);
134-
#ifdef __EXX
135-
#ifdef __LCAO
136134
void set_exx(const double& Eexx);
137135
void set_exx(const std::complex<double>& Eexx);
138-
#endif //__LCAO
139-
#endif //__EXX
140136

141137
double get_hartree_energy();
142138
double get_etot_efield();

source/module_elecstate/elecstate_exx.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
namespace elecstate
44
{
55

6-
#ifdef __EXX
7-
#ifdef __LCAO
86
/// @brief calculation if converged
97
/// @date Peize Lin add 2016-12-03
108
void ElecState::set_exx(const double& Eexx)
@@ -17,7 +15,5 @@ void ElecState::set_exx(const double& Eexx)
1715
}
1816
return;
1917
}
20-
#endif //__LCAO
21-
#endif //__EXX
2218

2319
}

source/module_elecstate/potentials/potential_new.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,12 @@ class Potential : public PotBase
170170
{
171171
return this->v_effective_fixed.data();
172172
}
173+
const ModulePW::PW_Basis *get_rho_basis() const
174+
{
175+
return this->rho_basis_;
176+
}
177+
// What about adding a function to get the wfc?
178+
// This is useful for the calculation of the exx energy
173179

174180

175181
/// @brief get the value of vloc at G=0;

source/module_esolver/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ add_library(
2727
esolver
2828
OBJECT
2929
${objects}
30+
../module_hamilt_pw/hamilt_pwdft/module_exx_helper/exx_helper.cpp
31+
../module_hamilt_pw/hamilt_pwdft/module_exx_helper/exx_helper.h
3032
)
3133

3234
if(ENABLE_COVERAGE)

source/module_esolver/esolver_ks.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#include "module_base/timer.h"
44
#include "module_cell/cal_atoms_info.h"
5+
#include "module_hamilt_general/module_xc/xc_functional.h"
56
#include "module_io/cube_io.h"
67
#include "module_io/json_output/init_info.h"
78
#include "module_io/json_output/output_info.h"
@@ -24,6 +25,8 @@
2425
#include "module_cell/module_paw/paw_cell.h"
2526
#endif
2627

28+
#include "esolver_ks_pw.h"
29+
2730
namespace ModuleESolver
2831
{
2932

0 commit comments

Comments
 (0)