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