ERKALE
ERKALE - DFT from Hel
 All Classes Functions Variables Friends Pages
erichol.h
1 /*
2  * This source code is part of
3  *
4  * E R K A L E
5  * -
6  * HF/DFT from Hel
7  *
8  * Copyright © 2015 The Regents of the University of California
9  * All Rights Reserved
10  *
11  * Written by Susi Lehtola, Lawrence Berkeley National Laboratory
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  */
18 
19 #ifndef ERKALE_ERICHOL
20 #define ERKALE_ERICHOL
21 
22 #include "global.h"
23 #include "basis.h"
24 
26 class ERIchol {
28  size_t Nbf;
30  arma::uvec prodidx;
32  arma::umat invmap;
34  arma::umat prodmap;
36  arma::uvec odiagidx;
38  arma::mat B;
39 
41  double omega;
43  double alpha;
45  double beta;
46 
47  public:
49  ERIchol();
51  ~ERIchol();
52 
54  void set_range_separation(double w, double a, double b);
55  void get_range_separation(double & w, double & a, double & b) const;
56 
58  void load();
60  void save() const;
61 
63  size_t fill(const BasisSet & basis, double cholesky_tol, double shell_reuse_thr, double shell_screen_tol, bool verbose);
64 
66  size_t get_Naux() const;
68  size_t get_Nbf() const;
70  size_t get_Npairs() const;
71 
73  arma::mat get() const;
75  arma::umat get_invmap() const;
76 
78  arma::mat calcJ(const arma::mat & P) const;
80  arma::mat calcK(const arma::vec & C) const;
82  arma::mat calcK(const arma::mat & C, const std::vector<double> & occs) const;
83 
85  arma::cx_mat calcK(const arma::cx_vec & C) const;
87  arma::cx_mat calcK(const arma::cx_mat & C, const std::vector<double> & occs) const;
88 
90  void B_matrix(arma::mat & B) const;
92  arma::mat B_transform(const arma::mat & Cl, const arma::mat & Cr, bool verbose=false) const;
93 };
94 
95 #endif
arma::umat get_invmap() const
Get basis function numbers.
Definition: erichol.cpp:570
arma::mat B
Cholesky vectors, L x Nprod.
Definition: erichol.h:38
double beta
Fraction of short-range Coulomb.
Definition: erichol.h:45
double alpha
Fraction of full-range Coulomb.
Definition: erichol.h:43
arma::umat prodmap
Map to product index.
Definition: erichol.h:34
double omega
Range separation constant.
Definition: erichol.h:41
size_t get_Nbf() const
Get basis set size.
Definition: erichol.cpp:558
arma::umat invmap
Map to function indices, 2 x Nprod.
Definition: erichol.h:32
Cholesky decomposition of ERIs.
Definition: erichol.h:26
size_t Nbf
Amount of basis functions.
Definition: erichol.h:28
~ERIchol()
Destructor.
Definition: erichol.cpp:45
size_t get_Naux() const
Get amount of vectors.
Definition: erichol.cpp:554
arma::mat B_transform(const arma::mat &Cl, const arma::mat &Cr, bool verbose=false) const
Get transformed B matrix.
Definition: erichol.cpp:698
arma::mat calcK(const arma::vec &C) const
Form exchange matrix.
Definition: erichol.cpp:594
void load()
Load B matrix.
Definition: erichol.cpp:60
Basis set.
Definition: basis.h:187
void save() const
Save B matrix.
Definition: erichol.cpp:107
void B_matrix(arma::mat &B) const
Get full B matrix.
Definition: erichol.cpp:687
arma::uvec prodidx
Map of product indices in full space (for getting density subvector)
Definition: erichol.h:30
void set_range_separation(double w, double a, double b)
Set range separation.
Definition: erichol.cpp:48
size_t get_Npairs() const
Get basis set size.
Definition: erichol.cpp:562
arma::uvec odiagidx
List of off-diagonal products.
Definition: erichol.h:36
arma::mat calcJ(const arma::mat &P) const
Form Coulomb matrix.
Definition: erichol.cpp:574
size_t fill(const BasisSet &basis, double cholesky_tol, double shell_reuse_thr, double shell_screen_tol, bool verbose)
Fill matrix, returns amount of significant pairs.
Definition: erichol.cpp:163
ERIchol()
Constructor.
Definition: erichol.cpp:38