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-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 #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 
41 
42 enum GaussianType { Cartesian = 0, Pure = 1 };
43 
44 enum ShellType { Gaussian = 0, ECPType1 = 1, ECPType2 = 2 };
45 
52 class ShellInfo {
53  protected:
55  int l_;
57  int puream_;
59  std::vector<double> exp_;
61  std::vector<double> coef_;
63  std::vector<int> n_;
65  std::vector<double> erd_coef_;
68  std::vector<double> original_coef_;
71 
78 
83  double primitive_normalization(int p);
87 
89  static const char* amtypes;
91  static const char* AMTYPES;
92 
93  public:
100  ShellInfo(int am, const std::vector<double>& c, const std::vector<double>& e, const std::vector<int>& n);
101 
109  ShellInfo(int am, const std::vector<double>& c, const std::vector<double>& e, GaussianType pure,
111 
113  void normalize_shell();
114  void erd_normalize_shell();
115 
117  ShellType shell_type() const { return shelltype_; }
119  int nprimitive() const;
121  int nfunction() const;
123  int ncartesian() const { return ncartesian_; }
125  int am() const { return l_; }
127  char amchar() const { return amtypes[l_]; }
129  char AMCHAR() const { return AMTYPES[l_]; }
131  bool is_cartesian() const { return !puream_; }
133  bool is_pure() const { return puream_; }
135  double exp(int prim) const { return exp_[prim]; }
137  double coef(int pi) const { return coef_[pi]; }
139  int nval(int pi) const { return n_[pi]; }
141  double erd_coef(int pi) const { return erd_coef_[pi]; }
143  double original_coef(int pi) const { return original_coef_[pi]; }
145  const std::vector<double>& exps() const { return exp_; }
147  const std::vector<double>& coefs() const { return coef_; }
149  const std::vector<double>& original_coefs() const { return original_coef_; }
150 
152  void print(std::string out) const;
153 
155  static double normalize(int l, int m, int n);
156 
158  bool operator==(const ShellInfo& RHS) const;
159 
161  bool operator!=(const ShellInfo& RHS) const { return !(*this == RHS); }
162 };
163 
169  protected:
171  int l_;
173  int puream_;
175  const double* exp_;
177  const double* original_coef_;
179  const double* coef_;
181  const double* erd_coef_;
183  const int* n_;
184 
188  int nc_;
190  const double* center_;
192  int start_;
193 
202 
207  double primitive_normalization(int p);
211 
213  static const char* amtypes;
215  static const char* AMTYPES;
216 
217  public:
233  GaussianShell(ShellType shelltype, int am, int nprimitive, const double* oc, const double* c, const double* ec,
234  const double* e, GaussianType pure, int nc, const double* center, int start);
235 
247  GaussianShell(ShellType shelltype, int am, int nprimitive, const double* c, const double* e, const int* n, int nc,
248  const double* center);
251 
253  ShellType shell_type() const { return shelltype_; }
255  int nprimitive() const;
257  int nfunction() const;
259  int ncartesian() const { return ncartesian_; }
261  int am() const { return l_; }
263  char amchar() const { return amtypes[l_]; }
265  char AMCHAR() const { return AMTYPES[l_]; }
267  bool is_cartesian() const { return !puream_; }
269  bool is_pure() const { return puream_; }
270 
272  const double* center() const;
274  int ncenter() const { return nc_; }
276  int start() const { return start_; }
277 
279  double exp(int prim) const { return exp_[prim]; }
281  double coef(int pi) const { return coef_[pi]; }
283  double original_coef(int pi) const { return original_coef_[pi]; }
285  int nval(int pi) const { return n_[pi]; }
287  double erd_coef(int pi) const { return erd_coef_[pi]; }
289  const double* exps() const { return exp_; }
291  const double* coefs() const { return coef_; }
293  const double* original_coefs() const { return original_coef_; }
295  const double* erd_coefs() const { return erd_coef_; }
296 
298  void print(std::string out) const;
299 
301  int function_index() const { return start_; }
302  void set_function_index(int i) { start_ = i; }
303  double evaluate(double r, int l) const;
304 };
305 
306 } // namespace psi
307 
308 #endif
This class has the same behavior as GaussianShell, but implements everything using slower data struct...
Definition: gshell.h:52
int puream_
Flag for pure angular momentum.
Definition: gshell.h:173
int ncartesian_
How many cartesian functions? (1=s, 3=p, 6=d, ...)
Definition: gshell.h:195
double coef(int pi) const
Return coefficient of pi&#39;th primitive.
Definition: gshell.h:137
ShellType
Definition: gshell.h:44
static double normalize(int l, int m, int n)
Normalize the angular momentum component.
Definition: gshell.cc:156
std::vector< int > n_
R exponents, for ECP basis sets (of length nprimitives_)
Definition: gshell.h:63
std::vector< double > coef_
Contraction coefficients (of length nprimitives_)
Definition: gshell.h:61
double original_coef(int pi) const
Return unnormalized coefficient of pi&#39;th primitive.
Definition: gshell.h:283
void print(std::string out) const
Print out the shell.
Definition: gshell.cc:146
void contraction_normalization()
const double * coefs() const
Return coefficients.
Definition: gshell.h:291
const double * center() const
Returns the center of the Molecule this shell is on.
Definition: gshell.cc:236
const double * coef_
Contraction coefficients (of length nprimitives_)
Definition: gshell.h:179
int nfunction() const
Total number of basis functions.
Definition: gshell.cc:204
bool operator!=(const ShellInfo &RHS) const
True if any part of the two ShellInfo instances is unequal.
Definition: gshell.h:161
void erd_normalize_shell()
Definition: gshell.cc:86
ShellType shelltype_
The type of shell this object encodes.
Definition: gshell.h:70
Definition: gshell.h:44
double exp(int prim) const
Returns the exponent of the given primitive.
Definition: gshell.h:135
int function_index() const
Basis function index where this shell starts.
Definition: gshell.h:301
Definition: pointgrp.h:104
bool operator==(const ShellInfo &RHS) const
True if two ShellInfo instances are exactly equal.
Definition: gshell.cc:161
int am() const
The angular momentum of the given contraction.
Definition: gshell.h:261
void contraction_normalization()
Definition: gshell.cc:110
int nfunction_
Definition: gshell.h:77
void normalize_shell()
Definition: gshell.cc:132
bool is_pure() const
Returns true if contraction is pure.
Definition: gshell.h:269
int puream_
Flag for pure angular momentum.
Definition: gshell.h:57
static const char * amtypes
Definition: gshell.h:213
bool is_cartesian() const
Returns true if contraction is Cartesian.
Definition: gshell.h:267
bool is_pure() const
Returns true if contraction is pure.
Definition: gshell.h:133
int start_
First basis function in this shell.
Definition: gshell.h:192
char AMCHAR() const
The character symbol for the angular momentum of the given contraction (upper case) ...
Definition: gshell.h:129
int am() const
The angular momentum of the given contraction.
Definition: gshell.h:125
const double * erd_coefs() const
Return ERD normalized coefficients.
Definition: gshell.h:295
double primitive_normalization(int p)
Definition: gshell.h:42
double erd_coef(int pi) const
Return unnormalized coefficient of pi&#39;th primitive.
Definition: gshell.h:287
ShellType shell_type() const
The type of shell this object encodes information for.
Definition: gshell.h:253
static const char * AMTYPES
Definition: gshell.h:91
const std::vector< double > & exps() const
Returns the exponent of the given primitive.
Definition: gshell.h:145
Definition: gshell.h:44
int ncenter() const
Returns the atom number this shell is on. Used by integral derivatives for indexing.
Definition: gshell.h:274
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:149
Definition: gshell.h:42
std::vector< double > original_coef_
Definition: gshell.h:68
char amchar() const
The character symbol for the angular momentum of the given contraction.
Definition: gshell.h:263
void print(std::string out) const
Print out the shell.
Definition: gshell.cc:208
int l_
Angular momentum.
Definition: gshell.h:171
static const char * AMTYPES
Definition: gshell.h:215
double erd_coef(int pi) const
Return ERD normalized coefficient of pi&#39;th primitive.
Definition: gshell.h:141
ShellType shelltype_
The type of shell this structure encodes.
Definition: gshell.h:186
static const char * amtypes
Definition: gshell.h:89
Definition: gshell.h:44
int nval(int pi) const
Return the pi&#39;th r exponent for ECPs.
Definition: gshell.h:285
ShellType shell_type() const
The type of shell this object encodes information for.
Definition: gshell.h:117
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:168
GaussianType
Definition: gshell.h:42
int nc_
Atom number this shell goes to. Needed when indexing integral derivatives.
Definition: gshell.h:188
const double * center_
Atomic coordinates of this center.
Definition: gshell.h:190
const int * n_
R exponents for ECPs (of length nprimitives_)
Definition: gshell.h:183
GaussianShell()
Builds and empty GShell.
Definition: gshell.h:250
char amchar() const
The character symbol for the angular momentum of the given contraction.
Definition: gshell.h:127
int nprimitive_
The number of primitives in this shell.
Definition: gshell.h:197
const std::vector< double > & coefs() const
Return coefficient of pi&#39;th primitive and ci&#39;th contraction.
Definition: gshell.h:147
PrimitiveType
Definition: gshell.h:40
double exp(int prim) const
Returns the exponent of the given primitive.
Definition: gshell.h:279
double evaluate(double r, int l) const
Definition: gshell.cc:225
int start() const
Returns the first basis function in this shell.
Definition: gshell.h:276
int nfunction() const
Total number of basis functions.
Definition: gshell.cc:142
double original_coef(int pi) const
Return unnormalized coefficient of pi&#39;th primitive.
Definition: gshell.h:143
const double * exp_
Exponents (of length nprimitives_)
Definition: gshell.h:175
int nfunction_
Definition: gshell.h:201
Definition: gshell.h:40
int l_
Angular momentum.
Definition: gshell.h:55
std::vector< double > exp_
Exponents (of length nprimitives_)
Definition: gshell.h:59
double primitive_normalization(int p)
Definition: gshell.cc:78
void set_function_index(int i)
Definition: gshell.h:302
const double * erd_coef_
Contraction coefficients normalized for the ERD integral package (of length nprimitives_) ...
Definition: gshell.h:181
int nprimitive() const
The number of primitive Gaussians.
Definition: gshell.cc:206
char AMCHAR() const
The character symbol for the angular momentum of the given contraction (upper case) ...
Definition: gshell.h:265
double coef(int pi) const
Return coefficient of pi&#39;th primitive.
Definition: gshell.h:281
int nval(int pi) const
Return r exponent for pi&#39;th ECP primitive.
Definition: gshell.h:139
std::vector< double > erd_coef_
ERD normalized contraction coefficients (of length nprimitives_)
Definition: gshell.h:65
const double * original_coef_
Original (un-normalized) contraction coefficients (of length nprimitives)
Definition: gshell.h:177
bool is_cartesian() const
Returns true if contraction is Cartesian.
Definition: gshell.h:131
const double * exps() const
Returns the exponents.
Definition: gshell.h:289
int ncartesian_
How many cartesian functions? (1=s, 3=p, 6=d, ...)
Definition: gshell.h:73
int ncartesian() const
Total number of functions if this shell was Cartesian.
Definition: gshell.h:259
const double * original_coefs() const
Return unnormalized coefficients.
Definition: gshell.h:293
int ncartesian() const
Total number of functions if this shell was Cartesian.
Definition: gshell.h:123
int nprimitive() const
The number of primitive Gaussians.
Definition: gshell.cc:144