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 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 #ifndef _psi_src_lib_libmints_gshell_h_
29 #define _psi_src_lib_libmints_gshell_h_
30 
31 #include <cstdio>
32 #include <vector>
33 #include "psi4/libmints/vector3.h"
34 
35 namespace psi {
36 
37 class Vector3;
38 
42 };
43 
45  Cartesian = 0,
46  Pure = 1
47 };
48 
55 class ShellInfo
56 {
57 private:
59  int l_;
61  int puream_;
63  std::vector<double> exp_;
65  std::vector<double> coef_;
67  std::vector<double> erd_coef_;
70  std::vector<double> original_coef_;
71 
73  int nc_;
76  int start_;
77 
84 
89  double primitive_normalization(int p);
93 
95  static const char *amtypes;
97  static const char *AMTYPES;
98 
99 public:
110  ShellInfo(int am,
111  const std::vector<double>& c,
112  const std::vector<double>& e,
113  GaussianType pure,
114  int nc,
115  const Vector3& center,
116  int start,
118 
120  void normalize_shell();
121  void erd_normalize_shell();
122 
124  ShellInfo copy();
125 
127  ShellInfo copy(int nc, const Vector3& c);
128 
130  int nprimitive() const;
132  int nfunction() const;
134  int ncartesian() const { return ncartesian_; }
136  int am() const { return l_; }
138  char amchar() const { return amtypes[l_]; }
140  char AMCHAR() const { return AMTYPES[l_]; }
142  bool is_cartesian() const { return !puream_; }
144  bool is_pure() const { return puream_; }
145 
147  const Vector3& center() const;
149  int ncenter() const { return nc_; }
150 
152  double exp(int prim) const { return exp_[prim]; }
154  double coef(int pi) const { return coef_[pi]; }
156  double erd_coef(int pi) const { return erd_coef_[pi]; }
158  double original_coef(int pi) const { return original_coef_[pi]; }
160  const std::vector<double>& exps() const { return exp_; }
162  const std::vector<double>& coefs() const { return coef_; }
164  const std::vector<double>& original_coefs() const { return original_coef_; }
165 
167  void print(std::string out) const;
168 
170  static double normalize(int l, int m, int n);
171 
173  int function_index() const { return start_; }
174  void set_function_index(int i) { start_ = i; }
175 
177  bool operator==(const ShellInfo& RHS)const;
178 
180  bool operator!=(const ShellInfo& RHS)const
181  {
182  return !(*this==RHS);
183  }
184 };
185 
186 
192 {
193 private:
195  int l_;
197  int puream_;
199  const double* exp_;
201  const double* original_coef_;
203  const double* coef_;
205  const double* erd_coef_;
206 
208  int nc_;
210  const double *center_;
212  int start_;
213 
222 
227  double primitive_normalization(int p);
231 
233  static const char *amtypes;
235  static const char *AMTYPES;
236 
237 public:
249  GaussianShell(int am,
250  int nprimitive,
251  const double *oc,
252  const double *c, const double *ec,
253  const double *e,
254  GaussianType pure,
255  int nc,
256  const double* center,
257  int start);
258 
261 
263  int nprimitive() const;
265  int nfunction() const;
267  int ncartesian() const { return ncartesian_; }
269  int am() const { return l_; }
271  char amchar() const { return amtypes[l_]; }
273  char AMCHAR() const { return AMTYPES[l_]; }
275  bool is_cartesian() const { return !puream_; }
277  bool is_pure() const { return puream_; }
278 
280  const double* center() const;
282  int ncenter() const { return nc_; }
284  int start() const { return start_; }
285 
287  double exp(int prim) const { return exp_[prim]; }
289  double coef(int pi) const { return coef_[pi]; }
291  double original_coef(int pi) const { return original_coef_[pi]; }
293  double erd_coef(int pi) const { return erd_coef_[pi]; }
295  const double* exps() const { return exp_; }
297  const double* coefs() const { return coef_; }
299  const double* original_coefs() const { return original_coef_; }
301  const double* erd_coefs() const { return erd_coef_; }
302 
304  void print(std::string out) const;
305 
307  int function_index() const { return start_; }
308  void set_function_index(int i) { start_ = i; }
309 };
310 
311 }
312 
313 #endif
This class has the same behavior as GaussianShell, but implements everything using slower data struct...
Definition: gshell.h:55
int puream_
Flag for pure angular momentum.
Definition: gshell.h:197
int ncartesian_
How many cartesian functions? (1=s, 3=p, 6=d, ...)
Definition: gshell.h:215
double coef(int pi) const
Return coefficient of pi&#39;th primitive.
Definition: gshell.h:154
const Vector3 & center() const
Returns the center of the Molecule this shell is on.
Definition: gshell.cc:174
static double normalize(int l, int m, int n)
Normalize the angular momentum component.
Definition: gshell.cc:169
std::vector< double > coef_
Contraction coefficients (of length nprimitives_)
Definition: gshell.h:65
double original_coef(int pi) const
Return unnormalized coefficient of pi&#39;th primitive.
Definition: gshell.h:291
void print(std::string out) const
Print out the shell.
Definition: gshell.cc:155
Vector3 center_
Atomic center number in the Molecule.
Definition: gshell.h:75
void contraction_normalization()
const double * coefs() const
Return coefficients.
Definition: gshell.h:297
const double * center() const
Returns the center of the Molecule this shell is on.
Definition: gshell.cc:235
const double * coef_
Contraction coefficients (of length nprimitives_)
Definition: gshell.h:203
int nfunction() const
Total number of basis functions.
Definition: gshell.cc:210
bool operator!=(const ShellInfo &RHS) const
True if any part of the two ShellInfo instances is unequal.
Definition: gshell.h:180
void erd_normalize_shell()
Definition: gshell.cc:82
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:307
Definition: vector3.h:36
Definition: pointgrp.h:105
bool operator==(const ShellInfo &RHS) const
True if two ShellInfo instances are exactly equal.
Definition: gshell.cc:183
int am() const
The angular momentum of the given contraction.
Definition: gshell.h:269
void contraction_normalization()
Definition: gshell.cc:109
int nfunction_
Definition: gshell.h:83
void normalize_shell()
Definition: gshell.cc:134
bool is_pure() const
Returns true if contraction is pure.
Definition: gshell.h:277
int puream_
Flag for pure angular momentum.
Definition: gshell.h:61
static const char * amtypes
Definition: gshell.h:233
bool is_cartesian() const
Returns true if contraction is Cartesian.
Definition: gshell.h:275
ShellInfo copy()
Make a copy of the ShellInfo.
Definition: gshell.cc:59
void set_function_index(int i)
Definition: gshell.h:174
bool is_pure() const
Returns true if contraction is pure.
Definition: gshell.h:144
int ncenter() const
Returns the atom number this shell is on. Used by integral derivatives for indexing.
Definition: gshell.h:149
int start_
First basis function in this shell.
Definition: gshell.h:212
char AMCHAR() const
The character symbol for the angular momentum of the given contraction (upper case) ...
Definition: gshell.h:140
int am() const
The angular momentum of the given contraction.
Definition: gshell.h:136
const double * erd_coefs() const
Return ERD normalized coefficients.
Definition: gshell.h:301
double primitive_normalization(int p)
Definition: gshell.h:45
double erd_coef(int pi) const
Return unnormalized coefficient of pi&#39;th primitive.
Definition: gshell.h:293
static const char * AMTYPES
Definition: gshell.h:97
const std::vector< double > & exps() const
Returns the exponent of the given primitive.
Definition: gshell.h:160
int ncenter() const
Returns the atom number this shell is on. Used by integral derivatives for indexing.
Definition: gshell.h:282
Definition: gshell.h:40
const std::vector< double > & original_coefs() const
Return unnormalized coefficient of pi&#39;th primitive and ci&#39;th contraction.
Definition: gshell.h:164
Definition: gshell.h:46
std::vector< double > original_coef_
Definition: gshell.h:70
char amchar() const
The character symbol for the angular momentum of the given contraction.
Definition: gshell.h:271
void print(std::string out) const
Print out the shell.
Definition: gshell.cc:220
int l_
Angular momentum.
Definition: gshell.h:195
static const char * AMTYPES
Definition: gshell.h:235
double erd_coef(int pi) const
Return ERD normalized coefficient of pi&#39;th primitive.
Definition: gshell.h:156
static const char * amtypes
Definition: gshell.h:95
Gaussian orbital shell.
Definition: gshell.h:191
GaussianType
Definition: gshell.h:44
int nc_
Atom number this shell goes to. Needed when indexing integral derivatives.
Definition: gshell.h:208
const double * center_
Atomic coordinates of this center.
Definition: gshell.h:210
GaussianShell()
Builds and empty GShell.
Definition: gshell.h:260
char amchar() const
The character symbol for the angular momentum of the given contraction.
Definition: gshell.h:138
int function_index() const
Basis function index where this shell starts.
Definition: gshell.h:173
int nprimitive_
The number of primitives in this shell.
Definition: gshell.h:217
const std::vector< double > & coefs() const
Return coefficient of pi&#39;th primitive and ci&#39;th contraction.
Definition: gshell.h:162
PrimitiveType
Definition: gshell.h:39
double exp(int prim) const
Returns the exponent of the given primitive.
Definition: gshell.h:287
int start() const
Returns the first basis function in this shell.
Definition: gshell.h:284
int nfunction() const
Total number of basis functions.
Definition: gshell.cc:145
double original_coef(int pi) const
Return unnormalized coefficient of pi&#39;th primitive.
Definition: gshell.h:158
const double * exp_
Exponents (of length nprimitives_)
Definition: gshell.h:199
int nc_
Atom number this shell goes to. Needed when indexing integral derivatives.
Definition: gshell.h:73
int start_
Definition: gshell.h:76
int nfunction_
Definition: gshell.h:221
Definition: gshell.h:41
int l_
Angular momentum.
Definition: gshell.h:59
std::vector< double > exp_
Exponents (of length nprimitives_)
Definition: gshell.h:63
double primitive_normalization(int p)
Definition: gshell.cc:73
void set_function_index(int i)
Definition: gshell.h:308
const double * erd_coef_
Contraction coefficients normalized for the ERD integral package (of length nprimitives_) ...
Definition: gshell.h:205
int nprimitive() const
The number of primitive Gaussians.
Definition: gshell.cc:215
char AMCHAR() const
The character symbol for the angular momentum of the given contraction (upper case) ...
Definition: gshell.h:273
double coef(int pi) const
Return coefficient of pi&#39;th primitive.
Definition: gshell.h:289
std::vector< double > erd_coef_
ERD normalized contraction coefficients (of length nprimitives_)
Definition: gshell.h:67
const double * original_coef_
Original (un-normalized) contraction coefficients (of length nprimitives)
Definition: gshell.h:201
bool is_cartesian() const
Returns true if contraction is Cartesian.
Definition: gshell.h:142
const double * exps() const
Returns the exponents.
Definition: gshell.h:295
int ncartesian_
How many cartesian functions? (1=s, 3=p, 6=d, ...)
Definition: gshell.h:79
int ncartesian() const
Total number of functions if this shell was Cartesian.
Definition: gshell.h:267
const double * original_coefs() const
Return unnormalized coefficients.
Definition: gshell.h:299
ShellInfo(int am, const std::vector< double > &c, const std::vector< double > &e, GaussianType pure, int nc, const Vector3 &center, int start, PrimitiveType pt=Normalized)
Definition: gshell.cc:39
int ncartesian() const
Total number of functions if this shell was Cartesian.
Definition: gshell.h:134
int nprimitive() const
The number of primitive Gaussians.
Definition: gshell.cc:150