From 49793995ff1d2c5aaade3da6c8db7a8b65697672 Mon Sep 17 00:00:00 2001 From: "Ryan M. Richard" Date: Mon, 18 May 2026 14:55:18 -0500 Subject: [PATCH] adds a pt for normal eigensolve --- .../simde/numerical_methods/eigen_solve.hpp | 40 +++++++++++++++++++ .../numerical_methods/numerical_methods.hpp | 1 + .../numerical_methods/numerical_methods.cpp | 5 +++ 3 files changed, 46 insertions(+) create mode 100644 include/simde/numerical_methods/eigen_solve.hpp diff --git a/include/simde/numerical_methods/eigen_solve.hpp b/include/simde/numerical_methods/eigen_solve.hpp new file mode 100644 index 00000000..74bf4c92 --- /dev/null +++ b/include/simde/numerical_methods/eigen_solve.hpp @@ -0,0 +1,40 @@ +/* + * Copyright 2024 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. + */ + +#pragma once +#include +#include + +namespace simde { + +DECLARE_PROPERTY_TYPE(EigenSolve); + +PROPERTY_TYPE_INPUTS(EigenSolve) { + using input_type = const type::tensor&; + auto rv = pluginplay::declare_input().add_field("Matrix"); + rv["Matrix"].set_description("The matrix to diagonalize."); + return rv; +} + +PROPERTY_TYPE_RESULTS(EigenSolve) { + using result_type = type::tensor; + auto rv = pluginplay::declare_result() + .add_field("Eigen values") + .template add_field("Eigen vectors"); + return rv; +} + +} // namespace simde diff --git a/include/simde/numerical_methods/numerical_methods.hpp b/include/simde/numerical_methods/numerical_methods.hpp index ab54759c..981324a6 100644 --- a/include/simde/numerical_methods/numerical_methods.hpp +++ b/include/simde/numerical_methods/numerical_methods.hpp @@ -16,4 +16,5 @@ #pragma once +#include #include diff --git a/tests/cxx/unit_tests/numerical_methods/numerical_methods.cpp b/tests/cxx/unit_tests/numerical_methods/numerical_methods.cpp index 16bcb9f0..a9642dc8 100644 --- a/tests/cxx/unit_tests/numerical_methods/numerical_methods.cpp +++ b/tests/cxx/unit_tests/numerical_methods/numerical_methods.cpp @@ -19,6 +19,11 @@ using namespace simde; +TEST_CASE("EigenSolve") { + test_property_type({"Matrix"}, + {"Eigen values", "Eigen vectors"}); +} + TEST_CASE("GeneralizedEigenSolve") { test_property_type( {"Matrix", "Metric"}, {"Eigen values", "Eigen vectors"});