Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 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
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
163 changes: 87 additions & 76 deletions CMakeLists.txt

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions cmake/modules/int_am.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ macro(process_integrals_class class)
if (LIBINT2_${class}_OPT_AM EQUAL -1)
set(LIBINT_${class}_OPT_AM "")
else()
set($LIBINT_{class}_OPT_AM ${LIBINT2_${class}_OPT_AM})
set(LIBINT_${class}_OPT_AM ${LIBINT2_${class}_OPT_AM})
endif()
endif()
if (LIBINT_OPT_AM_LIST)
Expand Down 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)
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
66 changes: 66 additions & 0 deletions export/tests/unit/test-1body.cc
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,72 @@ TEST_CASE_METHOD(libint2::unit::DefaultFixture, "W correctness",
#endif // LIBINT2_SUPPORT_ONEBODY
}

TEST_CASE_METHOD(libint2::unit::DefaultFixture, "σpRσp correctness",
"[engine][1-body]") {
#if defined(LIBINT2_SUPPORT_ONEBODY)
if (LIBINT_SHGSHELL_ORDERING != LIBINT_SHGSHELL_ORDERING_STANDARD) return;

// Two contracted Gaussian shells at distinct centers. We exercise
// `(σ·p) r (σ·p)` over the (s|d) and (d|s) shell pairs and validate
// Hermiticity: trace components (q=0) are symmetric under bra↔ket swap,
// antisym components (q=1,2,3) are antisymmetric.
std::vector<Shell> obs{
Shell{{1.0, 3.0}, {{0, true, {1.0, 0.3}}}, {{0.0, 0.0, 0.0}}},
Shell{{2.0, 5.0}, {{2, true, {1.0, 0.2}}}, {{1.0, 1.0, 1.0}}}};

const auto lmax = std::min(2, LIBINT2_MAX_AM_oprop);
if (lmax < 2) return;

auto engine = Engine(Operator::oprop, 2, lmax);
engine.set_params(std::array<double, 3>{{0.0, 0.0, 0.0}});

// (s|σpRσp|d) and (d|σpRσp|s)
engine.compute(obs[0], obs[1]);
std::array<std::vector<double>, 12> ab;
for (int c = 0; c < 12; ++c) {
const auto* buf = engine.results()[c];
REQUIRE(buf != nullptr);
ab[c].assign(buf, buf + (1 * 5)); // n_s × n_d_pure = 1 × 5
}

engine.compute(obs[1], obs[0]);
std::array<std::vector<double>, 12> ba;
for (int c = 0; c < 12; ++c) {
const auto* buf = engine.results()[c];
REQUIRE(buf != nullptr);
ba[c].assign(buf, buf + (5 * 1)); // n_d_pure × n_s
}

// Hermiticity check: σpRσp is Hermitian, but the Pauli identity routes the
// imaginary i factor on the antisym pieces into a real-stored sign flip.
// q=0 trace: matrix is symmetric ⇒ ab[0+k][i,j] == ba[0+k][j,i]
// q=1..3 : matrix is antisym ⇒ ab[q+k][i,j] == -ba[q+k][j,i]
// (Indices: ab is laid out (i=0..n_s-1, j=0..n_d-1); ba is (j, i).)
const double tol = 1.0e-12;
for (int k = 0; k < 3; ++k) {
for (int q = 0; q < 4; ++q) {
const int comp = 4 * k + q;
const double expected_sign = (q == 0) ? +1.0 : -1.0;
for (int i = 0; i < 1; ++i) {
for (int j = 0; j < 5; ++j) {
const double v_ab = ab[comp][i * 5 + j];
const double v_ba = ba[comp][j * 1 + i];
REQUIRE(std::isfinite(v_ab));
REQUIRE(std::abs(v_ab - expected_sign * v_ba) < tol);
}
}
}
}

// Sanity: not every component is identically zero (would mask codegen bugs).
bool any_nonzero = false;
for (int c = 0; c < 12; ++c)
for (double v : ab[c])
if (std::abs(v) > 1.0e-10) any_nonzero = true;
REQUIRE(any_nonzero);
#endif // LIBINT2_SUPPORT_ONEBODY
}

// verify that python/tests/test_libint2.py:test_integrals is correct
TEST_CASE_METHOD(libint2::unit::DefaultFixture, "python correctness",
"[engine][1-body]") {
Expand Down
Loading