33template <
typename _PrimitiveIntegralEngine>
35 public BaseTwoElectronIntegralEngine<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} {}
83 std::shared_ptr<BaseTwoElectronIntegralBuffer<IntegralScalar, N>>
calculate(
const Shell& shell1,
const Shell& shell2,
const Shell& shell3,
const Shell& shell4)
override {
86 const auto basis_functions1 = shell1.basisFunctions();
87 const auto basis_functions2 = shell2.basisFunctions();
88 const auto basis_functions3 = shell3.basisFunctions();
89 const auto basis_functions4 = shell4.basisFunctions();
91 std::array<std::vector<IntegralScalar>,
N> integrals;
93 for (
size_t i = 0; i <
N; i++) {
94 this->primitive_engine.prepareStateForComponent(i);
96 for (
const auto& bf1 : basis_functions1) {
97 const auto& coefficients1 = bf1.coefficients();
98 const auto& primitives1 = bf1.functions();
100 for (
const auto& bf2 : basis_functions2) {
101 const auto& coefficients2 = bf2.coefficients();
102 const auto& primitives2 = bf2.functions();
104 for (
const auto& bf3 : basis_functions3) {
105 const auto& coefficients3 = bf3.coefficients();
106 const auto& primitives3 = bf3.functions();
108 for (
const auto& bf4 : basis_functions4) {
109 const auto& coefficients4 = bf4.coefficients();
110 const auto& primitives4 = bf4.functions();
113 for (
size_t c1 = 0; c1 < bf1.length(); c1++) {
114 const auto& d1 = coefficients1[c1];
115 const auto& primitive1 = primitives1[c1];
117 for (
size_t c2 = 0; c2 < bf2.length(); c2++) {
118 const auto& d2 = coefficients2[c2];
119 const auto& primitive2 = primitives2[c2];
121 for (
size_t c3 = 0; c3 < bf3.length(); c3++) {
122 const auto& d3 = coefficients3[c3];
123 const auto& primitive3 = primitives3[c3];
125 for (
size_t c4 = 0; c4 < bf4.length(); c4++) {
126 const auto& d4 = coefficients4[c4];
127 const auto& primitive4 = primitives4[c4];
129 const auto primitive_integral = this->primitive_engine.calculate(primitive1, primitive2, primitive3, primitive4);
130 integral += d1 * d2 * d3 * d4 * primitive_integral;
135 integrals[i].push_back(integral);
142 return std::make_shared<TwoElectronIntegralBuffer<IntegralScalar, N>>(shell1.numberOfBasisFunctions(), shell2.numberOfBasisFunctions(), shell3.numberOfBasisFunctions(), shell4.numberOfBasisFunctions(), integrals);
Definition: BaseTwoElectronIntegralEngine.hpp:37
Definition: TwoElectronIntegralEngine.hpp:35
std::shared_ptr< BaseTwoElectronIntegralBuffer< IntegralScalar, N > > calculate(const Shell &shell1, const Shell &shell2, const Shell &shell3, const Shell &shell4) override
Definition: TwoElectronIntegralEngine.hpp:83
TwoElectronIntegralEngine(const PrimitiveIntegralEngine &primitive_engine)
Definition: TwoElectronIntegralEngine.hpp:63
typename _PrimitiveIntegralEngine::IntegralScalar IntegralScalar
Definition: TwoElectronIntegralEngine.hpp:44
static constexpr auto N
Definition: TwoElectronIntegralEngine.hpp:47
_PrimitiveIntegralEngine PrimitiveIntegralEngine
Definition: TwoElectronIntegralEngine.hpp:38
typename _PrimitiveIntegralEngine::Shell Shell
Definition: TwoElectronIntegralEngine.hpp:41
Definition: BaseOneElectronIntegralBuffer.hpp:25