ERKALE
ERKALE - DFT from Hel
 All Classes Functions Variables Friends Pages
eriscreen.h
1 /*
2  * This source code is part of
3  *
4  * E R K A L E
5  * -
6  * DFT from Hel
7  *
8  * Written by Susi Lehtola, 2010-2011
9  * Copyright (c) 2010-2011, Susi Lehtola
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  */
16 
32 #ifndef ERKALE_ERISCREEN
33 #define ERKALE_ERISCREEN
34 
35 class IntegralDigestor;
36 class ForceDigestor;
37 #include "global.h"
38 #include <armadillo>
39 #include <vector>
40 
41 // Forward declaration
42 class BasisSet;
43 struct eripair_t;
44 
46 class ERIscreen {
48  arma::mat screen;
50  std::vector<eripair_t> shpairs;
51 
53  const BasisSet * basp;
55  std::vector<size_t> iidx;
56 
58  double omega;
60  double alpha;
62  double beta;
63 
65  void calculate(std::vector< std::vector<IntegralDigestor *> > & digest, double tol) const;
67  arma::vec calculate_force(std::vector< std::vector<ForceDigestor *> > & digest, double tol) const;
68 
69  public:
71  ERIscreen();
73  ~ERIscreen();
74 
76  size_t get_N() const;
77 
79  void set_range_separation(double omega, double alpha, double beta);
81  void get_range_separation(double & omega, double & alpha, double & beta) const;
82 
84  size_t fill(const BasisSet * basis, double shtol, bool verbose=true);
85 
87  arma::mat calcJ(const arma::mat & P, double tol) const;
89  std::vector<arma::cx_mat> calcJK(const std::vector<arma::cx_mat> & P, double jfrac, double kfrac, double tol) const;
90 
92  arma::mat calcK(const arma::mat & P, double tol) const;
94  arma::cx_mat calcK(const arma::cx_mat & P, double tol) const;
96  void calcK(const arma::mat & Pa, const arma::mat & Pb, arma::mat & Ka, arma::mat & Kb, double tol) const;
98  void calcK(const arma::cx_mat & Pa, const arma::cx_mat & Pb, arma::cx_mat & Ka, arma::cx_mat & Kb, double tol) const;
99 
101  void calcJK(const arma::mat & P, arma::mat & J, arma::mat & K, double tol) const;
103  void calcJK(const arma::cx_mat & P, arma::mat & J, arma::cx_mat & K, double tol) const;
105  void calcJK(const arma::mat & Pa, const arma::mat & Pb, arma::mat & J, arma::mat & Ka, arma::mat & Kb, double tol) const;
107  void calcJK(const arma::cx_mat & Pa, const arma::cx_mat & Pb, arma::mat & J, arma::cx_mat & Ka, arma::cx_mat & Kb, double tol) const;
108 
109  /* Force calculation */
110 
112  arma::vec forceJ(const arma::mat & P, double tol) const;
114  arma::vec forceK(const arma::mat & P, double tol, double kfrac) const;
116  arma::vec forceK(const arma::mat & Pa, const arma::mat & Pb, double tol, double kfrac) const;
118  arma::vec forceJK(const arma::mat & P, double tol, double kfrac) const;
120  arma::vec forceJK(const arma::mat & Pa, const arma::mat & Pb, double tol, double kfrac) const;
121 };
122 
123 #include "basis.h"
124 
125 #endif
void get_range_separation(double &omega, double &alpha, double &beta) const
Get range separation.
Definition: eriscreen.cpp:75
double beta
Fraction of short-range exchange.
Definition: eriscreen.h:62
arma::vec forceK(const arma::mat &P, double tol, double kfrac) const
Calculate exchange force with tolerance tol for integrals.
Definition: eriscreen.cpp:649
const BasisSet * basp
Pointer to the used basis set.
Definition: eriscreen.h:53
arma::mat calcK(const arma::mat &P, double tol) const
Calculate exchange matrix with tolerance tol for integrals.
Definition: eriscreen.cpp:282
void set_range_separation(double omega, double alpha, double beta)
Set range separation.
Definition: eriscreen.cpp:69
Helper for integral sorts.
Definition: basis.h:109
std::vector< size_t > iidx
Index helper.
Definition: eriscreen.h:55
double alpha
Fraction of long-range exchange.
Definition: eriscreen.h:60
Screening of electron repulsion integrals.
Definition: eriscreen.h:46
~ERIscreen()
Destructor.
Definition: eriscreen.cpp:62
size_t get_N() const
Get amount of basis functions.
Definition: eriscreen.cpp:65
arma::vec forceJK(const arma::mat &P, double tol, double kfrac) const
Calculate Coulomb and exchange forces at the same time with tolerance tol for integrals.
Definition: eriscreen.cpp:707
ERIscreen()
Constructor.
Definition: eriscreen.cpp:55
arma::vec calculate_force(std::vector< std::vector< ForceDigestor * > > &digest, double tol) const
Run force calculation with given digestor.
Definition: eriscreen.cpp:154
arma::mat screen
Prescreening table of shell integrals.
Definition: eriscreen.h:48
Basis set.
Definition: basis.h:187
Force digestor.
Definition: eri_digest.h:89
double omega
Range separation parameter.
Definition: eriscreen.h:58
arma::vec forceJ(const arma::mat &P, double tol) const
Calculate Coulomb force with tolerance tol for integrals.
Definition: eriscreen.cpp:621
std::vector< arma::cx_mat > calcJK(const std::vector< arma::cx_mat > &P, double jfrac, double kfrac, double tol) const
Calculate set of Coulomb and exchange matrices with tolerance tol for integrals (for PZ-SIC) ...
Definition: eriscreen.cpp:564
size_t fill(const BasisSet *basis, double shtol, bool verbose=true)
Form screening matrix, return amount of significant shell pairs.
Definition: eriscreen.cpp:81
Integral digestor.
Definition: eri_digest.h:24
std::vector< eripair_t > shpairs
Integral pairs sorted by value.
Definition: eriscreen.h:50
arma::mat calcJ(const arma::mat &P, double tol) const
Calculate Coulomb matrix with tolerance tol for integrals.
Definition: eriscreen.cpp:249
void calculate(std::vector< std::vector< IntegralDigestor * > > &digest, double tol) const
Run calculation with given digestor.
Definition: eriscreen.cpp:97