Skip to content
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9e91fb7
Set-up preprocessor macro for defining RKB ERIs
kshitij-05 Feb 5, 2026
7941816
Can generate code for `(LL|SS)` type integral, i.e., `(μ ν | (σ.p)κ (…
kshitij-05 Feb 7, 2026
05e9ff5
bugfix: added the missing `make_descr<Coulombσpσp_Descr>`
kshitij-05 Feb 9, 2026
f3274a9
`Engine` can initialize for coulomb_opop operator
kshitij-05 Feb 10, 2026
2bf62f6
use and invoke correct `buildfnptr`s if engine is initialized with`Op…
kshitij-05 Feb 11, 2026
b6c376b
Apply @loriab 's review suggestions
kshitij-05 Feb 11, 2026
0aa7b83
Added unittest for `Operator::coulomb_opop` and fixed logic errors in…
kshitij-05 Feb 14, 2026
62142d9
bugfix: revert incorrect braket swapping criteria for `Operator::coul…
kshitij-05 Feb 14, 2026
b2b79ab
generate code for missing contracted kernels for `deriv(>0)-eri` + cl…
kshitij-05 Feb 18, 2026
d4247b0
reverted allowing contracted shells for Coulombσpσp and use additiona…
kshitij-05 Feb 20, 2026
054b8eb
can generate code for all small component RKB ERIs i.e.,`(SS|SS)`
kshitij-05 Feb 21, 2026
60e2117
Can evaluate `(SS|SS)` integrals. Only for `STANDARD` shell quartet f…
kshitij-05 Mar 1, 2026
509cb00
Merge master. Resolves conflicts in `build_libint.cc` and `CMakelists…
kshitij-05 Mar 1, 2026
e29428a
cleanup: Remove debugging statements from `RKB Coulomb integrals` tes…
kshitij-05 Mar 9, 2026
921da58
Optimize RKB integral code generation: braket symmetry + disable CSE …
kshitij-05 Mar 21, 2026
98d7d37
DerivGaussV2: HRR-like code-sharing for derivative Gaussians
kshitij-05 Apr 2, 2026
9b50b0b
Fix DerivGaussV2 target indexing for size-1 integral sets
kshitij-05 Apr 10, 2026
1db978d
RKB CR code sharing: deduplicate generated Coulombσpσp/σpσpCoulombσpσ…
kshitij-05 Apr 10, 2026
5104e81
Add op_coulomb_op: 9-component Gaunt LS bilinear integral
kshitij-05 Apr 17, 2026
590ce42
op_coulomb_op: redesign 9 components as SO(3) irreps
kshitij-05 Apr 26, 2026
b463ca8
Add σpRσp (oprop): 1-body σ·p · r · σ·p integral
kshitij-05 Apr 26, 2026
e5d95cd
Merge remote-tracking branch 'origin/master' into kshitij/feature/2e_…
kshitij-05 Apr 30, 2026
8648637
Rename opCoulombop to σpCoulombσp for naming consistency with sibling…
kshitij-05 Apr 30, 2026
e546469
3-center integrals in RKB basis
kshitij-05 May 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
203 changes: 107 additions & 96 deletions CMakeLists.txt

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion cmake/modules/int_am.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ endmacro()

process_integrals_class(ONEBODY)
process_integrals_class(ERI)
process_integrals_class(RKB_ERI)
process_integrals_class(ERI3)
process_integrals_class(ERI2)
# unlike above, these classes (1) don't do AM_LIST and (2) require value in config.h if enabled
Expand Down Expand Up @@ -396,7 +397,7 @@ list(REVERSE _amlist)
list(APPEND Libint2_ERI_COMPONENTS "${_amlist}")
message(VERBOSE "setting components ${_amlist}")

foreach(_cls ONEBODY;ERI;ERI3;ERI2;G12;G12DKH)
foreach(_cls ONEBODY;ERI;RKB_ERI;ERI3;ERI2;G12;G12DKH)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there's a slight disadv to the underscore if ppl are splitting the integral codes (e.g., rkb_eri_ffff_d1) on underscore, but I think RKB_ERI is fine.

if((_cls STREQUAL G12) OR (_cls STREQUAL G12DKH))
add_feature_info(
"integral class ${_cls}"
Expand Down Expand Up @@ -433,6 +434,8 @@ foreach(_cls ONEBODY;ERI;ERI3;ERI2;G12;G12DKH)
list(APPEND _amlist "onebody_${_am${_l}}${_am${_l}}_d${_d}")
elseif (_cls STREQUAL "G12")
list(APPEND _amlist "g12_${_am${_l}}${_am${_l}}${_am${_l}}${_am${_l}}_d${_d}")
elseif (_cls STREQUAL "RKB_ERI")
list(APPEND _amlist "rkb_eri_${_am${_l}}${_am${_l}}${_am${_l}}${_am${_l}}_d${_d}")
endif()
endforeach()
if (_cls STREQUAL "ERI3")
Expand Down
19 changes: 19 additions & 0 deletions include/libint2/config.h.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@
#undef LIBINT_INCLUDE_ERI
#endif

/* Support ERI derivatives up to this order */
#define LIBINT_INCLUDE_RKB_ERI @LIBINT_INCLUDE_RKB_ERI@
#if @LIBINT_INCLUDE_RKB_ERI@ == -1
#undef LIBINT_INCLUDE_RKB_ERI
#endif


/* Support 3-center ERI derivatives up to this order */
#define LIBINT_INCLUDE_ERI3 @LIBINT_INCLUDE_ERI3@
#if @LIBINT_INCLUDE_ERI3@ == -1
Expand Down Expand Up @@ -122,6 +129,18 @@
/* Max optimized AM for ERI and its derivatives */
#cmakedefine LIBINT_ERI_OPT_AM_LIST "@LIBINT_ERI_OPT_AM_LIST@"

/* Max AM for RKB_ERI (same for all derivatives; if not defined see LIBINT_ERI_MAX_AM_LIST) */
Comment thread
kshitij-05 marked this conversation as resolved.
Outdated
#cmakedefine LIBINT_RKB_ERI_MAX_AM @LIBINT_RKB_ERI_MAX_AM@

/* Max AM for RKB_ERI and its derivatives */
#cmakedefine LIBINT_RKB_ERI_MAX_AM_LIST "@LIBINT_RKB_ERI_MAX_AM_LIST@"

/* Max optimized AM for ERI (same for all derivatives; if not defined see LIBINT_ERI_OPT_AM_LIST) */
Comment thread
kshitij-05 marked this conversation as resolved.
Outdated
#cmakedefine LIBINT_RKB_ERI_OPT_AM @LIBINT_RKB_ERI_OPT_AM@

/* Max optimized AM for ERI and its derivatives */
#cmakedefine LIBINT_RKB_ERI_OPT_AM_LIST "@LIBINT_RKB_ERI_OPT_AM_LIST@"

/* Max AM for 3-center ERI (same for all derivatives; if not defined see LIBINT_ERI3_MAX_AM_LIST) */
#cmakedefine LIBINT_ERI3_MAX_AM @LIBINT_ERI3_MAX_AM@

Expand Down
4 changes: 2 additions & 2 deletions include/libint2/cxxapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@

#if !defined(LIBINT_INCLUDE_ONEBODY) || \
!(defined(LIBINT_INCLUDE_ERI) || defined(LIBINT_INCLUDE_ERI3) || \
defined(LIBINT_INCLUDE_ERI2))
defined(LIBINT_INCLUDE_ERI2) || defined(LIBINT_INCLUDE_RKB_ERI))
#error \
"C++ API is only supported if both 1-body and some (eri, eri3, eri2) 2-body integrals are enabled"
"C++ API is only supported if both 1-body and some (eri, eri3, eri2, rkb_eri) 2-body integrals are enabled"
#endif

#include <libint2/atom.h>
Expand Down
12 changes: 12 additions & 0 deletions include/libint2/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ enum class Operator {
coulomb,
/// alias for Operator::coulomb
r12_m1 = coulomb,
/// (2-body) \f$ r_{12}^{-1} (σ.p_{k1})(σ.p_{k2})\f$ where k1 & k2 are
/// centers of ket1 and ket2, respectively
coulomb_opop,
/// contracted Gaussian geminal
cgtg,
/// contracted Gaussian geminal times Coulomb
Expand Down Expand Up @@ -246,6 +249,7 @@ struct operator_traits<Operator::nuclear>
typedef const libint2::FmEval_Reference<scalar_type> core_eval_type;
#endif
};

template <>
struct operator_traits<Operator::opVop>
: public operator_traits<Operator::nuclear> {
Expand Down Expand Up @@ -346,6 +350,14 @@ struct operator_traits<Operator::coulomb>
typedef const libint2::FmEval_Reference<scalar_type> core_eval_type;
#endif
};

template <>
struct operator_traits<Operator::coulomb_opop>
: public operator_traits<Operator::coulomb> {
static constexpr auto nopers = 4;
static constexpr auto intrinsic_deriv_order = 2;
};

namespace detail {
template <int K>
struct cgtg_operator_traits : public detail::default_operator_traits {
Expand Down
74 changes: 41 additions & 33 deletions include/libint2/engine.impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,30 +70,31 @@ typename std::remove_all_extents<T>::type* to_ptr1(T (&a)[N]) {
/// These MUST appear in the same order as in Operator.
/// You must also update BOOST_PP_NBODY_OPERATOR_LAST_ONEBODY_INDEX when you add
/// one-body ints
#define BOOST_PP_NBODY_OPERATOR_LIST \
(overlap, /* overlap */ \
(kinetic, /* kinetic */ \
(elecpot, /* nuclear */ \
(elecpot, /* erf_nuclear */ \
(elecpot, /* erfc_nuclear */ \
(elecpot, /* erfx_nuclear */ \
(1emultipole, /* emultipole1 */ \
(2emultipole, /* emultipole2 */ \
(3emultipole, /* emultipole3 */ \
(sphemultipole, /* sphemultipole */ \
(opVop, /* opVop */ \
(eri, /* delta */ \
(eri, /* coulomb */ \
(eri, /* cgtg */ \
(eri, /* cgtg_x_coulomb */ \
(eri, /* delcgtg2 */ \
(eri, /* r12 */ \
(eri, /* erf_coulomb */ \
(eri, /* erfc_coulomb */ \
(eri, /* erfx_coulomb */ \
(eri, /* stg */ \
(eri, /* yukawa */ \
BOOST_PP_NIL))))))))))))))))))))))
#define BOOST_PP_NBODY_OPERATOR_LIST \
(overlap, /* overlap */ \
(kinetic, /* kinetic */ \
(elecpot, /* nuclear */ \
(elecpot, /* erf_nuclear */ \
(elecpot, /* erfc_nuclear */ \
(elecpot, /* erfx_nuclear */ \
(1emultipole, /* emultipole1 */ \
(2emultipole, /* emultipole2 */ \
(3emultipole, /* emultipole3 */ \
(sphemultipole, /* sphemultipole */ \
(opVop, /* opVop */ \
(eri, /* delta */ \
(eri, /* coulomb */ \
(eri, /* coulomb_opop */ \
(eri, /* cgtg */ \
(eri, /* cgtg_x_coulomb */ \
(eri, /* delcgtg2 */ \
(eri, /* r12 */ \
(eri, /* erf_coulomb */ \
(eri, /* erfc_coulomb */ \
(eri, /* erfx_coulomb */ \
(eri, /* stg */ \
(eri, /* yukawa */ \
BOOST_PP_NIL)))))))))))))))))))))))

#define BOOST_PP_NBODY_OPERATOR_INDEX_TUPLE \
BOOST_PP_MAKE_TUPLE(BOOST_PP_LIST_SIZE(BOOST_PP_NBODY_OPERATOR_LIST))
Expand Down Expand Up @@ -663,23 +664,23 @@ __libint2_engine_inline void Engine::initialize(size_t max_nprim) {
// validate braket
#ifndef LIBINT_INCLUDE_ONEBODY
assert(braket_ != BraKet::x_x &&
"this braket type not supported by the library; give --enable-1body "
"to configure");
"this braket type not supported by the library; configure with "
"-DLIBINT_INCLUDE_ONEBODY >= 0");
Comment thread
kshitij-05 marked this conversation as resolved.
Outdated
#endif
#ifndef LIBINT_INCLUDE_ERI
assert(braket_ != BraKet::xx_xx &&
"this braket type not supported by the library; give --enable-eri to "
"configure");
"this braket type not supported by the library; configure with "
"-DLIBINT_INCLUDE_ERI >= 0");
Comment thread
kshitij-05 marked this conversation as resolved.
Outdated
#endif
#ifndef LIBINT_INCLUDE_ERI3
assert((braket_ != BraKet::xs_xx && braket_ != BraKet::xx_xs) &&
"this braket type not supported by the library; give --enable-eri3 to "
"configure");
"this braket type not supported by the library; configure with "
"-DLIBINT_INCLUDE_ERI3 >= 0");
Comment thread
kshitij-05 marked this conversation as resolved.
Outdated
#endif
#ifndef LIBINT_INCLUDE_ERI2
assert(braket_ != BraKet::xs_xs &&
"this braket type not supported by the library; give --enable-eri2 to "
"configure");
"this braket type not supported by the library; configure with "
"-DLIBINT_INCLUDE_ERI2 >= 0");
Comment thread
kshitij-05 marked this conversation as resolved.
Outdated
#endif

// make sure it's no default initialized
Expand Down Expand Up @@ -1421,7 +1422,7 @@ __libint2_engine_inline const Engine::target_ptr_vec& Engine::compute2(
const scalar_type rho = gammap * gammaq * oogammapq;
const scalar_type T = PQ2 * rho;
auto* gm_ptr = &(primdata.LIBINT_T_SS_EREP_SS(0)[0]);
const auto mmax = l + deriv_order_;
const auto mmax = l + deriv_order_ + intrinsic_deriv_order();

if (!skip_core_ints) {
switch (oper_) {
Expand All @@ -1432,6 +1433,13 @@ __libint2_engine_inline const Engine::target_ptr_vec& Engine::compute2(
.first();
core_eval_ptr->eval(gm_ptr, T, mmax);
} break;
case Operator::coulomb_opop: {
const auto& core_eval_ptr =
any_cast<const detail::core_eval_pack_type<
Operator::coulomb_opop>&>(core_eval_pack_)
.first();
core_eval_ptr->eval(gm_ptr, T, mmax);
} break;
case Operator::cgtg_x_coulomb: {
const auto& core_eval_ptr =
any_cast<const detail::core_eval_pack_type<
Expand Down
Loading