Skip to content

Commit

Permalink
for windows' toolchain sake give up and use ascii label for σpVσp ope…
Browse files Browse the repository at this point in the history
…rator descriptor
  • Loading branch information
evaleev committed Dec 1, 2023
1 parent 070bff3 commit 89ee10e
Show file tree
Hide file tree
Showing 4 changed files with 506 additions and 438 deletions.
6 changes: 3 additions & 3 deletions include/libint2/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ enum class Operator {
//! Previous to cdbb9f3 released in v2.8.0, Standard -or- Gaussian ordering could be be specified at generator/compiler configure time.
sphemultipole,
/// The four components of σp . V . σp, where V is the nuclear potential.
σpVσp,
opVop,
/// \f$ \delta(\vec{r}_1 - \vec{r}_2) \f$
delta,
/// (2-body) Coulomb operator = \f$ r_{12}^{-1} \f$
Expand Down Expand Up @@ -162,7 +162,7 @@ enum class Operator {
invalid = -1,
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!keep this updated!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
first_1body_oper = overlap,
last_1body_oper = σpVσp,
last_1body_oper = opVop,
first_2body_oper = delta,
last_2body_oper = stg_x_coulomb,
first_oper = first_1body_oper,
Expand Down Expand Up @@ -222,7 +222,7 @@ struct operator_traits<Operator::nuclear>
#endif
};
template <>
struct operator_traits<Operator::σpVσp>
struct operator_traits<Operator::opVop>
: public operator_traits<Operator::nuclear> {
static constexpr auto nopers = 4;
static constexpr auto intrinsic_deriv_order = 2;
Expand Down
18 changes: 9 additions & 9 deletions include/libint2/engine.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ typename std::remove_all_extents<T>::type* to_ptr1(T (&a)[N]) {
(2emultipole, \
(3emultipole, \
(sphemultipole, \
(σpVσp, \
(opVop, \
(eri, (eri, (eri, (eri, (eri, (eri, (eri, (eri, (eri, (eri, BOOST_PP_NIL))))))))))))))))))))

#define BOOST_PP_NBODY_OPERATOR_INDEX_TUPLE \
BOOST_PP_MAKE_TUPLE(BOOST_PP_LIST_SIZE(BOOST_PP_NBODY_OPERATOR_LIST))
#define BOOST_PP_NBODY_OPERATOR_INDEX_LIST \
BOOST_PP_TUPLE_TO_LIST(BOOST_PP_NBODY_OPERATOR_INDEX_TUPLE)
#define BOOST_PP_NBODY_OPERATOR_LAST_ONEBODY_INDEX \
9 // σpVσp, the 10th member of BOOST_PP_NBODY_OPERATOR_LIST, is the last
9 // opVop, the 10th member of BOOST_PP_NBODY_OPERATOR_LIST, is the last
// 1-body operator

// make list of braket indices for n-body ints
Expand Down Expand Up @@ -180,7 +180,7 @@ __libint2_engine_inline const Engine::target_ptr_vec& Engine::compute1(

const auto oper_is_nuclear =
(oper_ == Operator::nuclear || oper_ == Operator::erf_nuclear ||
oper_ == Operator::erfc_nuclear || oper_ == Operator::σpVσp);
oper_ == Operator::erfc_nuclear || oper_ == Operator::opVop);

const auto l1 = s1.contr[0].l;
const auto l2 = s2.contr[0].l;
Expand Down Expand Up @@ -249,7 +249,7 @@ __libint2_engine_inline const Engine::target_ptr_vec& Engine::compute1(
const auto compute_directly =
lmax == 0 && deriv_order_ == 0 &&
(oper_ == Operator::overlap || oper_is_nuclear) &&
oper_ != Operator::σpVσp;
oper_ != Operator::opVop;
if (compute_directly) {
primdata_[0].stack[0] = 0;
targets_[0] = primdata_[0].stack;
Expand Down Expand Up @@ -750,7 +750,7 @@ Engine::compute2_ptrs() const {
__libint2_engine_inline unsigned int Engine::nparams() const {
switch (oper_) {
case Operator::nuclear:
case Operator::σpVσp:
case Operator::opVop:
return any_cast<const operator_traits<Operator::nuclear>::oper_params_type&>(params_)
.size();
case Operator::erf_nuclear:
Expand Down Expand Up @@ -929,7 +929,7 @@ __libint2_engine_inline void Engine::compute_primdata(Libint_t& primdata, const

const auto oper_is_nuclear =
(oper_ == Operator::nuclear || oper_ == Operator::erf_nuclear ||
oper_ == Operator::erfc_nuclear || oper_ == Operator::σpVσp);
oper_ == Operator::erfc_nuclear || oper_ == Operator::opVop);

// need to use HRR? see strategy.cc
const auto l1 = s1.contr[0].l;
Expand Down Expand Up @@ -1032,7 +1032,7 @@ __libint2_engine_inline void Engine::compute_primdata(Libint_t& primdata, const
primdata._0_Overlap_0_y[0] = ovlp_ss_y;
primdata._0_Overlap_0_z[0] = ovlp_ss_z;

if (oper_ == Operator::kinetic || (deriv_order_ > 0) || oper_ == Operator::σpVσp) {
if (oper_ == Operator::kinetic || (deriv_order_ > 0) || oper_ == Operator::opVop) {
#if LIBINT2_DEFINED(eri, two_alpha0_bra)
primdata.two_alpha0_bra[0] = 2.0 * alpha1;
#endif
Expand All @@ -1043,7 +1043,7 @@ __libint2_engine_inline void Engine::compute_primdata(Libint_t& primdata, const

if (oper_is_nuclear) {

const auto& params = (oper_ == Operator::nuclear || oper_ == Operator::σpVσp) ?
const auto& params = (oper_ == Operator::nuclear || oper_ == Operator::opVop) ?
any_cast<const operator_traits<Operator::nuclear>::oper_params_type&>(params_) :
std::get<1>(any_cast<const operator_traits<Operator::erfc_nuclear>::oper_params_type&>(params_));

Expand Down Expand Up @@ -1078,7 +1078,7 @@ __libint2_engine_inline void Engine::compute_primdata(Libint_t& primdata, const
const scalar_type U = gammap * PC2;
const auto mmax = s1.contr[0].l + s2.contr[0].l + deriv_order_ + intrinsic_deriv_order();
auto* fm_ptr = &(primdata.LIBINT_T_S_ELECPOT_S(0)[0]);
if (oper_ == Operator::nuclear || oper_ == Operator::σpVσp) {
if (oper_ == Operator::nuclear || oper_ == Operator::opVop) {
const auto& fm_engine_ptr =
any_cast<const detail::core_eval_pack_type<Operator::nuclear>&>(core_eval_pack_)
.first();
Expand Down
6 changes: 3 additions & 3 deletions src/bin/libint/build_libint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ build_onebody_1b_1k(std::ostream& os, std::string label, const SafePtr<Compilati
do {
BFType a(la);
BFType b(lb);

for(unsigned int c=0; c!=2; ++c) {
const unsigned int ndir = std::is_same<BFType,CGShell>::value ? 3 : 1;
for(unsigned int xyz=0; xyz<ndir; ++xyz) {
Expand All @@ -411,7 +411,7 @@ build_onebody_1b_1k(std::ostream& os, std::string label, const SafePtr<Compilati
SafePtr<Onebody_sh_1_1> target = Onebody_sh_1_1::Instance(a,b,nullaux,oper);
targets.push_back(target);
} // loop over operator components

last_deriv = diter.last();
if (!last_deriv) diter.next();
} while (!last_deriv); // loop over derivatives
Expand Down Expand Up @@ -518,7 +518,7 @@ void try_main (int argc, char* argv[])
2emultipole, \
3emultipole, \
sphemultipole, \
σpVσp \
opVop \
)
#define BOOST_PP_ONEBODY_TASK_OPER_TUPLE (OverlapOper, \
KineticOper, \
Expand Down
Loading

0 comments on commit 89ee10e

Please sign in to comment.