Psi4
gshell.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 #ifndef _psi_src_lib_libmints_gshell_h_
30 #define _psi_src_lib_libmints_gshell_h_
31 
32 #include <cstdio>
33 #include <vector>
34 #include "psi4/libmints/vector3.h"
35 
36 namespace psi {
37 
38 class Vector3;
39 
43 };
44 
46  Cartesian = 0,
47  Pure = 1
48 };
49 
50 enum ShellType {
51  Gaussian = 0,
52  ECPType1 = 1,
54 };
55 
62 class ShellInfo
63 {
64 protected:
66  int l_;
68  int puream_;
70  std::vector<double> exp_;
72  std::vector<double> coef_;
74  std::vector<int> n_;
76  std::vector<double> erd_coef_;
79  std::vector<double> original_coef_;
82 
89 
94  double primitive_normalization(int p);
98 
100  static const char *amtypes;
102  static const char *AMTYPES;
103 
104 public:
111  ShellInfo(int am,
112  const std::vector<double>& c,
113  const std::vector<double>& e,
114  const std::vector<int>& n);
115 
123  ShellInfo(int am,
124  const std::vector<double>& c,
125  const std::vector<double>& e,
126  GaussianType pure,
128 
130  void normalize_shell();
131  void erd_normalize_shell();
132 
134  ShellType shell_type() const { return shelltype_; }
136  int nprimitive() const;
138  int nfunction() const;
140  int ncartesian() const { return ncartesian_; }
142  int am() const { return l_; }
144  char amchar() const { return amtypes[l_]; }
146  char AMCHAR() const { return AMTYPES[l_]; }
148  bool is_cartesian() const { return !puream_; }
150  bool is_pure() const { return puream_; }
152  double exp(int prim) const { return exp_[prim]; }
154  double coef(int pi) const { return coef_[pi]; }
156  int nval(int pi) const { return n_[pi]; }
158  double erd_coef(int pi) const { return erd_coef_[pi]; }
160  double original_coef(int pi) const { return original_coef_[pi]; }
162  const std::vector<double>& exps() const { return exp_; }
164  const std::vector<double>& coefs() const { return coef_; }
166  const std::vector<double>& original_coefs() const { return original_coef_; }
167 
169  void print(std::string out) const;
170 
172  static double normalize(int l, int m, int n);
173 
175  bool operator==(const ShellInfo& RHS)const;
176 
178  bool operator!=(const ShellInfo& RHS)const
179  {
180  return !(*this==RHS);
181  }
182 };
183 
184 
190 {
191 protected:
193  int l_;
195  int puream_;
197  const double* exp_;
199  const double* original_coef_;
201  const double* coef_;
203  const double* erd_coef_;
205  const int* n_;
206 
210  int nc_;
212  const double *center_;
214  int start_;
215 
224 
229  double primitive_normalization(int p);
233 
235  static const char *amtypes;
237  static const char *AMTYPES;
238 
239 public:
253  GaussianShell(ShellType shelltype,
254  int am,
255  int nprimitive,
256  const double *oc,
257  const double *c, const double *ec,
258  const double *e,
259  GaussianType pure,
260  int nc,
261  const double* center,
262  int start);
263 
274  GaussianShell(ShellType shelltype,
275  int am,
276  int nprimitive,
277  const double *c,
278  const double *e,
279  const int *n,
280  int nc,
281  const double* center);
284 
286  ShellType shell_type() const { return shelltype_; }
288  int nprimitive() const;
290  int nfunction() const;
292  int ncartesian() const { return ncartesian_; }
294  int am() const { return l_; }
296  char amchar() const { return amtypes[l_]; }
298  char AMCHAR() const { return AMTYPES[l_]; }
300  bool is_cartesian() const { return !puream_; }
302  bool is_pure() const { return puream_; }
303 
305  const double* center() const;
307  int ncenter() const { return nc_; }
309  int start() const { return start_; }
310 
312  double exp(int prim) const { return exp_[prim]; }
314  double coef(int pi) const { return coef_[pi]; }
316  double original_coef(int pi) const { return original_coef_[pi]; }
318  int nval(int pi) const { return n_[pi]; }
320  double erd_coef(int pi) const { return erd_coef_[pi]; }
322  const double* exps() const { return exp_; }
324  const double* coefs() const { return coef_; }
326  const double* original_coefs() const { return original_coef_; }
328  const double* erd_coefs() const { return erd_coef_; }
329 
331  void print(std::string out) const;
332 
334  int function_index() const { return start_; }
335  void set_function_index(int i) { start_ = i; }
336  double evaluate(double r, int l) const;
337 };
338 
339 }
340 
341 #endif
This class has the same behavior as GaussianShell, but implements everything using slower data struct...
Definition: gshell.h:62
int puream_
Flag for pure angular momentum.
Definition: gshell.h:195
int ncartesian_
How many cartesian functions? (1=s, 3=p, 6=d, ...)
Definition: gshell.h:217
double coef(int pi) const
Return coefficient of pi&#39;th primitive.
Definition: gshell.h:154
ShellType
Definition: gshell.h:50
static double normalize(int l, int m, int n)
Normalize the angular momentum component.
Definition: gshell.cc:177
std::vector< int > n_
R exponents, for ECP basis sets (of length nprimitives_)
Definition: gshell.h:74
std::vector< double > coef_
Contraction coefficients (of length nprimitives_)
Definition: gshell.h:72
double original_coef(int pi) const
Return unnormalized coefficient of pi&#39;th primitive.
Definition: gshell.h:316
void print(std::string out) const
Print out the shell.
Definition: gshell.cc:163
void contraction_normalization()
const double * coefs() const
Return coefficients.
Definition: gshell.h:324
const double * center() const
Returns the center of the Molecule this shell is on.
Definition: gshell.cc:263
const double * coef_
Contraction coefficients (of length nprimitives_)
Definition: gshell.h:201
int nfunction() const
Total number of basis functions.
Definition: gshell.cc:221
bool operator!=(const ShellInfo &RHS) const
True if any part of the two ShellInfo instances is unequal.
Definition: gshell.h:178
void erd_normalize_shell()
Definition: gshell.cc:90
ShellType shelltype_
The type of shell this object encodes.
Definition: gshell.h:81
Definition: gshell.h:53
double exp(int prim) const
Returns the exponent of the given primitive.
Definition: gshell.h:152
int function_index() const
Basis function index where this shell starts.
Definition: gshell.h:334
Definition: pointgrp.h:106
bool operator==(const ShellInfo &RHS) const
True if two ShellInfo instances are exactly equal.
Definition: gshell.cc:187
int am() const
The angular momentum of the given contraction.
Definition: gshell.h:294
void contraction_normalization()
Definition: gshell.cc:117
int nfunction_
Definition: gshell.h:88
void normalize_shell()
Definition: gshell.cc:142
bool is_pure() const
Returns true if contraction is pure.
Definition: gshell.h:302
int puream_
Flag for pure angular momentum.
Definition: gshell.h:68
static const char * amtypes
Definition: gshell.h:235
bool is_cartesian() const
Returns true if contraction is Cartesian.
Definition: gshell.h:300
bool is_pure() const
Returns true if contraction is pure.
Definition: gshell.h:150
int start_
First basis function in this shell.
Definition: gshell.h:214
char AMCHAR() const
The character symbol for the angular momentum of the given contraction (upper case) ...
Definition: gshell.h:146
int am() const
The angular momentum of the given contraction.
Definition: gshell.h:142
const double * erd_coefs() const
Return ERD normalized coefficients.
Definition: gshell.h:328
double primitive_normalization(int p)
Definition: gshell.h:46
double erd_coef(int pi) const
Return unnormalized coefficient of pi&#39;th primitive.
Definition: gshell.h:320
ShellType shell_type() const
The type of shell this object encodes information for.
Definition: gshell.h:286
static const char * AMTYPES
Definition: gshell.h:102
const std::vector< double > & exps() const
Returns the exponent of the given primitive.
Definition: gshell.h:162
Definition: gshell.h:52
int ncenter() const
Returns the atom number this shell is on. Used by integral derivatives for indexing.
Definition: gshell.h:307
Definition: gshell.h:41
const std::vector< double > & original_coefs() const
Return unnormalized coefficient of pi&#39;th primitive and ci&#39;th contraction.
Definition: gshell.h:166
Definition: gshell.h:47
std::vector< double > original_coef_
Definition: gshell.h:79
char amchar() const
The character symbol for the angular momentum of the given contraction.
Definition: gshell.h:296
void print(std::string out) const
Print out the shell.
Definition: gshell.cc:231
int l_
Angular momentum.
Definition: gshell.h:193
static const char * AMTYPES
Definition: gshell.h:237
double erd_coef(int pi) const
Return ERD normalized coefficient of pi&#39;th primitive.
Definition: gshell.h:158
ShellType shelltype_
The type of shell this structure encodes.
Definition: gshell.h:208
static const char * amtypes
Definition: gshell.h:100
Definition: gshell.h:51
int nval(int pi) const
Return the pi&#39;th r exponent for ECPs.
Definition: gshell.h:318
ShellType shell_type() const
The type of shell this object encodes information for.
Definition: gshell.h:134
ShellInfo(int am, const std::vector< double > &c, const std::vector< double > &e, const std::vector< int > &n)
Definition: gshell.cc:40
Gaussian orbital shell.
Definition: gshell.h:189
GaussianType
Definition: gshell.h:45
int nc_
Atom number this shell goes to. Needed when indexing integral derivatives.
Definition: gshell.h:210
const double * center_
Atomic coordinates of this center.
Definition: gshell.h:212
const int * n_
R exponents for ECPs (of length nprimitives_)
Definition: gshell.h:205
GaussianShell()
Builds and empty GShell.
Definition: gshell.h:283
char amchar() const
The character symbol for the angular momentum of the given contraction.
Definition: gshell.h:144
int nprimitive_
The number of primitives in this shell.
Definition: gshell.h:219
const std::vector< double > & coefs() const
Return coefficient of pi&#39;th primitive and ci&#39;th contraction.
Definition: gshell.h:164
PrimitiveType
Definition: gshell.h:40
double exp(int prim) const
Returns the exponent of the given primitive.
Definition: gshell.h:312
double evaluate(double r, int l) const
Definition: gshell.cc:251
int start() const
Returns the first basis function in this shell.
Definition: gshell.h:309
int nfunction() const
Total number of basis functions.
Definition: gshell.cc:153
double original_coef(int pi) const
Return unnormalized coefficient of pi&#39;th primitive.
Definition: gshell.h:160
const double * exp_
Exponents (of length nprimitives_)
Definition: gshell.h:197
int nfunction_
Definition: gshell.h:223
Definition: gshell.h:42
int l_
Angular momentum.
Definition: gshell.h:66
std::vector< double > exp_
Exponents (of length nprimitives_)
Definition: gshell.h:70
double primitive_normalization(int p)
Definition: gshell.cc:81
void set_function_index(int i)
Definition: gshell.h:335
const double * erd_coef_
Contraction coefficients normalized for the ERD integral package (of length nprimitives_) ...
Definition: gshell.h:203
int nprimitive() const
The number of primitive Gaussians.
Definition: gshell.cc:226
char AMCHAR() const
The character symbol for the angular momentum of the given contraction (upper case) ...
Definition: gshell.h:298
double coef(int pi) const
Return coefficient of pi&#39;th primitive.
Definition: gshell.h:314
int nval(int pi) const
Return r exponent for pi&#39;th ECP primitive.
Definition: gshell.h:156
std::vector< double > erd_coef_
ERD normalized contraction coefficients (of length nprimitives_)
Definition: gshell.h:76
const double * original_coef_
Original (un-normalized) contraction coefficients (of length nprimitives)
Definition: gshell.h:199
bool is_cartesian() const
Returns true if contraction is Cartesian.
Definition: gshell.h:148
const double * exps() const
Returns the exponents.
Definition: gshell.h:322
int ncartesian_
How many cartesian functions? (1=s, 3=p, 6=d, ...)
Definition: gshell.h:84
int ncartesian() const
Total number of functions if this shell was Cartesian.
Definition: gshell.h:292
const double * original_coefs() const
Return unnormalized coefficients.
Definition: gshell.h:326
int ncartesian() const
Total number of functions if this shell was Cartesian.
Definition: gshell.h:140
int nprimitive() const
The number of primitive Gaussians.
Definition: gshell.cc:158