GQCP
Loading...
Searching...
No Matches
CCDEnergyCalculation.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
25namespace GQCP {
26
27
33template <typename _Scalar>
35 public Step<CCSDEnvironment<_Scalar>> {
36
37public:
38 using Scalar = _Scalar;
40
41
42public:
43 /*
44 * OVERRIDDEN PUBLIC METHODS
45 */
46
50 std::string description() const override {
51 return "Calculate the current CCD electronic correlation energy.";
52 }
53
59 void execute(Environment& environment) override {
60
61 // Prepare some variables.
62 const auto& f = environment.f;
63 const auto& V_A = environment.V_A;
64 const auto& t2 = environment.t2_amplitudes.back();
65
66 // Calculate the current correlation energy and push it to the environment.
67 const auto current_correlation_energy = QCModel::CCD<Scalar>::calculateCorrelationEnergy(f, V_A, t2);
68 environment.correlation_energies.push_back(current_correlation_energy);
69 }
70};
71
72
73} // namespace GQCP
Definition: CCDEnergyCalculation.hpp:35
_Scalar Scalar
Definition: CCDEnergyCalculation.hpp:38
void execute(Environment &environment) override
Definition: CCDEnergyCalculation.hpp:59
std::string description() const override
Definition: CCDEnergyCalculation.hpp:50
Definition: CCSDEnvironment.hpp:39
SquareRankFourTensor< Scalar > V_A
Definition: CCSDEnvironment.hpp:55
std::deque< T2Amplitudes< Scalar > > t2_amplitudes
Definition: CCSDEnvironment.hpp:49
SquareMatrix< Scalar > f
Definition: CCSDEnvironment.hpp:54
std::deque< Scalar > correlation_energies
Definition: CCSDEnvironment.hpp:46
static Scalar calculateCorrelationEnergy(const SquareMatrix< Scalar > &f, const SquareRankFourTensor< Scalar > &V_A, const T2Amplitudes< Scalar > &t2)
Definition: CCD.hpp:72
Definition: Step.hpp:37
Definition: BaseOneElectronIntegralBuffer.hpp:25