GQCP
Loading...
Searching...
No Matches
UHFFockMatrixDiagonalization.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<UHFSCFEnvironment<_Scalar>> {
38
39public:
40 using Scalar = _Scalar;
42
43
44public:
45 /*
46 * PUBLIC OVERRIDDEN METHODS
47 */
48
52 std::string description() const override {
53 return "Solve the generalized eigenvalue problem for the most recent scalar/AO Fock matrices. Add the associated coefficient matrices and orbital energies to the environment.";
54 }
55
56
62 void execute(Environment& environment) override {
63
64 const auto& F = environment.fock_matrices.back(); // The most recent scalar/AO basis alpha & beta Fock matrix.
65
66 using MatrixType = Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic>;
67
68 Eigen::GeneralizedSelfAdjointEigenSolver<MatrixType> generalized_eigensolver_alpha {F.alpha().parameters(), environment.S.alpha().parameters()};
69 const UTransformationComponent<Scalar>& C_alpha {generalized_eigensolver_alpha.eigenvectors()};
70
71 const auto& orbital_energies_alpha = generalized_eigensolver_alpha.eigenvalues();
72
73 Eigen::GeneralizedSelfAdjointEigenSolver<MatrixType> generalized_eigensolver_beta {F.beta().parameters(), environment.S.beta().parameters()};
74 const UTransformationComponent<Scalar>& C_beta {generalized_eigensolver_beta.eigenvectors()};
75
76 const auto& orbital_energies_beta = generalized_eigensolver_beta.eigenvalues();
77
78 const UTransformation<Scalar>& C {C_alpha, C_beta};
79 const SpinResolved<VectorX<Scalar>> mo_energies {orbital_energies_alpha, orbital_energies_beta};
80
81 environment.coefficient_matrices.push_back(C);
82 environment.orbital_energies.push_back(mo_energies);
83 }
84};
85
86
87} // namespace GQCP
Definition: SpinResolved.hpp:34
Definition: Step.hpp:37
Definition: UHFFockMatrixDiagonalization.hpp:37
_Scalar Scalar
Definition: UHFFockMatrixDiagonalization.hpp:40
std::string description() const override
Definition: UHFFockMatrixDiagonalization.hpp:52
void execute(Environment &environment) override
Definition: UHFFockMatrixDiagonalization.hpp:62
Definition: UHFSCFEnvironment.hpp:45
std::deque< ScalarUSQOneElectronOperator< Scalar > > fock_matrices
Definition: UHFSCFEnvironment.hpp:63
ScalarUSQOneElectronOperator< Scalar > S
Definition: UHFSCFEnvironment.hpp:57
std::deque< SpinResolved< VectorX< Scalar > > > orbital_energies
Definition: UHFSCFEnvironment.hpp:55
std::deque< UTransformation< Scalar > > coefficient_matrices
Definition: UHFSCFEnvironment.hpp:59
Definition: UTransformationComponent.hpp:41
Definition: UTransformation.hpp:46
Definition: BaseOneElectronIntegralBuffer.hpp:25