MPQC 2.3.1
gaussbas.h
1//
2// gaussbas.h
3//
4// Copyright (C) 1996 Limit Point Systems, Inc.
5//
6// Author: Curtis Janssen <cljanss@limitpt.com>
7// Maintainer: LPS
8//
9// This file is part of the SC Toolkit.
10//
11// The SC Toolkit is free software; you can redistribute it and/or modify
12// it under the terms of the GNU Library General Public License as published by
13// the Free Software Foundation; either version 2, or (at your option)
14// any later version.
15//
16// The SC Toolkit 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 Library General Public License for more details.
20//
21// You should have received a copy of the GNU Library General Public License
22// along with the SC Toolkit; see the file COPYING.LIB. If not, write to
23// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24//
25// The U.S. Government is granted a limited license as per AL 91-7.
26//
27
28#ifndef _chemistry_qc_basis_gaussbas_h
29#define _chemistry_qc_basis_gaussbas_h
30
31#ifdef __GNUC__
32#pragma interface
33#endif
34
35#include <vector>
36#include <iostream>
37
38#include <util/state/state.h>
39#include <util/keyval/keyval.h>
40#include <math/scmat/matrix.h>
41#include <math/scmat/vector3.h>
42#include <chemistry/molecule/molecule.h>
43
44namespace sc {
45
46class GaussianShell;
47class BasisFileSet;
48class Integral;
49
50class CartesianIter;
51class SphericalTransformIter;
52
146{
147 private:
148 // nonnull if keyword "name" was provided
149 char* name_;
150 // same as name_ if name_!=0, else something else
151 char* label_;
152 GaussianShell** shell_;
153 std::vector<int> shell_to_function_;
154 std::vector<int> function_to_shell_;
155
156 Ref<Molecule> molecule_;
157
158 Ref<SCMatrixKit> matrixkit_;
159 Ref<SCMatrixKit> so_matrixkit_;
160 RefSCDimension basisdim_;
161
162 int ncenter_;
163
164 std::vector<int> shell_to_center_;
165 std::vector<int> shell_to_primitive_;
166 std::vector<int> center_to_shell_;
167 std::vector<int> center_to_nshell_;
168 std::vector<int> center_to_nbasis_;
169
170 int nshell_;
171 int nbasis_;
172 int nprim_;
173 bool has_pure_;
174
175 GaussianBasisSet(const char* name, const char* label, const Ref<Molecule>& molecule,
178 const int ncenter, const int nshell,
180 const std::vector<int>& center_to_nshell);
181
182 // Counts shells in this basis for this chemical element
183 int count_shells_(Ref<KeyVal>& keyval, const char* elemname, const char* sbasisname, BasisFileSet& bases,
184 int havepure, int pure, bool missing_ok);
185 // Constructs this basis
186 void get_shells_(int& ishell, Ref<KeyVal>& keyval, const char* elemname, const char* sbasisname, BasisFileSet& bases,
187 int havepure, int pure, bool missing_ok);
188 // Counts shells in an even-tempered primitive basis
189 int count_even_temp_shells_(Ref<KeyVal>& keyval, const char* elemname, const char* sbasisname,
190 int havepure, int pure);
191 // Constructs an even-tempered primitive basis
192 void get_even_temp_shells_(int& ishell, Ref<KeyVal>& keyval, const char* elemname, const char* sbasisname,
193 int havepure, int pure);
194 // Constructs basis set specified as an array of shells
195 void recursively_get_shell(int&,Ref<KeyVal>&,
196 const char*,const char*,BasisFileSet&,
197 int,int,int,bool missing_ok);
198
199 void init(Ref<Molecule>&,Ref<KeyVal>&,
201 int have_userkeyval,
202 int pure);
203 void init2(int skip_ghosts=0,bool include_q=0);
204
205 protected:
207 virtual void set_matrixkit(const Ref<SCMatrixKit>&);
208
209 public:
211 class ValueData {
212 protected:
213 CartesianIter **civec_;
214 SphericalTransformIter **sivec_;
215 int maxam_;
216 public:
218 ~ValueData();
219 CartesianIter **civec() { return civec_; }
220 SphericalTransformIter **sivec() { return sivec_; }
221 };
222
224 enum UnitType {Unit};
225
388 virtual ~GaussianBasisSet();
389
395
397
399 const char* name() const { return name_; }
403 const char* label() const { if (name()) { return name(); } else { return label_; } }
404
406 Ref<Molecule> molecule() const { return molecule_; }
408 Ref<SCMatrixKit> matrixkit() { return matrixkit_; }
410 Ref<SCMatrixKit> so_matrixkit() { return so_matrixkit_; }
412 RefSCDimension basisdim() { return basisdim_; }
413
415 int ncenter() const;
417 int nshell() const { return nshell_; }
419 int nshell_on_center(int icenter) const;
422 int shell_on_center(int icenter, int shell) const;
424 int shell_to_center(int ishell) const { return shell_to_center_[ishell]; }
426 int shell_to_primitive(int ishell) const {return shell_to_primitive_[ishell]; }
428 int nbasis() const { return nbasis_; }
430 int nbasis_on_center(int icenter) const;
432 int nprimitive() const { return nprim_; }
434 int has_pure() const { return has_pure_; }
435
440 int max_ncartesian_in_shell(int aminc=0) const;
446 int max_ncontraction() const;
449 int max_am_for_contraction(int con) const;
451 int max_cartesian() const;
452
454 int shell_to_function(int i) const { return shell_to_function_[i]; }
456 int function_to_shell(int i) const;
457
459 const GaussianShell& operator()(int i) const { return *shell_[i]; }
461 GaussianShell& operator()(int i) { return *shell_[i]; }
463 const GaussianShell& operator[](int i) const { return *shell_[i]; }
465 GaussianShell& operator[](int i) { return *shell_[i]; }
467 const GaussianShell& shell(int i) const { return *shell_[i]; }
469 GaussianShell& shell(int i) { return *shell_[i]; }
470
472 const GaussianShell& operator()(int icenter,int ishell) const;
474 GaussianShell& operator()(int icenter,int ishell);
476 const GaussianShell& shell(int i,int j) const { return operator()(i,j); }
478 GaussianShell& shell(int i,int j) { return operator()(i,j); }
479
482 double r(int icenter,int xyz) const;
483
486 int values(const SCVector3& r, ValueData *, double* basis_values) const;
492 double*g_values,double* basis_values=0) const;
497 int hessian_values(const SCVector3& r, ValueData *, double *h_values,
498 double*g_values=0,double* basis_values=0) const;
501 int shell_values(const SCVector3& r, int sh,
502 ValueData *, double* basis_values) const;
506 int grad_shell_values(const SCVector3& r, int sh,
507 ValueData *,
508 double*g_values, double* basis_values=0) const;
512 int hessian_shell_values(const SCVector3& r, int sh,
513 ValueData *, double *h_values,
514 double*g_values=0,double* basis_values=0) const;
515
518
520 void print_brief(std::ostream& =ExEnv::out0()) const;
522 void print(std::ostream& =ExEnv::out0()) const;
523};
524
525}
526
527#endif
528
529// Local Variables:
530// mode: c++
531// c-file-style: "CLJ"
532// End:
Definition files.h:35
CartesianIter gives the ordering of the Cartesian functions within a shell for the particular integra...
Definition cartiter.h:39
static std::ostream & out0()
Return an ostream that writes from node 0.
This holds scratch data needed to compute basis function values.
Definition gaussbas.h:211
The GaussianBasisSet class is used describe a basis set composed of atomic gaussian orbitals.
Definition gaussbas.h:146
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
int hessian_values(const SCVector3 &r, ValueData *, double *h_values, double *g_values=0, double *basis_values=0) const
Like values(...), but computes first and second derivatives of the basis function values,...
int nshell_on_center(int icenter) const
Return the number of shells on the given center.
int shell_to_primitive(int ishell) const
Return the overall index of the first primitive from the given shell.
Definition gaussbas.h:426
RefSCDimension basisdim()
Returns the SCDimension object for the dimension.
Definition gaussbas.h:412
int nshell() const
Return the number of shells.
Definition gaussbas.h:417
const GaussianShell & operator[](int i) const
Return a reference to GaussianShell number i.
Definition gaussbas.h:463
void print(std::ostream &=ExEnv::out0()) const
Print a detailed description of the basis set.
int function_to_shell(int i) const
Return the shell to which the given function belongs.
int nbasis() const
Return the number of basis functions.
Definition gaussbas.h:428
GaussianBasisSet(UnitType)
This can be given GaussianBasisSet::Unit to construct a basis set with a single basis function that i...
int max_am_for_contraction(int con) const
Return the maximum angular momentum found in the given contraction number for any shell.
const GaussianShell & shell(int i, int j) const
Return a reference to GaussianShell number j on center i.
Definition gaussbas.h:476
int max_nfunction_in_shell() const
Return the maximum number of functions that any shell has.
int shell_to_function(int i) const
Return the number of the first function in the given shell.
Definition gaussbas.h:454
const GaussianShell & shell(int i) const
Return a reference to GaussianShell number i.
Definition gaussbas.h:467
int max_nprimitive_in_shell() const
Return the maximum number of primitive Gaussian that any shell has.
int ncenter() const
Return the number of centers.
int has_pure() const
Return true if basis contains solid harmonics Gaussians.
Definition gaussbas.h:434
Ref< SCMatrixKit > matrixkit()
Returns the SCMatrixKit that is to be used for AO bases.
Definition gaussbas.h:408
int equiv(const Ref< GaussianBasisSet > &b)
Returns true if this and the argument are equivalent.
GaussianShell & shell(int i)
Return a reference to GaussianShell number i.
Definition gaussbas.h:469
int grad_shell_values(const SCVector3 &r, int sh, ValueData *, double *g_values, double *basis_values=0) const
Like values(...), but computes gradients of the shell function values, too.
int values(const SCVector3 &r, ValueData *, double *basis_values) const
Compute the values for this basis set at position r.
const GaussianShell & operator()(int i) const
Return a reference to GaussianShell number i.
Definition gaussbas.h:459
const GaussianShell & operator()(int icenter, int ishell) const
Return a reference to GaussianShell number ishell on center icenter.
int hessian_shell_values(const SCVector3 &r, int sh, ValueData *, double *h_values, double *g_values=0, double *basis_values=0) const
Like values(...), but computes first and second derivatives of the shell function values,...
double r(int icenter, int xyz) const
The location of center icenter.
void print_brief(std::ostream &=ExEnv::out0()) const
Print a brief description of the basis set.
int nprimitive() const
Return the number of primitive Gaussians.
Definition gaussbas.h:432
int shell_on_center(int icenter, int shell) const
Return an overall shell number, given a center and the shell number on that center.
Ref< GaussianBasisSet > operator+(const Ref< GaussianBasisSet > &B)
Returns a GaussianBasisSet object that consists of the basis functions for each atom in this followed...
GaussianShell & shell(int i, int j)
Return a reference to GaussianShell number j on center i.
Definition gaussbas.h:478
UnitType
This can be given to a CTOR to construct a unit basis function.
Definition gaussbas.h:224
int max_ncontraction() const
Return the maximum number of Gaussians in a contraction in any shell.
int max_ncartesian_in_shell(int aminc=0) const
Return the maximum number of Cartesian functions that any shell has.
Ref< Molecule > molecule() const
Return the Molecule object.
Definition gaussbas.h:406
int shell_values(const SCVector3 &r, int sh, ValueData *, double *basis_values) const
Compute the values for the given shell functions at position r.
int nbasis_on_center(int icenter) const
Return the number of basis functions on the given center.
int grad_values(const SCVector3 &r, ValueData *, double *g_values, double *basis_values=0) const
Like values(...), but computes gradients of the basis function values, too.
Ref< SCMatrixKit > so_matrixkit()
Returns the SCMatrixKit that is to be used for SO bases.
Definition gaussbas.h:410
GaussianBasisSet(const Ref< KeyVal > &)
The KeyVal constructor.
const char * name() const
Return the name of the basis set (is nonnull only if keyword "name" was provided)
Definition gaussbas.h:399
GaussianShell & operator[](int i)
Return a reference to GaussianShell number i.
Definition gaussbas.h:465
int shell_to_center(int ishell) const
Return the center on which the given shell is located.
Definition gaussbas.h:424
const char * label() const
Return the label of the basis set.
Definition gaussbas.h:403
GaussianShell & operator()(int i)
Return a reference to GaussianShell number i.
Definition gaussbas.h:461
int max_cartesian() const
Return the maximum number of Cartesian functions in any shell.
GaussianShell & operator()(int icenter, int ishell)
Return a reference to GaussianShell number ishell on center icenter.
int max_angular_momentum() const
Return the highest angular momentum in any shell.
A Gaussian orbital shell.
Definition gaussshell.h:48
The RefSCDimension class is a smart pointer to an SCDimension specialization.
Definition dim.h:156
A template class that maintains references counts.
Definition ref.h:332
Definition vector3.h:46
Base class for objects that can save/restore state.
Definition state.h:46
This iterates through the components of a SphericalTransform.
Definition chemistry/qc/basis/transform.h:138
Restores objects that derive from SavableState.
Definition statein.h:70
Serializes objects that derive from SavableState.
Definition stateout.h:61

Generated at Wed Mar 27 2024 02:45:28 for MPQC 2.3.1 using the documentation package Doxygen 1.9.8.