Skip to content

Commit 2d1e828

Browse files
authored
generalize collocation matrix (#172)
1 parent a001878 commit 2d1e828

2 files changed

Lines changed: 16 additions & 10 deletions

File tree

include/simde/integration_grids/collocation_matrix.hpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,25 @@
2121

2222
namespace simde {
2323

24-
DECLARE_PROPERTY_TYPE(CollocationMatrix);
24+
template<typename QuantityToCollocate>
25+
DECLARE_TEMPLATED_PROPERTY_TYPE(CollocationMatrix, QuantityToCollocate);
2526

26-
PROPERTY_TYPE_INPUTS(CollocationMatrix) {
27-
using grid_type = chemist::Grid;
28-
using ao_basis_type = simde::type::ao_basis_set;
27+
template<typename QuantityToCollocate>
28+
TEMPLATED_PROPERTY_TYPE_INPUTS(CollocationMatrix, QuantityToCollocate) {
29+
using grid_type = chemist::Grid;
2930
return pluginplay::declare_input()
3031
.add_field<grid_type>("Grid")
31-
.add_field<const ao_basis_type&>("AO Basis Set");
32+
.add_field<const QuantityToCollocate&>("Quantity to Collocate");
3233
}
3334

34-
PROPERTY_TYPE_RESULTS(CollocationMatrix) {
35+
template<typename QuantityToCollocate>
36+
TEMPLATED_PROPERTY_TYPE_RESULTS(CollocationMatrix, QuantityToCollocate) {
3537
using result_type = simde::type::tensor;
3638
return pluginplay::declare_result().add_field<result_type>(
3739
"Collocation Matrix");
3840
}
3941

42+
using AOCollocationMatrix = CollocationMatrix<simde::type::ao_basis_set>;
43+
using EDensityCollocationMatrix = CollocationMatrix<simde::type::e_density>;
44+
4045
} // namespace simde

tests/cxx/unit_tests/integration_grids/collocation_matrix.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717
#include "../test_property_type.hpp"
1818
#include <simde/integration_grids/collocation_matrix.hpp>
1919

20-
using property_type = simde::CollocationMatrix;
20+
using property_types =
21+
std::tuple<simde::AOCollocationMatrix, simde::EDensityCollocationMatrix>;
2122

22-
TEST_CASE("CollocationMatrix") {
23-
test_property_type<property_type>({"Grid", "AO Basis Set"},
24-
{"Collocation Matrix"});
23+
TEMPLATE_LIST_TEST_CASE("CollocationMatrix", "", property_types) {
24+
test_property_type<TestType>({"Grid", "Quantity to Collocate"},
25+
{"Collocation Matrix"});
2526
}

0 commit comments

Comments
 (0)