Scine::Sparrow  5.0.0
Library for fast and agile quantum chemical calculations with semiempirical methods.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
ScfFock.h
Go to the documentation of this file.
1 
8 #ifndef SPARROW_DFTB_SCFFOCK_H
9 #define SPARROW_DFTB_SCFFOCK_H
10 
11 #include "DFTBCommon.h"
12 #include "SDFTB.h"
14 #include <Utils/Typenames.h>
15 #include <Eigen/Core>
16 #include <vector>
17 
18 namespace Scine {
19 namespace Utils {
20 class AtomsOrbitalsIndexes;
21 class DensityMatrix;
22 class AdditiveElectronicContribution;
23 } // namespace Utils
24 
25 namespace Sparrow {
26 
27 namespace dftb {
28 class ZeroOrderMatricesCalculator;
29 
34  public:
35  explicit ScfFock(ZeroOrderMatricesCalculator& matricesCalculator, const Utils::ElementTypeCollection& elements,
36  const Utils::PositionCollection& positions, const DFTBCommon::AtomicParameterContainer& atomicPar,
37  const DFTBCommon::DiatomicParameterContainer& diatomicPar, const Utils::DensityMatrix& densityMatrix,
38  const Eigen::MatrixXd& energyWeightedDensityMatrix, std::vector<double>& atomicCharges,
39  const std::vector<double>& coreCharges, const Utils::AtomsOrbitalsIndexes& aoIndexes,
40  const Eigen::MatrixXd& overlapMatrix, const bool& unrestrictedCalculationRunning);
41 
42  void initialize() override;
43  void calculateDensityDependentPart(Utils::DerivativeOrder order) override;
44  void calculateDensityIndependentPart(Utils::DerivativeOrder order) override;
45  Utils::SpinAdaptedMatrix getMatrix() const override;
46  void finalize(Utils::DerivativeOrder order) override;
47 
52  void addDensityDependentElectronicContribution(std::shared_ptr<Utils::AdditiveElectronicContribution> contribution) final;
57  void addDensityIndependentElectronicContribution(std::shared_ptr<Utils::AdditiveElectronicContribution> contribution) final;
58 
59  protected:
60  int getNumberAtoms() const;
61  void populationAnalysis();
63  void addDerivatives(Utils::AutomaticDifferentiation::DerivativeContainerType<Utils::Derivative::First>& derivatives) const override;
64  void addDerivatives(Utils::AutomaticDifferentiation::DerivativeContainerType<Utils::Derivative::SecondAtomic>& derivatives) const override;
65  void addDerivatives(Utils::AutomaticDifferentiation::DerivativeContainerType<Utils::Derivative::SecondFull>& derivatives) const override;
66  ZeroOrderMatricesCalculator& zeroOrderMatricesCalculator_;
67  const Utils::ElementTypeCollection& elements_;
68  const Utils::PositionCollection& positions_;
69  const DFTBCommon::AtomicParameterContainer& atomicPar_;
70  const DFTBCommon::DiatomicParameterContainer& diatomicPar_;
71  const Utils::DensityMatrix& densityMatrix_;
72  const Eigen::MatrixXd& energyWeightedDensityMatrix_;
73  std::vector<double>& atomicCharges_;
74  const std::vector<double>& coreCharges_;
75  const Utils::AtomsOrbitalsIndexes& aoIndexes_;
76  const Eigen::MatrixXd& overlapMatrix_;
77  const bool& unrestrictedCalculationRunning_;
78 
79  SDFTB spinDFTB;
80  Eigen::MatrixXd HXoverS_;
81  Eigen::MatrixXd H0_;
82  Eigen::MatrixXd correctionToFock;
83  std::vector<std::shared_ptr<Utils::AdditiveElectronicContribution>> densityDependentContributions_,
84  densityIndependentContributions_;
85 
86  private:
87  virtual void completeH() = 0;
88  virtual void constructG(Utils::DerivativeOrder order) = 0;
89 };
90 
91 inline int ScfFock::getNumberAtoms() const {
92  return elements_.size();
93 }
94 
95 } // namespace dftb
96 
97 } // namespace Sparrow
98 } // namespace Scine
99 #endif // SPARROW_DFTB_SCFFOCK_H
void addDerivatives(Utils::AutomaticDifferentiation::DerivativeContainerType< Utils::Derivative::First > &derivatives) const override
adds the derivatives for the first, second atomic and second full types.
Definition: ScfFock.cpp:113
void addDensityIndependentElectronicContribution(std::shared_ptr< Utils::AdditiveElectronicContribution > contribution) final
Definition: ScfFock.cpp:109
Definition: SDFTB.h:29
void addDensityDependentElectronicContribution(std::shared_ptr< Utils::AdditiveElectronicContribution > contribution) final
Definition: ScfFock.cpp:105
This class calculates the matrices resulting from the zeroth order expansion of the DFT energy for th...
Definition: ZeroOrderMatricesCalculator.h:32
Definition: ScfFock.h:33