ERKALE
ERKALE - DFT from Hel
 All Classes Functions Variables Friends Pages
eritable.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 
17 #include "global.h"
18 #include "basis.h"
19 
20 #ifndef ERKALE_ERITABLE
21 #define ERKALE_ERITABLE
22 
23 // Debug usage of ERIs?
24 //#define CHECKFILL
25 
26 #include <armadillo>
27 #include <cfloat>
28 #include <vector>
29 // Forward declaration
30 class BasisSet;
31 
44 class ERItable {
45  protected:
47  std::vector<eripair_t> shpairs;
49  arma::mat screen;
51  std::vector<double> ints;
53  std::vector<size_t> shoff;
54 
56  double omega;
58  double alpha;
60  double beta;
61 
63  size_t offset(size_t ip, size_t jp) const;
64 
65  public:
67  ERItable();
69  ~ERItable();
70 
72  void set_range_separation(double omega, double alpha, double beta);
74  void get_range_separation(double & omega, double & alpha, double & beta) const;
75 
77  size_t fill(const BasisSet * basis, double thr);
78 
80  size_t N_ints(const BasisSet * basis, double thr);
81 
83  void print() const;
84 
86  size_t get_N() const;
87 
89  arma::mat calcJ(const arma::mat & P) const;
91  arma::mat calcK(const arma::mat & P) const;
93  arma::cx_mat calcK(const arma::cx_mat & P) const;
94 };
95 
96 #endif
size_t N_ints(const BasisSet *basis, double thr)
Compute number of integrals.
Definition: eritable.cpp:59
std::vector< double > ints
Table of integrals.
Definition: eritable.h:51
arma::mat calcK(const arma::mat &P) const
Form exchange matrix.
Definition: eritable.cpp:128
arma::mat calcJ(const arma::mat &P) const
Form Coulomb matrix.
Definition: eritable.cpp:100
void get_range_separation(double &omega, double &alpha, double &beta) const
Get range separation.
Definition: eritable.cpp:53
size_t offset(size_t ip, size_t jp) const
Calculate offset in integrals table.
Definition: eritable.cpp:90
size_t fill(const BasisSet *basis, double thr)
Fill table, return amount of significant shell pairs.
Definition: eritable.cpp:186
void set_range_separation(double omega, double alpha, double beta)
Set range separation.
Definition: eritable.cpp:47
double alpha
Fraction of long-range (i.e. exact) exchange.
Definition: eritable.h:58
~ERItable()
Destructor.
Definition: eritable.cpp:44
std::vector< eripair_t > shpairs
Integral pairs sorted by value.
Definition: eritable.h:47
void print() const
Print ERI table.
ERItable()
Constructor.
Definition: eritable.cpp:38
double omega
Range separation parameter.
Definition: eritable.h:56
arma::mat screen
Screening matrix.
Definition: eritable.h:49
Table of electron repulsion integrals.
Definition: eritable.h:44
Basis set.
Definition: basis.h:187
size_t get_N() const
Get size of ERI table.
Definition: eritable.cpp:86
double beta
Fraction of short-range exchange.
Definition: eritable.h:60
std::vector< size_t > shoff
Offset lookup.
Definition: eritable.h:53