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
11 changes: 8 additions & 3 deletions src/integrals/ao_integrals/ao_integrals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ namespace integrals::ao_integrals {

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;
Expand All @@ -34,6 +35,10 @@ class LibIntVisitor : public chemist::qm_operator::OperatorVisitor {
std::size_t deriv = 0) :
m_bases(bases), m_thresh(thresh), m_deriv(deriv){};

void run(const s_e_type& S_e) {
m_engine = detail_::make_engine(m_bases, S_e, m_thresh, m_deriv);
}

void run(const t_e_type& T_e) {
m_engine = detail_::make_engine(m_bases, T_e, m_thresh, m_deriv);
}
Expand Down Expand Up @@ -135,7 +140,7 @@ TEMPLATED_MODULE_RUN(AOIntegral, BraKetType) {
}
}

tensor_t t({s, b});
tensor_t t(s, b);
auto rv = results();
return my_pt::wrap_results(rv, t);
}
Expand All @@ -147,7 +152,7 @@ TEMPLATED_MODULE_RUN(AOIntegral, BraKetType) {
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);
Expand All @@ -162,7 +167,7 @@ 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");
Expand Down
3 changes: 2 additions & 1 deletion src/integrals/ao_integrals/ao_integrals.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ using simde::type::aos;
using simde::type::aos_squared;

using simde::type::op_base_type;
using simde::type::s_e_type;
using simde::type::t_e_type;
using simde::type::v_ee_type;
using simde::type::v_en_type;
Expand Down Expand Up @@ -63,7 +64,7 @@ void ao_integrals_set_defaults(pluginplay::ModuleManager& mm);
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>>;
Expand Down
5 changes: 5 additions & 0 deletions src/integrals/ao_integrals/detail_/libint_op.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ struct LibintOp<simde::type::v_en_type> {
static constexpr auto value = libint2::Operator::nuclear;
};

template<>
struct LibintOp<simde::type::s_e_type> {
static constexpr auto value = libint2::Operator::overlap;
};

template<typename T>
static constexpr auto op_v = detail_::LibintOp<T>::value;

Expand Down
48 changes: 48 additions & 0 deletions tests/cxx/unit/integrals/ao_integrals/test_overlap.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright 2022 NWChemEx-Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "test_ao_integrals.hpp"

TEST_CASE("Overlap") {
using test_pt = simde::aos_s_e_aos;

pluginplay::ModuleManager mm;
integrals::load_modules(mm);
REQUIRE(mm.count("Overlap"));

// Get basis set
auto mol = test::water_molecule();
auto aobs = test::water_sto3g_basis_set();

// Make AOS object
simde::type::aos aos(aobs);

// Make Operator
simde::type::s_e_type op{};

// Make BraKet Input
chemist::braket::BraKet braket(aos, op, aos);

// Call module
auto S = mm.at("Overlap").run_as<test_pt>(braket);

// Check output
auto t = test::eigen_buffer<2>(S.buffer());
REQUIRE(test::trace(t) ==
Catch::Approx(7.00000000000000266).margin(1.0e-16));
REQUIRE(test::norm(t) ==
Catch::Approx(2.87134497074907324).margin(1.0e-16));
}
Loading