Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions src/integrals/integrals_mm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "ao_integrals/ao_integrals.hpp"
#include "libint/libint.hpp"
#include <integrals/integrals_mm.hpp>

namespace integrals {
Expand All @@ -30,7 +30,7 @@ void set_defaults(pluginplay::ModuleManager& mm) {
}

void load_modules(pluginplay::ModuleManager& mm) {
ao_integrals::load_ao_integrals(mm);
libint::load_libint(mm);
set_defaults(mm);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "make_libint_basis_set.hpp"
#include <simde/types.hpp>

namespace integrals::ao_integrals::detail_ {
namespace integrals::libint::detail_ {

/** @brief Deterimine how many basis sets are in the Bra and Ket.
*
Expand Down Expand Up @@ -78,4 +78,4 @@ std::vector<libint2::BasisSet> get_basis_sets(const BraType& bra,
return basis_sets;
}

} // namespace integrals::ao_integrals::detail_
} // namespace integrals::libint::detail_
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <libint2.hpp>
#include <simde/types.hpp>

namespace integrals::ao_integrals::detail_ {
namespace integrals::libint::detail_ {

template<typename T>
struct LibintOp;
Expand Down Expand Up @@ -46,4 +46,4 @@ struct LibintOp<simde::type::s_e_type> {
template<typename T>
static constexpr auto op_v = detail_::LibintOp<T>::value;

} // namespace integrals::ao_integrals::detail_
} // namespace integrals::libint::detail_
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <libint2.hpp>
#include <simde/types.hpp>

namespace integrals::ao_integrals::detail_ {
namespace integrals::libint::detail_ {

/** @brief Constructs a Libint engine.
*
Expand All @@ -34,7 +34,7 @@ template<typename OpType>
auto make_engine(const std::vector<libint2::BasisSet>& bases, const OpType& op,
double thresh, std::size_t deriv = 0) {
// Variables for engine construction
constexpr auto libint_op = integrals::ao_integrals::detail_::op_v<OpType>;
constexpr auto libint_op = integrals::libint::detail_::op_v<OpType>;
auto max_nprims = libint2::max_nprim(bases[0]);
auto max_l = libint2::max_l(bases[0]);

Expand Down Expand Up @@ -85,4 +85,4 @@ void run_engine_(libint2::Engine& engine,
engine.compute(bases[Is][shells[Is]]...);
}

} // namespace integrals::ao_integrals::detail_
} // namespace integrals::libint::detail_
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <simde/types.hpp>
#include <vector>

namespace integrals::ao_integrals::detail_ {
namespace integrals::libint::detail_ {

/** @brief Converts an NWX basis set object to a LibInt2 basis set object.
*
Expand Down Expand Up @@ -87,4 +87,4 @@ inline auto make_libint_basis_set(const simde::type::ao_basis_set& bs) {
return basis_t(centers, element_bases);
}

} // namespace integrals::ao_integrals::detail_
} // namespace integrals::libint::detail_
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <libint2.hpp>
#include <simde/types.hpp>

namespace integrals::ao_integrals::detail_ {
namespace integrals::libint::detail_ {

/** @brief Find the ordinal indices spanned by the shell
*
Expand Down Expand Up @@ -71,4 +71,4 @@ inline auto shells2ord(const std::vector<libint2::BasisSet>& bases,
return ords;
}

} // namespace integrals::ao_integrals::detail_
} // namespace integrals::libint::detail_
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@
* limitations under the License.
*/
#include "../uncertain_types.hpp"
#include "ao_integrals.hpp"
#include "detail_/get_basis_sets.hpp"
#include "detail_/libint_op.hpp"
#include "detail_/make_engine.hpp"
#include "detail_/make_libint_basis_set.hpp"
#include "detail_/shells2ord.hpp"
#include "lib_int_visitor.hpp"
#include "libint.hpp"
#include "libint_visitor.hpp"
#include <type_traits>

namespace integrals::ao_integrals {
namespace integrals::libint {
namespace {

template<typename FloatType, unsigned int N>
Expand Down Expand Up @@ -61,7 +61,7 @@ auto fill_tensor(const std::vector<libint2::BasisSet>& basis_sets,
auto b = build_eigen_buffer<FloatType, N>(basis_sets, thresh);

// Make libint engine
LibIntVisitor visitor(basis_sets, thresh);
LibintVisitor visitor(basis_sets, thresh);
op.visit(visitor);
auto engine = visitor.engine();
const auto& buf = engine.results();
Expand Down Expand Up @@ -99,7 +99,7 @@ auto fill_tensor(const std::vector<libint2::BasisSet>& basis_sets,
} // namespace

template<typename BraKetType>
TEMPLATED_MODULE_CTOR(AOIntegral, BraKetType) {
TEMPLATED_MODULE_CTOR(Libint, BraKetType) {
using my_pt = simde::EvaluateBraKet<BraKetType>;
satisfies_property_type<my_pt>();
description("Driver for computing integrals with Libint");
Expand All @@ -113,7 +113,7 @@ TEMPLATED_MODULE_CTOR(AOIntegral, BraKetType) {
}

template<typename BraKetType>
TEMPLATED_MODULE_RUN(AOIntegral, BraKetType) {
TEMPLATED_MODULE_RUN(Libint, BraKetType) {
using my_pt = simde::EvaluateBraKet<BraKetType>;

const auto& [braket] = my_pt::unwrap_inputs(inputs);
Expand Down Expand Up @@ -142,38 +142,42 @@ TEMPLATED_MODULE_RUN(AOIntegral, BraKetType) {
return my_pt::wrap_results(rv, t);
}

#define AOI(bra, op, ket) AOIntegral<braket<bra, op, ket>>
#define EXTERN_AOI(bra, op, ket) template struct AOI(bra, op, ket)
#define LOAD_AOI(bra, op, ket, key) mm.add_module<AOI(bra, op, ket)>(key)

EXTERN_AOI(aos, op_base_type, aos);
EXTERN_AOI(aos, op_base_type, aos_squared);
EXTERN_AOI(aos_squared, op_base_type, aos_squared);
EXTERN_AOI(aos, s_e_type, aos);
EXTERN_AOI(aos, t_e_type, aos);
EXTERN_AOI(aos, v_en_type, aos);
EXTERN_AOI(aos, v_ee_type, aos);
EXTERN_AOI(aos, v_ee_type, aos_squared);
EXTERN_AOI(aos_squared, v_ee_type, aos_squared);

void ao_integrals_set_defaults(pluginplay::ModuleManager& mm) {
#define LIBINT(bra, op, ket) Libint<braket<bra, op, ket>>
#define EXTERN_LIBINT(bra, op, ket) template struct LIBINT(bra, op, ket)

EXTERN_LIBINT(aos, op_base_type, aos);
EXTERN_LIBINT(aos, op_base_type, aos_squared);
EXTERN_LIBINT(aos_squared, op_base_type, aos_squared);
EXTERN_LIBINT(aos, s_e_type, aos);
EXTERN_LIBINT(aos, t_e_type, aos);
EXTERN_LIBINT(aos, v_en_type, aos);
EXTERN_LIBINT(aos, v_ee_type, aos);
EXTERN_LIBINT(aos, v_ee_type, aos_squared);
EXTERN_LIBINT(aos_squared, v_ee_type, aos_squared);

#undef EXTERN_LIBINT

void libint_set_defaults(pluginplay::ModuleManager& mm) {
// Set any default associations
}

void load_ao_integrals(pluginplay::ModuleManager& mm) {
LOAD_AOI(aos, op_base_type, aos, "Evaluate 2-Index BraKet");
LOAD_AOI(aos, op_base_type, aos_squared, "Evaluate 3-Index BraKet");
LOAD_AOI(aos_squared, op_base_type, aos_squared, "Evaluate 4-Index BraKet");
LOAD_AOI(aos, s_e_type, aos, "Overlap");
LOAD_AOI(aos, t_e_type, aos, "Kinetic");
LOAD_AOI(aos, v_en_type, aos, "Nuclear");
LOAD_AOI(aos, v_ee_type, aos, "ERI2");
LOAD_AOI(aos, v_ee_type, aos_squared, "ERI3");
LOAD_AOI(aos_squared, v_ee_type, aos_squared, "ERI4");
ao_integrals_set_defaults(mm);
#define LOAD_LIBINT(bra, op, ket, key) mm.add_module<LIBINT(bra, op, ket)>(key)

void load_libint(pluginplay::ModuleManager& mm) {
LOAD_LIBINT(aos, op_base_type, aos, "Evaluate 2-Index BraKet");
LOAD_LIBINT(aos, op_base_type, aos_squared, "Evaluate 3-Index BraKet");
LOAD_LIBINT(aos_squared, op_base_type, aos_squared,
"Evaluate 4-Index BraKet");
LOAD_LIBINT(aos, s_e_type, aos, "Overlap");
LOAD_LIBINT(aos, t_e_type, aos, "Kinetic");
LOAD_LIBINT(aos, v_en_type, aos, "Nuclear");
LOAD_LIBINT(aos, v_ee_type, aos, "ERI2");
LOAD_LIBINT(aos, v_ee_type, aos_squared, "ERI3");
LOAD_LIBINT(aos_squared, v_ee_type, aos_squared, "ERI4");
libint_set_defaults(mm);
}

#undef AOI
#undef ADD_AOI
#undef LOAD_LIBINT
#undef LIBINT

} // namespace integrals::ao_integrals
} // namespace integrals::libint
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@
#include <pluginplay/pluginplay.hpp>
#include <simde/simde.hpp>

/** @namespace integrals::ao_integrals
/** @namespace integrals::libint
*
* @brief The namespace for the modules that produce AO Integrals
*/
namespace integrals::ao_integrals {
namespace integrals::libint {

using simde::type::braket;

Expand All @@ -40,37 +40,37 @@ using simde::type::v_en_type;
* @tparam BraKetType The type of the BraKet input
*/
template<typename BraKetType>
DECLARE_MODULE(AOIntegral);
DECLARE_MODULE(Libint);

/** @brief Load the AO integral modules into a Module Manager
/** @brief Load the libint modules into a Module Manager
*
* @param mm The Module Manager to load the modules into
*
* @throw none No throw guarantee
*/
void load_ao_integrals(pluginplay::ModuleManager& mm);
void load_libint(pluginplay::ModuleManager& mm);

/** @brief Set default module relationships
*
* @param mm The Module Manager with modules whose defaults will be set
*
* @throw none No throw guarantee
*/
void ao_integrals_set_defaults(pluginplay::ModuleManager& mm);
void libint_set_defaults(pluginplay::ModuleManager& mm);

// Forward External Template Declarations
#define EXTERN_AOI extern template struct AOIntegral
#define EXTERN_LIBINT extern template struct Libint

EXTERN_AOI<braket<aos, op_base_type, aos>>;
EXTERN_AOI<braket<aos, op_base_type, aos_squared>>;
EXTERN_AOI<braket<aos_squared, op_base_type, aos_squared>>;
EXTERN_AOI<braket<aos, s_e_type, aos>>;
EXTERN_AOI<braket<aos, t_e_type, aos>>;
EXTERN_AOI<braket<aos, v_en_type, aos>>;
EXTERN_AOI<braket<aos, v_ee_type, aos>>;
EXTERN_AOI<braket<aos, v_ee_type, aos_squared>>;
EXTERN_AOI<braket<aos_squared, v_ee_type, aos_squared>>;
EXTERN_LIBINT<braket<aos, op_base_type, aos>>;
EXTERN_LIBINT<braket<aos, op_base_type, aos_squared>>;
EXTERN_LIBINT<braket<aos_squared, op_base_type, aos_squared>>;
EXTERN_LIBINT<braket<aos, s_e_type, aos>>;
EXTERN_LIBINT<braket<aos, t_e_type, aos>>;
EXTERN_LIBINT<braket<aos, v_en_type, aos>>;
EXTERN_LIBINT<braket<aos, v_ee_type, aos>>;
EXTERN_LIBINT<braket<aos, v_ee_type, aos_squared>>;
EXTERN_LIBINT<braket<aos_squared, v_ee_type, aos_squared>>;

#undef EXTERN_AOI
#undef EXTERN_LIBINT

} // namespace integrals::ao_integrals
} // namespace integrals::libint
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
#pragma once
#include <simde/simde.hpp>

namespace integrals::ao_integrals {
namespace integrals::libint {

class LibIntVisitor : public chemist::qm_operator::OperatorVisitor {
class LibintVisitor : public chemist::qm_operator::OperatorVisitor {
public:
using s_e_type = simde::type::s_e_type;
using t_e_type = simde::type::t_e_type;
using v_ee_type = simde::type::v_ee_type;
using v_en_type = simde::type::v_en_type;

LibIntVisitor(const std::vector<libint2::BasisSet>& bases, double thresh,
LibintVisitor(const std::vector<libint2::BasisSet>& bases, double thresh,
std::size_t deriv = 0) :
m_bases(bases), m_thresh(thresh), m_deriv(deriv){};

Expand Down Expand Up @@ -54,4 +54,4 @@ class LibIntVisitor : public chemist::qm_operator::OperatorVisitor {
libint2::Engine m_engine;
};

} // namespace integrals::ao_integrals
} // namespace integrals::libint
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
*/

#include "../../water_sto3g.hpp"
#include "integrals/ao_integrals/detail_/make_libint_basis_set.hpp"
#include "integrals/libint/detail_/make_libint_basis_set.hpp"
#include "libint_basis_set_water.hpp"
#include <catch2/catch_test_macros.hpp>

TEST_CASE("make_libint_basis_set") {
using integrals::ao_integrals::detail_::make_libint_basis_set;
using integrals::libint::detail_::make_libint_basis_set;
auto aobs = test::water_sto3g_basis_set();
auto libint_bs = make_libint_basis_set(aobs);
auto libint_corr = test::water_basis_set();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@
* limitations under the License.
*/

#include "integrals/ao_integrals/detail_/shells2ord.hpp"
#include "integrals/libint/detail_/shells2ord.hpp"
#include "libint_basis_set_water.hpp"
#include <catch2/catch_test_macros.hpp>

TEST_CASE("shells2ord") {
using integrals::ao_integrals::detail_::shells2ord;
using integrals::libint::detail_::shells2ord;
auto aobs = test::water_basis_set();
std::vector<libint2::BasisSet> basis_sets{aobs, aobs};
std::vector<std::size_t> shells{2, 2};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

#include "integrals/uncertain_types.hpp"
#include "test_ao_integrals.hpp"
#include "test_libint.hpp"

using udouble = integrals::type::uncertain_double;
constexpr bool has_sigma = integrals::type::has_sigma();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "test_ao_integrals.hpp"
#include "test_libint.hpp"

TEST_CASE("ERI2") {
using test_pt = simde::ERI2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "test_ao_integrals.hpp"
#include "test_libint.hpp"

TEST_CASE("ERI3") {
using test_pt = simde::ERI3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "test_ao_integrals.hpp"
#include "test_libint.hpp"

TEST_CASE("ERI4") {
using test_pt = simde::ERI4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#include "test_ao_integrals.hpp"
#include "test_libint.hpp"

TEST_CASE("Kinetic") {
using test_pt = simde::aos_t_e_aos;
Expand Down
Loading