GQCP
Loading...
Searching...
No Matches
LibintTwoElectronIntegralBuffer.hpp
Go to the documentation of this file.
1// This file is part of GQCG-GQCP.
2//
3// Copyright (C) 2017-2020 the GQCG developers
4//
5// GQCG-GQCP is free software: you can redistribute it and/or modify
6// it under the terms of the GNU Lesser General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// GQCG-GQCP is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU Lesser General Public License for more details.
14//
15// You should have received a copy of the GNU Lesser General Public License
16// along with GQCG-GQCP. If not, see <http://www.gnu.org/licenses/>.
17
18#pragma once
19
20
22
23
24namespace GQCP {
25
26
32template <size_t _N>
34public:
35 using IntegralScalar = double; // the scalar representation of an integral for libint is always a real number
36 static constexpr auto N = _N; // the number of components the operator has
37
38
39private:
40 using libint2_buffer_t = LibintInterfacer::libint_target_ptr_vec; // t for type
41 libint2_buffer_t libint2_buffer;
42
43
44public:
45 /*
46 * CONSTRUCTORS
47 */
48
56 LibintTwoElectronIntegralBuffer(const libint2_buffer_t& libint2_buffer, const size_t nbf1, const size_t nbf2, const size_t nbf3, const size_t nbf4) :
57 libint2_buffer {libint2_buffer},
59
60
68 bool areIntegralsAllZero() const override { return (this->libint2_buffer[0] == nullptr); }
69
79 IntegralScalar value(const size_t i, const size_t f1, const size_t f2, const size_t f3, const size_t f4) const override {
80
81 return this->libint2_buffer[i][f4 + this->nbf4 * (f3 + this->nbf3 * (f2 + this->nbf2 * (f1)))]; // integrals are packed in row-major form
82 }
83};
84
85
86} // namespace GQCP
Definition: BaseTwoElectronIntegralBuffer.hpp:38
size_t nbf4
Definition: BaseTwoElectronIntegralBuffer.hpp:48
size_t nbf3
Definition: BaseTwoElectronIntegralBuffer.hpp:47
size_t nbf1
Definition: BaseTwoElectronIntegralBuffer.hpp:45
size_t nbf2
Definition: BaseTwoElectronIntegralBuffer.hpp:46
libint2::Engine::target_ptr_vec libint_target_ptr_vec
Definition: LibintInterfacer.hpp:45
Definition: LibintTwoElectronIntegralBuffer.hpp:33
double IntegralScalar
Definition: LibintTwoElectronIntegralBuffer.hpp:35
LibintTwoElectronIntegralBuffer(const libint2_buffer_t &libint2_buffer, const size_t nbf1, const size_t nbf2, const size_t nbf3, const size_t nbf4)
Definition: LibintTwoElectronIntegralBuffer.hpp:56
bool areIntegralsAllZero() const override
Definition: LibintTwoElectronIntegralBuffer.hpp:68
IntegralScalar value(const size_t i, const size_t f1, const size_t f2, const size_t f3, const size_t f4) const override
Definition: LibintTwoElectronIntegralBuffer.hpp:79
static constexpr auto N
Definition: LibintTwoElectronIntegralBuffer.hpp:36
Definition: BaseOneElectronIntegralBuffer.hpp:25