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
7 changes: 4 additions & 3 deletions source/source_pw/module_pwdft/operator_pw/op_exx_pw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,17 +322,18 @@ void OperatorEXXPW<T, Device>::act_op_kpar(const int nbands,
// decide which pool does the iq belong to
int iq_pool = kv->para_k.whichpool[iq];
int iq_loc = iq - kv->para_k.startk_pool[iq_pool];
int iq_loc_spin = iq_loc;
if (ispin == 1)
{
iq_loc += wfcpw->nks / nspin_fac;
iq_loc_spin += wfcpw->nks / nspin_fac;
}

for (int m_iband = 0; m_iband < psi.get_nbands(); m_iband++)
{
double wg_mqb = 0;
if (iq_pool == GlobalV::MY_POOL)
{
wg_mqb = (*wg)(iq_loc, m_iband);
wg_mqb = (*wg)(iq_loc_spin, m_iband);
}
#ifdef __MPI
MPI_Bcast(&wg_mqb, 1, MPI_DOUBLE, kv->para_k.get_startpro_pool(iq_pool), MPI_COMM_WORLD);
Expand All @@ -342,7 +343,7 @@ void OperatorEXXPW<T, Device>::act_op_kpar(const int nbands,

if (iq_pool == GlobalV::MY_POOL)
{
const T* psi_mq = get_pw(m_iband, iq_loc + ispin * wfcpw->nks / nspin_fac);
const T* psi_mq = get_pw(m_iband, iq_loc_spin);
wfcpw->recip_to_real(ctx, psi_mq, psi_mq_real, iq_loc);
// send
}
Expand Down
31 changes: 31 additions & 0 deletions tests/01_PW/096_PW_PBE0_AFM/INPUT
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
INPUT_PARAMETERS
#Parameters (System)
suffix autotest
calculation scf
nspin 2
pseudo_dir ../../PP_ORB
orbital_dir ../../PP_ORB

#Parameters (PW)
ecutwfc 50
basis_type pw

#Parameters (SCF)
scf_thr 1.0e-12
scf_nmax 100
smearing_method gaussian
smearing_sigma 0.015
mixing_type pulay
mixing_ndim 8
mixing_beta 0.3
nbands 20

#Parameters (Hybrid Functional)
dft_functional pbe0

#Parameters (Other)
symmetry -1
init_wfc random
device cpu
exx_thr_type energy
exx_ene_thr 5e-2
7 changes: 7 additions & 0 deletions tests/01_PW/096_PW_PBE0_AFM/KPT
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
K_POINTS
0
Gamma
1 1 1 0 0 0
### If you are running an energy calculation, please make sure your final energy is
### converged with respect to the k-point settings, unless you set a loose k-point
### mesh on purpose.
1 change: 1 addition & 0 deletions tests/01_PW/096_PW_PBE0_AFM/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fe Anti-ferromagnetic with nspin=2 hybrid functional (PBE0), PW basis, init magnet: up + down
19 changes: 19 additions & 0 deletions tests/01_PW/096_PW_PBE0_AFM/STRU
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ATOMIC_SPECIES
Fe 55.845 Fe_ONCV_PBE-1.0.upf


LATTICE_CONSTANT
1.889725989

LATTICE_VECTORS
2.8328152400000000 0.0000000000000000 0.0000000000000000
0.0000000000000000 2.8328152400000000 0.0000000000000000
0.0000000000000000 0.0000000000000000 2.8328152400000000
ATOMIC_POSITIONS
Direct

Fe
1.0
2
0.0 0.0 0.0 mag 5
0.5 0.5 0.5 mag -5
3 changes: 3 additions & 0 deletions tests/01_PW/096_PW_PBE0_AFM/result.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
etotref -6445.819708427081
etotperatomref -3222.9098542135
totaltimeref 1.63
31 changes: 31 additions & 0 deletions tests/01_PW/096_PW_PBE0_FM/INPUT
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
INPUT_PARAMETERS
#Parameters (System)
suffix autotest
calculation scf
nspin 2
pseudo_dir ../../PP_ORB
orbital_dir ../../PP_ORB

#Parameters (PW)
ecutwfc 30
basis_type pw

#Parameters (SCF)
scf_thr 1.0e-12
scf_nmax 100
smearing_method gaussian
smearing_sigma 0.015
mixing_type pulay
mixing_ndim 8
mixing_beta 0.2

#Parameters (Hybrid Functional)
dft_functional pbe0

#Parameters (Other)
symmetry -1
init_wfc random
pw_seed 1
device cpu
exx_thr_type energy
exx_ene_thr 5e-2
7 changes: 7 additions & 0 deletions tests/01_PW/096_PW_PBE0_FM/KPT
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
K_POINTS
0
Gamma
1 1 1 0 0 0
### If you are running an energy calculation, please make sure your final energy is
### converged with respect to the k-point settings, unless you set a loose k-point
### mesh on purpose.
3 changes: 3 additions & 0 deletions tests/01_PW/096_PW_PBE0_FM/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fe Ferromagnetic with nspin=2 hybrid functional (PBE0), PW basis, init magnet: up + up


19 changes: 19 additions & 0 deletions tests/01_PW/096_PW_PBE0_FM/STRU
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ATOMIC_SPECIES
Fe 55.845 Fe_ONCV_PBE-1.0.upf


LATTICE_CONSTANT
1.889725989

LATTICE_VECTORS
2.8328152400000000 0.0000000000000000 0.0000000000000000
0.0000000000000000 2.8328152400000000 0.0000000000000000
0.0000000000000000 0.0000000000000000 2.8328152400000000
ATOMIC_POSITIONS
Direct

Fe
1.0
2
0.0 0.0 0.0 mag 5
0.5 0.5 0.5 mag 5
3 changes: 3 additions & 0 deletions tests/01_PW/096_PW_PBE0_FM/result.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
etotref -6382.4607756634
etotperatomref -3191.2303878317
totaltimeref 0.93
2 changes: 2 additions & 0 deletions tests/01_PW/CASES_CPU.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@
094_PW_NPT
095_PW_NVT
096_PW_PBE0
096_PW_PBE0_AFM
096_PW_PBE0_FM
097_PW_LDOS
098_PW_15_SO_avg
099_PW_DJ_SO
Expand Down
Loading