GQCP
Loading...
Searching...
No Matches
UHFElectronicEnergyCalculation.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
24#include "QCModel/HF/UHF.hpp"
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 "Calculate the current electronic UHF energy and place it in the environment.";
54 }
55
56
62 void execute(Environment& environment) override {
63
64 const auto& H_core = environment.sq_hamiltonian.core(); // The core Hamiltonian matrix: in zero-field calculations, alpha and beta are equal.
65
66 const auto& P = environment.density_matrices.back(); // The most recent alpha & beta density matrix.
67
68 const auto& F = environment.fock_matrices.back(); // the most recent alpha and beta Fock matrices
69
70 const auto E_electronic = QCModel::UHF<Scalar>::calculateElectronicEnergy(P, H_core, F);
71
72 environment.electronic_energies.push_back(E_electronic);
73 }
74};
75
76
77} // namespace GQCP
static Scalar calculateElectronicEnergy(const SpinResolved1DM< Scalar > &P, const ScalarUSQOneElectronOperator< Scalar > &H_core, const ScalarUSQOneElectronOperator< Scalar > &F)
Definition: UHF.hpp:139
Definition: Step.hpp:37
Definition: UHFElectronicEnergyCalculation.hpp:37
_Scalar Scalar
Definition: UHFElectronicEnergyCalculation.hpp:40
void execute(Environment &environment) override
Definition: UHFElectronicEnergyCalculation.hpp:62
std::string description() const override
Definition: UHFElectronicEnergyCalculation.hpp:52
Definition: UHFSCFEnvironment.hpp:45
std::deque< ScalarUSQOneElectronOperator< Scalar > > fock_matrices
Definition: UHFSCFEnvironment.hpp:63
std::deque< SpinResolved1DM< Scalar > > density_matrices
Definition: UHFSCFEnvironment.hpp:61
std::deque< Scalar > electronic_energies
Definition: UHFSCFEnvironment.hpp:53
USQHamiltonian< Scalar > sq_hamiltonian
Definition: UHFSCFEnvironment.hpp:67
Definition: BaseOneElectronIntegralBuffer.hpp:25