GQCP
Loading...
Searching...
No Matches
GHFFockMatrixDiagonalization.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 <Eigen/Dense>
25
26
27namespace GQCP {
28
29
35template <typename _Scalar>
37 public Step<GHFSCFEnvironment<_Scalar>> {
38
39public:
40 using Scalar = _Scalar;
42
43
44public:
45 /*
46 * OVERRIDDEN PUBLIC METHODS
47 */
48
52 std::string description() const override {
53 return "Solve the generalized eigenvalue problem for the most recent scalar/AO Fock matrix. Add the associated coefficient matrix and orbital energies to the environment.";
54 }
55
56
62 void execute(Environment& environment) override {
63
64 const auto& F = environment.fock_matrices.back().parameters(); // The most recent scalar/AO basis Fock matrix.
65
66 using MatrixType = Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>;
67 Eigen::GeneralizedSelfAdjointEigenSolver<MatrixType> generalized_eigensolver {F, environment.S.parameters()};
68 const GTransformation<Scalar>& C {generalized_eigensolver.eigenvectors()};
69 const auto& orbital_energies = generalized_eigensolver.eigenvalues();
70
71 environment.coefficient_matrices.push_back(C);
72 environment.orbital_energies.push_back(orbital_energies);
73 }
74};
75
76
77} // namespace GQCP
Definition: GHFFockMatrixDiagonalization.hpp:37
std::string description() const override
Definition: GHFFockMatrixDiagonalization.hpp:52
void execute(Environment &environment) override
Definition: GHFFockMatrixDiagonalization.hpp:62
_Scalar Scalar
Definition: GHFFockMatrixDiagonalization.hpp:40
Definition: GHFSCFEnvironment.hpp:45
std::deque< GTransformation< Scalar > > coefficient_matrices
Definition: GHFSCFEnvironment.hpp:59
ScalarGSQOneElectronOperator< Scalar > S
Definition: GHFSCFEnvironment.hpp:57
std::deque< VectorX< Scalar > > orbital_energies
Definition: GHFSCFEnvironment.hpp:55
std::deque< ScalarGSQOneElectronOperator< Scalar > > fock_matrices
Definition: GHFSCFEnvironment.hpp:61
Definition: GTransformation.hpp:43
Definition: Step.hpp:37
Definition: BaseOneElectronIntegralBuffer.hpp:25