Psi4
fjt.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Psi4: an open-source quantum chemistry software package
5  *
6  * Copyright (c) 2007-2017 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This file is part of Psi4.
12  *
13  * Psi4 is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser General Public License as published by
15  * the Free Software Foundation, version 3.
16  *
17  * Psi4 is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License along
23  * with Psi4; if not, write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25  *
26  * @END LICENSE
27  */
28 
29 //
30 // fjt.h
31 //
32 // Copyright (C) 2001 Edward Valeev
33 //
34 // Author: Edward Valeev <evaleev@vt.edu>
35 // Maintainer: EV
36 //
37 // This file is part of the SC Toolkit.
38 //
39 // The SC Toolkit is free software; you can redistribute it and/or modify
40 // it under the terms of the GNU Library General Public License as published by
41 // the Free Software Foundation; either version 2, or (at your option)
42 // any later version.
43 //
44 // The SC Toolkit is distributed in the hope that it will be useful,
45 // but WITHOUT ANY WARRANTY; without even the implied warranty of
46 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
47 // GNU Library General Public License for more details.
48 //
49 // You should have received a copy of the GNU General Public License along
50 // with this program; if not, write to the Free Software Foundation, Inc.,
51 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
52 //
53 // The U.S. Government is granted a limited license as per AL 91-7.
54 //
55 
56 #ifndef _chemistry_qc_basis_fjt_h
57 #define _chemistry_qc_basis_fjt_h
58 
59 namespace psi {
60 
61 class CorrelationFactor;
62 
64 class Fjt {
65 public:
66  Fjt();
67  virtual ~Fjt();
72  virtual double *values(int J, double T) =0;
73  virtual void set_rho(double /*rho*/) { }
74 };
75 
76 #define TAYLOR_INTERPOLATION_ORDER 6
77 #define TAYLOR_INTERPOLATION_AND_RECURSION 0 // compute F_lmax(T) and then iterate down to F_0(T)? Else use interpolation only
78 class Taylor_Fjt : public Fjt {
80  static double relative_zero_;
81 public:
82  static const int max_interp_order = 8;
83 
84  Taylor_Fjt(unsigned int jmax, double accuracy);
85  virtual ~Taylor_Fjt();
87  double *values(int J, double T);
88 private:
89  double **grid_; /* Table of "exact" Fm(T) values. Row index corresponds to
90  values of T (max_T+1 rows), column index to values
91  of m (max_m+1 columns) */
92  double delT_; /* The step size for T, depends on cutoff */
93  double oodelT_; /* 1.0 / delT_, see above */
94  double cutoff_; /* Tolerance cutoff used in all computations of Fm(T) */
95  int interp_order_; /* Order of (Taylor) interpolation */
96  int max_m_; /* Maximum value of m in the table, depends on cutoff
97  and the number of terms in Taylor interpolation */
98  int max_T_; /* Maximum index of T in the table, depends on cutoff
99  and m */
100  double *T_crit_; /* Maximum T for each row, depends on cutoff;
101  for a given m and T_idx <= max_T_idx[m] use Taylor interpolation,
102  for a given m and T_idx > max_T_idx[m] use the asymptotic formula */
103  double *F_; /* Here computed values of Fj(T) are stored */
104 };
105 
108 class FJT: public Fjt {
109 private:
110  double **gtable;
111 
112  int maxj;
113  double *denomarray;
116 
117  double *int_fjttable;
118 
119  int ngtable() const { return maxj + 7; }
120 public:
121  FJT(int n);
122  virtual ~FJT();
124  double *values(int J, double T);
125 };
126 
127 class GaussianFundamental : public Fjt {
128 protected:
129  std::shared_ptr<CorrelationFactor> cf_;
130  double rho_;
131  double* value_;
132 
133 public:
134  GaussianFundamental(std::shared_ptr<CorrelationFactor> cf, int max);
135  virtual ~GaussianFundamental();
136 
137  virtual double* values(int J, double T) = 0;
138  void set_rho(double rho);
139 };
140 
145 public:
146  F12Fundamental(std::shared_ptr<CorrelationFactor> cf, int max);
147  virtual ~F12Fundamental();
148  double* values(int J, double T);
149 };
150 
155 public:
156  F12ScaledFundamental(std::shared_ptr<CorrelationFactor> cf, int max);
157  virtual ~F12ScaledFundamental();
158  double* values(int J, double T);
159 };
160 
162 public:
163  F12SquaredFundamental(std::shared_ptr<CorrelationFactor> cf, int max);
164  virtual ~F12SquaredFundamental();
165  double* values(int J, double T);
166 };
167 
169 private:
170  std::shared_ptr<FJT> Fm_;
171 public:
172  F12G12Fundamental(std::shared_ptr<CorrelationFactor> cf, int max);
173  virtual ~F12G12Fundamental();
174  double* values(int J, double T);
175 };
176 
178 public:
179  F12DoubleCommutatorFundamental(std::shared_ptr<CorrelationFactor> cf, int max);
181  double* values(int J, double T);
182 };
183 
185 private:
186  double omega_;
187  std::shared_ptr<FJT> boys_;
188 public:
189  ErfFundamental(double omega, int max);
190  virtual ~ErfFundamental();
191  double* values(int J, double T);
192  void setOmega(double omega) { omega_ = omega; }
193 };
194 
196 private:
197  double omega_;
198  std::shared_ptr<FJT> boys_;
199 public:
200  ErfComplementFundamental(double omega, int max);
201  virtual ~ErfComplementFundamental();
202  double* values(int J, double T);
203  void setOmega(double omega) { omega_ = omega; }
204 };
205 
206 } // end of namespace sc
207 
208 #endif // header guard
209 
210 // Local Variables:
211 // mode: c++
212 // c-file-style: "CLJ"
213 // End:
double * values(int J, double T)
Implements Fjt::values()
Definition: fjt.cc:209
F12SquaredFundamental(std::shared_ptr< CorrelationFactor > cf, int max)
Definition: fjt.cc:649
double * values(int J, double T)
Definition: fjt.cc:660
virtual ~Taylor_Fjt()
Definition: fjt.cc:195
std::shared_ptr< FJT > Fm_
Definition: fjt.h:170
double rho_
Definition: fjt.h:130
virtual ~F12ScaledFundamental()
Definition: fjt.cc:610
F12ScaledFundamental(std::shared_ptr< CorrelationFactor > cf, int max)
Definition: fjt.cc:604
Taylor_Fjt(unsigned int jmax, double accuracy)
Definition: fjt.cc:88
virtual ~Fjt()
Definition: fjt.cc:80
Fjt()
Definition: fjt.cc:79
F12Fundamental(std::shared_ptr< CorrelationFactor > cf, int max)
Definition: fjt.cc:560
Definition: fjt.h:144
double * values(int J, double T)
Definition: fjt.cc:810
int max_T_
Definition: fjt.h:98
virtual ~FJT()
Definition: fjt.cc:405
double wval_infinity
Definition: fjt.h:114
void setOmega(double omega)
Definition: fjt.h:203
double * values(int J, double T)
Definition: fjt.cc:571
int max_m_
Definition: fjt.h:96
double omega_
Definition: fjt.h:197
virtual void set_rho(double)
Definition: fjt.h:73
Definition: fjt.h:154
virtual ~F12Fundamental()
Definition: fjt.cc:566
double ** gtable
Definition: fjt.h:110
int ngtable() const
Definition: fjt.h:119
static double relative_zero_
Definition: fjt.h:80
F12G12Fundamental(std::shared_ptr< CorrelationFactor > cf, int max)
Definition: fjt.cc:693
double omega_
Definition: fjt.h:186
#define max(a, b)
Definition: svd.cc:39
double * values(int J, double T)
Definition: fjt.cc:758
GaussianFundamental(std::shared_ptr< CorrelationFactor > cf, int max)
Definition: fjt.cc:535
Definition: fjt.h:168
Evaluates the Boys function F_j(T)
Definition: fjt.h:64
std::shared_ptr< FJT > boys_
Definition: fjt.h:198
double * int_fjttable
Definition: fjt.h:117
double * T_crit_
Definition: fjt.h:100
std::shared_ptr< FJT > boys_
Definition: fjt.h:187
void set_rho(double rho)
Definition: fjt.cc:551
double * values(int J, double T)
Definition: fjt.cc:704
double ** grid_
Definition: fjt.h:89
F12DoubleCommutatorFundamental(std::shared_ptr< CorrelationFactor > cf, int max)
Definition: fjt.cc:749
virtual ~F12DoubleCommutatorFundamental()
Definition: fjt.cc:754
double * denomarray
Definition: fjt.h:113
double * values(int J, double T)
Definition: fjt.cc:848
double * value_
Definition: fjt.h:131
ErfFundamental(double omega, int max)
Definition: fjt.cc:798
int itable_infinity
Definition: fjt.h:115
std::shared_ptr< CorrelationFactor > cf_
Definition: fjt.h:129
Definition: fjt.h:195
virtual ~GaussianFundamental()
Definition: fjt.cc:546
double * F_
Definition: fjt.h:103
int maxj
Definition: fjt.h:112
virtual ~ErfComplementFundamental()
Definition: fjt.cc:844
virtual ~F12SquaredFundamental()
Definition: fjt.cc:655
Definition: fjt.h:127
static const int max_interp_order
Definition: fjt.h:82
virtual double * values(int J, double T)=0
Definition: fjt.h:161
FJT(int n)
Definition: fjt.cc:344
double * values(int J, double T)
implementation of Fjt::values()
Definition: fjt.cc:420
double cutoff_
Definition: fjt.h:94
double oodelT_
Definition: fjt.h:93
Definition: fjt.h:184
ErfComplementFundamental(double omega, int max)
Definition: fjt.cc:836
int interp_order_
Definition: fjt.h:95
virtual ~ErfFundamental()
Definition: fjt.cc:806
double * values(int J, double T)
Definition: fjt.cc:615
void setOmega(double omega)
Definition: fjt.h:192
double delT_
Definition: fjt.h:92
Definition: fjt.h:108
virtual ~F12G12Fundamental()
Definition: fjt.cc:699
virtual double * values(int J, double T)=0
Definition: PsiFileImpl.h:40