Skip to content

Commit

Permalink
[unit] 3eri permute test needs to limit shell sets to those supported…
Browse files Browse the repository at this point in the history
… by Engine
  • Loading branch information
evaleev committed Feb 5, 2024
1 parent 2f367de commit aa77bd5
Showing 1 changed file with 37 additions and 17 deletions.
54 changes: 37 additions & 17 deletions tests/unit/test-permute.cc
Original file line number Diff line number Diff line change
Expand Up @@ -231,23 +231,6 @@ void validate3(const BasisSet& obs, const BasisSet& dfbs,
if (deriv_order > LIBINT2_DERIV_ERI_ORDER ||
deriv_order > LIBINT2_DERIV_ERI3_ORDER)
return;
switch (deriv_order) {
case 0:
if (max_l > LIBINT2_MAX_AM_eri || max_l > LIBINT2_MAX_AM_3eri) return;
break;
case 1:
#if LIBINT2_DERIV_ERI_ORDER > 0 && LIBINT2_DERIV_ERI3_ORDER > 0
if (max_l > LIBINT2_MAX_AM_eri1 || max_l > LIBINT2_MAX_AM_3eri1) return;
#endif
break;
case 2:
#if LIBINT2_DERIV_ERI_ORDER > 1 && LIBINT2_DERIV_ERI3_ORDER > 1
if (max_l > LIBINT2_MAX_AM_eri2 || max_l > LIBINT2_MAX_AM_3eri2) return;
#endif
break;
default:
abort();
}
const auto xsxx = LIBINT_SHELL_SET == LIBINT_SHELL_SET_STANDARD;
if (!xsxx) return; // not yet implemented
const auto abs_precision = deriv_order == 1 ? 1e-12 : 1e-13;
Expand All @@ -271,6 +254,43 @@ void validate3(const BasisSet& obs, const BasisSet& dfbs,
for (auto s2 = 0; s2 != obs.size(); ++s2) {
for (auto s3 = 0; s3 != obs.size(); ++s3) {
assert(xsxx);

// skip if angular momenta are too high
const auto max_orb_l = std::max(obs[s2].contr[0].l, obs[s3].contr[0].l);
const auto max_l = std::max(dfbs[s1].contr[0].l, max_orb_l);
auto max_l_exceeded = false;
switch (deriv_order) {
case 0:
if (max_l > LIBINT2_MAX_AM_eri || max_l > LIBINT2_MAX_AM_3eri)
max_l_exceeded = true;
#ifdef LIBINT2_CENTER_DEPENDENT_MAX_AM_3eri
if (max_orb_l > LIBINT2_MAX_AM_default) max_l_exceeded = true;
#endif
break;

case 1:
#if LIBINT2_DERIV_ERI_ORDER > 0 && LIBINT2_DERIV_ERI3_ORDER > 0
if (max_l > LIBINT2_MAX_AM_eri1 || max_l > LIBINT2_MAX_AM_3eri1)
max_l_exceeded = true;
#ifdef LIBINT2_CENTER_DEPENDENT_MAX_AM_3eri1
if (max_orb_l > LIBINT2_MAX_AM_default1) max_l_exceeded = true;
#endif
#endif
break;
case 2:
#if LIBINT2_DERIV_ERI_ORDER > 1 && LIBINT2_DERIV_ERI3_ORDER > 1
if (max_l > LIBINT2_MAX_AM_eri2 || max_l > LIBINT2_MAX_AM_3eri2)
max_l_exceeded = true;
#ifdef LIBINT2_CENTER_DEPENDENT_MAX_AM_3eri1
if (max_orb_l > LIBINT2_MAX_AM_default2) max_l_exceeded = true;
#endif
#endif
break;
default:
abort();
}
if (max_l_exceeded) continue;

engine_ref.compute(dfbs[s1], Shell::unit(), obs[s2], obs[s3]);

const auto& shellset_ref =
Expand Down

0 comments on commit aa77bd5

Please sign in to comment.