Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions source/source_lcao/module_dftu/dftu_pw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ void Plus_U::cal_occ_pw(const int iter,
}

Plus_U::energy_u = 0.0;
const double weight_eu = (Plus_U::nspin == 1) ? 0.25 : (Plus_U::nspin == 2) ? 0.5 : 0.25;
const double weight_eu = (Plus_U::nspin == 1) ? 1.0 : (Plus_U::nspin == 2) ? 0.5 : 0.25;
const double diag_coeff = (Plus_U::nspin == 4) ? 1.0 : 0.5;
// calculate VU and energy (locale already reduced above)
for(int iat = 0; iat < cell.nat; iat++)
Expand Down Expand Up @@ -309,8 +309,8 @@ void Plus_U::cal_occ_pw(const int iter,
}
vu_iat[index[0]] = 0.5 * (vu_tmp[0] + vu_tmp[3]);
vu_iat[index[3]] = 0.5 * (vu_tmp[0] - vu_tmp[3]);
vu_iat[index[1]] = 0.5 * (vu_tmp[1] - std::complex<double>(0.0, 1.0) * vu_tmp[2]);
vu_iat[index[2]] = 0.5 * (vu_tmp[1] + std::complex<double>(0.0, 1.0) * vu_tmp[2]);
vu_iat[index[1]] = 0.5 * (vu_tmp[1] + std::complex<double>(0.0, 1.0) * vu_tmp[2]);
vu_iat[index[2]] = 0.5 * (vu_tmp[1] - std::complex<double>(0.0, 1.0) * vu_tmp[2]);
}
}
}
Expand Down
29 changes: 29 additions & 0 deletions tests/01_PW/815_PW_DFTU_S2_Z/INPUT
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
INPUT_PARAMETERS
suffix autotest
calculation scf
basis_type pw
ecutwfc 50
gamma_only 0
device cpu

nspin 2
nbands 28
scf_thr 1.0e-6
scf_nmax 100
out_chg 0
smearing_method gaussian
smearing_sigma 0.01
mixing_type broyden
mixing_beta 0.4
ks_solver dav_subspace
symmetry 0

# DFT+U parameters
dft_plus_u 1
orbital_corr 2
hubbard_u 5.0
onsite_radius 3.0

pseudo_dir ../../PP_ORB
orbital_dir ../../PP_ORB
pw_seed 1
4 changes: 4 additions & 0 deletions tests/01_PW/815_PW_DFTU_S2_Z/KPT
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
K_POINTS
0
Monkhorst-Pack
2 2 2 0 0 0
1 change: 1 addition & 0 deletions tests/01_PW/815_PW_DFTU_S2_Z/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Test PW DFT+U (U=5.0eV, l=2) with collinear spin (nspin=2), Z magnetization
21 changes: 21 additions & 0 deletions tests/01_PW/815_PW_DFTU_S2_Z/STRU
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ATOMIC_SPECIES
Fe 1.000 Fe.upf

NUMERICAL_ORBITAL
Fe_gga_6au_100Ry_4s2p2d1f.orb

LATTICE_CONSTANT
8.190

LATTICE_VECTORS
1.00 0.50 0.50
0.50 1.00 0.50
0.50 0.50 1.00
ATOMIC_POSITIONS
Direct

Fe
0.0
2
0.00 0.00 0.00 mag 2.0
0.51 0.51 0.51 mag -2.0
3 changes: 3 additions & 0 deletions tests/01_PW/815_PW_DFTU_S2_Z/result.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
etotref -6792.3335167095001452
etotperatomref -3396.1667583548
totaltimeref 21.07
29 changes: 29 additions & 0 deletions tests/01_PW/816_PW_DFTU_S4_XY/INPUT
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
INPUT_PARAMETERS
suffix autotest
calculation scf
basis_type pw
ecutwfc 20
gamma_only 0
device cpu

noncolin 1
scf_thr 1.0e-6
scf_nmax 50
out_chg 0
smearing_method gaussian
smearing_sigma 0.01
mixing_type broyden
mixing_beta 0.4
ks_solver dav_subspace
symmetry 0

# DFT+U parameters
dft_plus_u 1
orbital_corr 2
hubbard_u 5.0
onsite_radius 3.0

kpar 1
pseudo_dir ../../PP_ORB
orbital_dir ../../PP_ORB
pw_seed 1
4 changes: 4 additions & 0 deletions tests/01_PW/816_PW_DFTU_S4_XY/KPT
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
K_POINTS
0
Monkhorst-Pack
2 2 2 0 0 0
1 change: 1 addition & 0 deletions tests/01_PW/816_PW_DFTU_S4_XY/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Test PW DFT+U with noncollinear spin (nspin=4), XY magnetization constraint
21 changes: 21 additions & 0 deletions tests/01_PW/816_PW_DFTU_S4_XY/STRU
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
ATOMIC_SPECIES
Fe 1.000 Fe.upf

NUMERICAL_ORBITAL
Fe_gga_6au_100Ry_4s2p2d1f.orb

LATTICE_CONSTANT
8.190

LATTICE_VECTORS
1.00 0.50 0.50
0.50 1.00 0.50
0.50 0.50 1.00
ATOMIC_POSITIONS
Direct

Fe
0.0
2
0.00 0.00 0.00 magmom 2.0 0.0 0.0
0.51 0.51 0.51 magmom -2.0 0.0 0.0
3 changes: 3 additions & 0 deletions tests/01_PW/816_PW_DFTU_S4_XY/result.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
etotref -6364.2658763901727070
etotperatomref -3182.1329381951
totaltimeref 7.82
2 changes: 2 additions & 0 deletions tests/01_PW/CASES_CPU.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,5 @@ scf_out_chg_tau
812_PW_LT_sm
813_PW_LT_bacm
814_PW_LT_triclinic
815_PW_DFTU_S2_Z
816_PW_DFTU_S4_XY
4 changes: 2 additions & 2 deletions tests/17_DS_DFTU/CASES_CPU.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
# ========================
06_PW_SPIN_S2_Z
07_PW_SPIN_S4_XYZ
08_PW_DFTU_S2_Z
09_PW_DFTU_S4_XY
# 08_PW_DFTU_S2_Z # MIGRATED to 01_PW/815_PW_DFTU_S2_Z
# 09_PW_DFTU_S4_XY # MIGRATED to 01_PW/816_PW_DFTU_S4_XY
11_PW_DFTU_S2_FeO

# ========================
Expand Down
Loading