GQCP
Loading...
Searching...
No Matches
SubspaceMatrixCalculation.hpp
Go to the documentation of this file.
1// This file is part of GQCG-GQCP.
2//
3// Copyright (C) 2017-2020 the GQCG developers
4//
5// GQCG-GQCP is free software: you can redistribute it and/or modify
6// it under the terms of the GNU Lesser General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// GQCG-GQCP is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU Lesser General Public License for more details.
14//
15// You should have received a copy of the GNU Lesser General Public License
16// along with GQCG-GQCP. If not, see <http://www.gnu.org/licenses/>.
17
18#pragma once
19
20
23
24#include <type_traits>
25
26
27namespace GQCP {
28
29
34 public Step<EigenproblemEnvironment<double>> {
35
36public:
37 /*
38 * PUBLIC OVERRIDDEN METHODS
39 */
40
44 std::string description() const override {
45 return "Calculate the subspace matrix, i.e. the projection of the matrix A onto the subspace spanned by the vectors in V.";
46 }
47
48
54 void execute(EigenproblemEnvironment<double>& environment) override {
55
56 const auto& V = environment.V; // the subspace of guess vectors
57 const auto& VA = environment.VA; // VA = A * V (implicitly calculated through the matrix-vector product)
58
59 environment.S = V.transpose() * VA; // the "subspace matrix": the projection of the matrix A onto the subspace spanned by the vectors in V
60 }
61};
62
63
64} // namespace GQCP
Definition: EigenproblemEnvironment.hpp:35
MatrixX< Scalar > V
Definition: EigenproblemEnvironment.hpp:73
SquareMatrix< Scalar > S
Definition: EigenproblemEnvironment.hpp:63
MatrixX< Scalar > VA
Definition: EigenproblemEnvironment.hpp:76
Definition: Step.hpp:37
Definition: SubspaceMatrixCalculation.hpp:34
void execute(EigenproblemEnvironment< double > &environment) override
Definition: SubspaceMatrixCalculation.hpp:54
std::string description() const override
Definition: SubspaceMatrixCalculation.hpp:44
Definition: BaseOneElectronIntegralBuffer.hpp:25