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
40 changes: 40 additions & 0 deletions include/simde/numerical_methods/eigen_solve.hpp
Original file line number Diff line number Diff line change
@@ -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 <pluginplay/property_type/property_type.hpp>
#include <simde/types.hpp>

namespace simde {

DECLARE_PROPERTY_TYPE(EigenSolve);

PROPERTY_TYPE_INPUTS(EigenSolve) {
using input_type = const type::tensor&;
auto rv = pluginplay::declare_input().add_field<input_type>("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<result_type>("Eigen values")
.template add_field<result_type>("Eigen vectors");
return rv;
}

} // namespace simde
1 change: 1 addition & 0 deletions include/simde/numerical_methods/numerical_methods.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@

#pragma once

#include <simde/numerical_methods/eigen_solve.hpp>
#include <simde/numerical_methods/generalized_eigen_solve.hpp>
5 changes: 5 additions & 0 deletions tests/cxx/unit_tests/numerical_methods/numerical_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@

using namespace simde;

TEST_CASE("EigenSolve") {
test_property_type<EigenSolve>({"Matrix"},
{"Eigen values", "Eigen vectors"});
}

TEST_CASE("GeneralizedEigenSolve") {
test_property_type<GeneralizedEigenSolve>(
{"Matrix", "Metric"}, {"Eigen values", "Eigen vectors"});
Expand Down
Loading