Skip to content

Commit 3d1a861

Browse files
linpeizePeizeLin
andauthored
1. Improve output accuracy of Exx_Opt_Orb (#6509)
* Refactor: change cal_proj() to cal_mul() in Exx_Opt_Orb * 1. Improve output accuracy of Exx_Opt_Orb 2. Change default value of exx_opt_orb_tolerence --------- Co-authored-by: linpz <[email protected]>
1 parent c931d97 commit 3d1a861

File tree

6 files changed

+7
-5
lines changed

6 files changed

+7
-5
lines changed

docs/advanced/input_files/input-main.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2977,7 +2977,7 @@ These variables are relevant when using hybrid functionals with *[basis_type](#b
29772977
- **Type**: Real
29782978
- **Availability**: *[calculation](#calculation)==gen_opt_abfs*
29792979
- **Description**: The threshold when solving for the zeros of spherical Bessel functions. A reasonable choice is 1e-12.
2980-
- **Default**: 0
2980+
- **Default**: 1E-12
29812981

29822982
### exx_real_number
29832983

source/source_hamilt/module_xc/exx_info.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ struct Exx_Info
8181
{
8282
int abfs_Lmax = 0; // tmp
8383
double ecut_exx = 60;
84-
double tolerence = 1E-2;
84+
double tolerence = 1E-12;
8585
double kmesh_times = 4;
8686
};
8787
Exx_Info_Opt_ABFs info_opt_abfs;

source/source_io/module_parameter/input_parameter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ struct Input_para
546546
///< calculating Columb potential is to that of atomic orbitals
547547
int exx_opt_orb_lmax = 0; ///< the maximum l of the spherical Bessel functions for opt ABFs
548548
double exx_opt_orb_ecut = 0.0; ///< the cut-off of plane wave expansion for opt ABFs
549-
double exx_opt_orb_tolerence = 0.0; ///< the threshold when solving for the zeros of spherical Bessel
549+
double exx_opt_orb_tolerence = 1E-12; ///< the threshold when solving for the zeros of spherical Bessel
550550
///< functions for opt ABFs
551551
bool exx_symmetry_realspace
552552
= true; ///< whether to reduce the real-space sector in when using symmetry=1 in EXX calculation

source/source_io/test/read_input_ptest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ TEST_F(InputParaTest, ParaRead)
296296
EXPECT_DOUBLE_EQ(param.inp.rpa_ccp_rmesh_times, 10.0);
297297
EXPECT_EQ(param.inp.exx_opt_orb_lmax, 0);
298298
EXPECT_DOUBLE_EQ(param.inp.exx_opt_orb_ecut, 0.0);
299-
EXPECT_DOUBLE_EQ(param.inp.exx_opt_orb_tolerence, 0.0);
299+
EXPECT_DOUBLE_EQ(param.inp.exx_opt_orb_tolerence, 1E-12);
300300
EXPECT_FALSE(param.inp.noncolin);
301301
EXPECT_FALSE(param.inp.lspinorb);
302302
EXPECT_DOUBLE_EQ(param.inp.soc_lambda, 1.0);

source/source_io/test/support/INPUT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ exx_v_grad_r_threshold 0 #
291291
exx_ccp_rmesh_times default #
292292
exx_opt_orb_lmax 0 #
293293
exx_opt_orb_ecut 0 #
294-
exx_opt_orb_tolerence 0 #
294+
exx_opt_orb_tolerence 1E-12 #
295295

296296
#Parameters (16.tddft)
297297
td_vext 0 #add extern potential or not

source/source_lcao/module_ri/exx_opt_orb-print.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "exx_opt_orb.h"
22
#include "../../source_pw/module_pwdft/global.h"
33
#include "exx_abfs-jle.h"
4+
#include <iomanip>
45

56
void Exx_Opt_Orb::print_matrix(
67
const Exx_Info::Exx_Info_Opt_ABFs &info,
@@ -204,6 +205,7 @@ void Exx_Opt_Orb::print_matrix(
204205

205206
std::ofstream ofs(file_name+"_"+std::to_string(TA)+"_"+std::to_string(IA)+"_"+std::to_string(TB)+"_"+std::to_string(IB));
206207
print_header(ofs);
208+
ofs<<std::setprecision(15);
207209
print_Q(ofs);
208210
print_S(ofs);
209211
print_V(ofs);

0 commit comments

Comments
 (0)