Skip to content

Commit

Permalink
Merge pull request QMCPACK#5159 from prckent/fixtest211
Browse files Browse the repository at this point in the history
Fix diamond 2x1x1 unit test with mixed precision debug
  • Loading branch information
ye-luo authored Sep 8, 2024
2 parents 0cd16e6 + cdb0be5 commit f299cf1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ template<class DiracDet, class SPO_precision>
void testTrialWaveFunction_diamondC_2x1x1(const int ndelay, const OffloadSwitches& offload_switches)
{
#if defined(MIXED_PRECISION)
const double grad_precision = 1.3e-4;
const double grad_precision = 1e-3;
const double ratio_precision = 2e-4;
#else
const double grad_precision = std::is_same<SPO_precision, float_tag>::value ? 1.3e-4 : 1e-8;
Expand Down Expand Up @@ -227,8 +227,8 @@ void testTrialWaveFunction_diamondC_2x1x1(const int ndelay, const OffloadSwitche
CHECK(r_all_val == ComplexApprox(std::complex<RealType>(0.1248738460467855, 0)).epsilon(2e-5));
CHECK(r_fermionic_val == ComplexApprox(std::complex<RealType>(0.1362181543980086, 0)).epsilon(2e-5));
#else
CHECK(r_all_val == Approx(0.1248738460469678));
CHECK(r_fermionic_val == ValueApprox(0.1362181543982075));
CHECK(r_all_val == Approx(0.1248738460469678).epsilon(1e-4));
CHECK(r_fermionic_val == ValueApprox(0.1362181543982075).epsilon(1e-4));
#endif
CHECK(r_bosonic_val == ValueApprox(0.9167195562048454));

Expand All @@ -239,7 +239,7 @@ void testTrialWaveFunction_diamondC_2x1x1(const int ndelay, const OffloadSwitche
#if defined(QMC_COMPLEX)
CHECK(psi.getLogPsi() == Approx(-6.626861768296886).epsilon(5e-5));
#else
CHECK(psi.getLogPsi() == Approx(-8.013162503965223));
CHECK(psi.getLogPsi() == Approx(-8.013162503965223).epsilon(1e-4));
#endif

elec_.update(true);
Expand Down

0 comments on commit f299cf1

Please sign in to comment.