Skip to content

Commit 0862694

Browse files
committed
Revert "Fix: nspin2/4 mismatch with nspin1 with PBE"
This reverts commit ffd91ff.
1 parent e1e13fb commit 0862694

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

source/module_hamilt_general/module_xc/xc_funct_corr_gga.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ void XC_Functional::pbec_spin(double rho, double zeta, double grho, const int &i
382382
// real(kind=DP) :: rho, zeta, grho, sc, v1cup, v1cdw, v2c
383383
double ga, be[3];//mohan add
384384
// parameter :
385-
ga = 0.0310906908696548950;
385+
ga = 0.0310910;
386386
be[1] = 0.06672455060314922;//zhengdy add 2019-09-12, ensure same parameter with another dft code.
387387
be[2] = 0.0460000;//mohan add 2012-05-28
388388
double third, pi34, xkf, xks;

source/module_hamilt_general/module_xc/xc_functional_libxc_tools.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ std::vector<double> XC_Functional_Libxc::cal_sgn(
127127
const std::vector<double> &sigma)
128128
{
129129
std::vector<double> sgn(nrxx*nspin, 1.0);
130-
const double grho_threshold2 = grho_threshold*grho_threshold;
131130
// in the case of GGA correlation for polarized case,
132131
// a cutoff for grho is required to ensure that libxc gives reasonable results
133132
if(nspin==2 && func.info->family != XC_FAMILY_LDA && func.info->kind==XC_CORRELATION)
@@ -137,9 +136,9 @@ std::vector<double> XC_Functional_Libxc::cal_sgn(
137136
#endif
138137
for( int ir=0; ir<nrxx; ++ir )
139138
{
140-
if ( rho[ir*2]<rho_threshold || std::abs(sigma[ir*3])<grho_threshold2 )
139+
if ( rho[ir*2]<rho_threshold || std::sqrt(std::abs(sigma[ir*3]))<grho_threshold )
141140
sgn[ir*2] = 0.0;
142-
if ( rho[ir*2+1]<rho_threshold || std::abs(sigma[ir*3+2])<grho_threshold2 )
141+
if ( rho[ir*2+1]<rho_threshold || std::sqrt(std::abs(sigma[ir*3+2]))<grho_threshold )
143142
sgn[ir*2+1] = 0.0;
144143
}
145144
}

0 commit comments

Comments
 (0)