33template <
typename _PrimitiveIntegralEngine>
35 public BaseOneElectronIntegralEngine<typename _PrimitiveIntegralEngine::Shell, _PrimitiveIntegralEngine::Components, typename _PrimitiveIntegralEngine::IntegralScalar> {
41 using Shell =
typename _PrimitiveIntegralEngine::Shell;
47 static constexpr auto N = _PrimitiveIntegralEngine::Components;
64 primitive_engine {primitive_engine} {}
81 std::shared_ptr<BaseOneElectronIntegralBuffer<IntegralScalar, N>>
calculate(
const Shell& shell1,
const Shell& shell2)
override {
84 const auto basis_functions1 = shell1.basisFunctions();
85 const auto basis_functions2 = shell2.basisFunctions();
87 std::array<std::vector<IntegralScalar>,
N> integrals;
89 for (
size_t i = 0; i <
N; i++) {
90 this->primitive_engine.prepareStateForComponent(i);
92 for (
const auto& bf1 : basis_functions1) {
93 const auto& coefficients1 = bf1.coefficients();
94 const auto& primitives1 = bf1.functions();
96 for (
const auto& bf2 : basis_functions2) {
97 const auto& coefficients2 = bf2.coefficients();
98 const auto& primitives2 = bf2.functions();
101 for (
size_t c1 = 0; c1 < bf1.length(); c1++) {
102 const auto& d1 = coefficients1[c1];
103 const auto& primitive1 = primitives1[c1];
105 for (
size_t c2 = 0; c2 < bf2.length(); c2++) {
106 const auto& d2 = coefficients2[c2];
107 const auto& primitive2 = primitives2[c2];
109 const auto primitive_integral = this->primitive_engine.calculate(primitive1, primitive2);
110 integral += d1 * d2 * primitive_integral;
113 integrals[i].push_back(integral);
118 return std::make_shared<OneElectronIntegralBuffer<IntegralScalar, N>>(shell1.numberOfBasisFunctions(), shell2.numberOfBasisFunctions(), integrals);
Definition: BaseOneElectronIntegralEngine.hpp:37
Definition: OneElectronIntegralEngine.hpp:35
static constexpr auto N
Definition: OneElectronIntegralEngine.hpp:47
typename _PrimitiveIntegralEngine::IntegralScalar IntegralScalar
Definition: OneElectronIntegralEngine.hpp:44
std::shared_ptr< BaseOneElectronIntegralBuffer< IntegralScalar, N > > calculate(const Shell &shell1, const Shell &shell2) override
Definition: OneElectronIntegralEngine.hpp:81
_PrimitiveIntegralEngine PrimitiveIntegralEngine
Definition: OneElectronIntegralEngine.hpp:38
OneElectronIntegralEngine(const PrimitiveIntegralEngine &primitive_engine)
Definition: OneElectronIntegralEngine.hpp:63
typename _PrimitiveIntegralEngine::Shell Shell
Definition: OneElectronIntegralEngine.hpp:41
Definition: BaseOneElectronIntegralBuffer.hpp:25