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
BasisPruner.h
Go to the documentation of this file.
1 
8 #ifndef SPARROW_BASISPRUNER_H
9 #define SPARROW_BASISPRUNER_H
10 #include "OrderedInput.h"
13 #include <Utils/Math/IterativeDiagonalizer/SpinAdaptedEigenContainer.h>
14 #include <vector>
15 
16 namespace Scine {
17 namespace Utils {
18 enum class SpinTransition;
19 class DipoleMatrix;
20 class Excitation;
21 } // namespace Utils
22 namespace Sparrow {
23 
30  int number;
31 };
32 
39  double threshold;
40 };
47  double threshold;
48 };
49 
79 template<Utils::Reference restrictedness>
80 class BasisPruner {
81  public:
82  using BoolVector = Eigen::Matrix<bool, -1, 1>;
83  BasisPruner(const OrderedInput<restrictedness>& input, std::shared_ptr<Eigen::MatrixXd> gammaMatrix,
84  std::shared_ptr<Eigen::VectorXd> spinConstants);
85 
103  auto prune(EnergyThreshold enThresh, PerturbativeThreshold ptThresh,
104  Utils::SpinTransition spinBlock = Utils::SpinTransition::Singlet) -> OrderedInput<restrictedness>;
105 
122  auto prune(NumberOfConfigurations nRoots, PerturbativeThreshold ptThresh,
123  Utils::SpinTransition spinBlock = Utils::SpinTransition::Singlet) -> OrderedInput<restrictedness>;
124 
128  auto getNumberOfRootsUnderThreshold() const -> int {
129  return nBasisFunctionsUnderThreshold_;
130  }
131 
138  auto prune(const LinearResponseCalculator::GuessSpecifier& matrixToPrune) const
139  -> std::shared_ptr<LinearResponseCalculator::GuessSpecifier>;
140 
141  private:
142  auto generatePruningInformation(EnergyThreshold enThresh, PerturbativeThreshold ptThresh, Utils::SpinTransition spinBlock)
143  -> void;
144  auto generatePruningInformation(NumberOfConfigurations nRoots, PerturbativeThreshold ptThresh,
145  Utils::SpinTransition spinBlock) -> void;
146  auto perturbativeCorrection(PerturbativeThreshold ptThresh, Utils::SpinTransition spinBlock) -> void;
147  auto assembleResult(Utils::SpinTransition spinBlock) -> OrderedInput<restrictedness>;
148  auto perturbationContributionVector(int nOfSecondary, Utils::SpinTransition spinBlock) -> Eigen::VectorXd;
149  auto generateEnergyWeightingMatrix(Utils::SpinTransition spinBlock);
150 
158  auto generatePerturbationMatrix(const Eigen::MatrixXd& primaryCharges, const Eigen::MatrixXd& secondaryCharges,
159  Utils::SpinTransition spinBlock) -> Eigen::MatrixXd;
160 
165  auto conditionalFillData(OrderedInput<restrictedness>& prunedData) const -> void;
166 
167  auto generateDiagonalCouplings(const Eigen::VectorXd& energies) -> Eigen::VectorXd;
168 
169  auto check(Utils::SpinTransition spinBlock) const -> void;
170 
171  std::shared_ptr<Eigen::MatrixXd> gammaMatrix_;
172  std::shared_ptr<Eigen::VectorXd> spinConstants_;
174  int nBasisFunctionsAfterPruning_;
175  int nBasisFunctionsUnderThreshold_;
176  BoolVector isIncluded_;
177 };
178 
179 } // namespace Sparrow
180 } // namespace Scine
181 #endif // SPARROW_BASISPRUNER_H
Strongly named double representing an energy threshold.Used in function signature to differentiate fr...
Definition: BasisPruner.h:38
Ordered input for the TDDFTB eigenvalue solver. Contains quantities in increasing energetic order...
Definition: OrderedInput.h:69
Definition: LinearResponseCalculator.h:17
auto getNumberOfRootsUnderThreshold() const -> int
Returns the number of &quot;primary&quot; configurations under the energy threshold.
Definition: BasisPruner.h:128
Strongly named double representing a perturbation threshold.Used in function signature to differentia...
Definition: BasisPruner.h:46
auto prune(EnergyThreshold enThresh, PerturbativeThreshold ptThresh, Utils::SpinTransition spinBlock=Utils::SpinTransition::Singlet) -> OrderedInput< restrictedness >
Function making the pruning of the space.
Definition: BasisPruner.cpp:27
Definition: BasisPruner.h:80
Strongly named int representing the number of electronic configurations.Used in return type to give s...
Definition: BasisPruner.h:29