diff --git a/src/integrals/ao_integrals/ao_integrals.cpp b/src/integrals/ao_integrals/ao_integrals.cpp index 833804d2..b477759c 100644 --- a/src/integrals/ao_integrals/ao_integrals.cpp +++ b/src/integrals/ao_integrals/ao_integrals.cpp @@ -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; @@ -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); } @@ -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); } @@ -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); @@ -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"); diff --git a/src/integrals/ao_integrals/ao_integrals.hpp b/src/integrals/ao_integrals/ao_integrals.hpp index 7d30cb6d..56b5dd8a 100644 --- a/src/integrals/ao_integrals/ao_integrals.hpp +++ b/src/integrals/ao_integrals/ao_integrals.hpp @@ -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; @@ -63,7 +64,7 @@ void ao_integrals_set_defaults(pluginplay::ModuleManager& mm); EXTERN_AOI>; EXTERN_AOI>; EXTERN_AOI>; - +EXTERN_AOI>; EXTERN_AOI>; EXTERN_AOI>; EXTERN_AOI>; diff --git a/src/integrals/ao_integrals/detail_/libint_op.hpp b/src/integrals/ao_integrals/detail_/libint_op.hpp index bbbd1ae2..f7f74142 100644 --- a/src/integrals/ao_integrals/detail_/libint_op.hpp +++ b/src/integrals/ao_integrals/detail_/libint_op.hpp @@ -38,6 +38,11 @@ struct LibintOp { static constexpr auto value = libint2::Operator::nuclear; }; +template<> +struct LibintOp { + static constexpr auto value = libint2::Operator::overlap; +}; + template static constexpr auto op_v = detail_::LibintOp::value; diff --git a/tests/cxx/unit/integrals/ao_integrals/test_overlap.cpp b/tests/cxx/unit/integrals/ao_integrals/test_overlap.cpp new file mode 100644 index 00000000..139e4275 --- /dev/null +++ b/tests/cxx/unit/integrals/ao_integrals/test_overlap.cpp @@ -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(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)); +}