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-2018 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 \
78  0 // compute F_lmax(T) and then iterate down to F_0(T)? Else use interpolation only
79 class Taylor_Fjt : public Fjt {
81  static double relative_zero_;
82 
83  public:
84  static const int max_interp_order = 8;
85 
86  Taylor_Fjt(size_t jmax, double accuracy);
87  virtual ~Taylor_Fjt();
89  double* values(int J, double T);
90 
91  private:
92  double** grid_; /* Table of "exact" Fm(T) values. Row index corresponds to
93  values of T (max_T+1 rows), column index to values
94  of m (max_m+1 columns) */
95  double delT_; /* The step size for T, depends on cutoff */
96  double oodelT_; /* 1.0 / delT_, see above */
97  double cutoff_; /* Tolerance cutoff used in all computations of Fm(T) */
98  int interp_order_; /* Order of (Taylor) interpolation */
99  int max_m_; /* Maximum value of m in the table, depends on cutoff
100  and the number of terms in Taylor interpolation */
101  int max_T_; /* Maximum index of T in the table, depends on cutoff
102  and m */
103  double* T_crit_; /* Maximum T for each row, depends on cutoff;
104  for a given m and T_idx <= max_T_idx[m] use Taylor interpolation,
105  for a given m and T_idx > max_T_idx[m] use the asymptotic formula */
106  double* F_; /* Here computed values of Fj(T) are stored */
107 };
108 
111 class FJT : public Fjt {
112  private:
113  double** gtable;
114 
115  int maxj;
116  double* denomarray;
119 
120  double* int_fjttable;
121 
122  int ngtable() const { return maxj + 7; }
123 
124  public:
125  FJT(int n);
126  virtual ~FJT();
128  double* values(int J, double T);
129 };
130 
131 class GaussianFundamental : public Fjt {
132  protected:
133  std::shared_ptr<CorrelationFactor> cf_;
134  double rho_;
135  double* value_;
136 
137  public:
138  GaussianFundamental(std::shared_ptr<CorrelationFactor> cf, int max);
139  virtual ~GaussianFundamental();
140 
141  virtual double* values(int J, double T) = 0;
142  void set_rho(double rho);
143 };
144 
149  public:
150  F12Fundamental(std::shared_ptr<CorrelationFactor> cf, int max);
151  virtual ~F12Fundamental();
152  double* values(int J, double T);
153 };
154 
159  public:
160  F12ScaledFundamental(std::shared_ptr<CorrelationFactor> cf, int max);
161  virtual ~F12ScaledFundamental();
162  double* values(int J, double T);
163 };
164 
166  public:
167  F12SquaredFundamental(std::shared_ptr<CorrelationFactor> cf, int max);
168  virtual ~F12SquaredFundamental();
169  double* values(int J, double T);
170 };
171 
173  private:
174  std::shared_ptr<FJT> Fm_;
175 
176  public:
177  F12G12Fundamental(std::shared_ptr<CorrelationFactor> cf, int max);
178  virtual ~F12G12Fundamental();
179  double* values(int J, double T);
180 };
181 
183  public:
184  F12DoubleCommutatorFundamental(std::shared_ptr<CorrelationFactor> cf, int max);
186  double* values(int J, double T);
187 };
188 
190  private:
191  double omega_;
192  std::shared_ptr<FJT> boys_;
193 
194  public:
195  ErfFundamental(double omega, int max);
196  virtual ~ErfFundamental();
197  double* values(int J, double T);
198  void setOmega(double omega) { omega_ = omega; }
199 };
200 
202  private:
203  double omega_;
204  std::shared_ptr<FJT> boys_;
205 
206  public:
207  ErfComplementFundamental(double omega, int max);
208  virtual ~ErfComplementFundamental();
209  double* values(int J, double T);
210  void setOmega(double omega) { omega_ = omega; }
211 };
212 
213 } // namespace psi
214 
215 #endif // header guard
216 
217 // Local Variables:
218 // mode: c++
219 // c-file-style: "CLJ"
220 // End:
double * values(int J, double T)
Implements Fjt::values()
Definition: fjt.cc:205
F12SquaredFundamental(std::shared_ptr< CorrelationFactor > cf, int max)
Definition: fjt.cc:615
double * values(int J, double T)
Definition: fjt.cc:620
virtual ~Taylor_Fjt()
Definition: fjt.cc:193
std::shared_ptr< FJT > Fm_
Definition: fjt.h:174
double rho_
Definition: fjt.h:134
virtual ~F12ScaledFundamental()
Definition: fjt.cc:581
F12ScaledFundamental(std::shared_ptr< CorrelationFactor > cf, int max)
Definition: fjt.cc:578
virtual ~Fjt()
Definition: fjt.cc:84
Fjt()
Definition: fjt.cc:83
F12Fundamental(std::shared_ptr< CorrelationFactor > cf, int max)
Definition: fjt.cc:543
Definition: fjt.h:148
double * values(int J, double T)
Definition: fjt.cc:751
int max_T_
Definition: fjt.h:101
virtual ~FJT()
Definition: fjt.cc:401
double wval_infinity
Definition: fjt.h:117
void setOmega(double omega)
Definition: fjt.h:210
double * values(int J, double T)
Definition: fjt.cc:547
int max_m_
Definition: fjt.h:99
double omega_
Definition: fjt.h:203
virtual void set_rho(double)
Definition: fjt.h:73
Definition: fjt.h:158
virtual ~F12Fundamental()
Definition: fjt.cc:545
double ** gtable
Definition: fjt.h:113
int ngtable() const
Definition: fjt.h:122
static double relative_zero_
Definition: fjt.h:81
F12G12Fundamental(std::shared_ptr< CorrelationFactor > cf, int max)
Definition: fjt.cc:651
double omega_
Definition: fjt.h:191
#define max(a, b)
Definition: svd.cc:38
double * values(int J, double T)
Definition: fjt.cc:705
int * T
Definition: stringlist.cc:66
GaussianFundamental(std::shared_ptr< CorrelationFactor > cf, int max)
Definition: fjt.cc:525
Definition: fjt.h:172
Evaluates the Boys function F_j(T)
Definition: fjt.h:64
std::shared_ptr< FJT > boys_
Definition: fjt.h:204
double * int_fjttable
Definition: fjt.h:120
double * T_crit_
Definition: fjt.h:103
std::shared_ptr< FJT > boys_
Definition: fjt.h:192
void set_rho(double rho)
Definition: fjt.cc:537
double * values(int J, double T)
Definition: fjt.cc:657
double ** grid_
Definition: fjt.h:92
F12DoubleCommutatorFundamental(std::shared_ptr< CorrelationFactor > cf, int max)
Definition: fjt.cc:700
virtual ~F12DoubleCommutatorFundamental()
Definition: fjt.cc:703
double * denomarray
Definition: fjt.h:116
double * values(int J, double T)
Definition: fjt.cc:784
double * value_
Definition: fjt.h:135
ErfFundamental(double omega, int max)
Definition: fjt.cc:743
int itable_infinity
Definition: fjt.h:118
std::shared_ptr< CorrelationFactor > cf_
Definition: fjt.h:133
Definition: fjt.h:201
virtual ~GaussianFundamental()
Definition: fjt.cc:535
double * F_
Definition: fjt.h:106
int maxj
Definition: fjt.h:115
virtual ~ErfComplementFundamental()
Definition: fjt.cc:782
virtual ~F12SquaredFundamental()
Definition: fjt.cc:618
Definition: fjt.h:131
static const int max_interp_order
Definition: fjt.h:84
virtual double * values(int J, double T)=0
Definition: fjt.h:165
FJT(int n)
Definition: fjt.cc:342
double * values(int J, double T)
implementation of Fjt::values()
Definition: fjt.cc:414
double cutoff_
Definition: fjt.h:97
double oodelT_
Definition: fjt.h:96
Definition: fjt.h:189
ErfComplementFundamental(double omega, int max)
Definition: fjt.cc:775
int interp_order_
Definition: fjt.h:98
virtual ~ErfFundamental()
Definition: fjt.cc:749
double * values(int J, double T)
Definition: fjt.cc:583
void setOmega(double omega)
Definition: fjt.h:198
double delT_
Definition: fjt.h:95
Definition: fjt.h:111
virtual ~F12G12Fundamental()
Definition: fjt.cc:655
virtual double * values(int J, double T)=0
Taylor_Fjt(size_t jmax, double accuracy)
Definition: fjt.cc:92