28 #ifndef _chemistry_qc_basis_gaussbas_h
29 #define _chemistry_qc_basis_gaussbas_h
34 #include <util/state/state.h>
35 #include <util/keyval/keyval.h>
36 #include <math/scmat/matrix.h>
37 #include <math/scmat/vector3.h>
38 #include <chemistry/molecule/molecule.h>
39 #include <chemistry/qc/basis/gaussshell.h>
40 #include <math/mmisc/grid.h>
42 #ifdef MPQC_NEW_FEATURES
43 #include "mpqc/range.hpp"
52 class SphericalTransformIter;
142 #ifdef MPQC_NEW_FEATURES
154 basis_(
other.basis_),
155 center_(
other.center_) {}
159 static_cast<GaussianShell&>(*
this) = static_cast<const GaussianShell&>(
other);
160 basis_ =
other.basis_;
161 center_ =
other.center_;
169 unsigned int center()
const {
return center_; }
171 #ifdef MPQC_NEW_FEATURES
172 virtual boost::property_tree::ptree& write_xml(boost::property_tree::ptree& parent,
const XMLWriter& writer);
181 unsigned int center_;
195 private: std::vector<Shell> shells_;
198 void init2(
int skip_ghosts=0,
bool include_q=0);
203 std::vector<int> shell_to_function_;
204 std::vector<int> function_to_shell_;
205 std::vector<int> shell_to_primitive_;
206 std::vector<int> center_to_shell_;
207 std::vector<unsigned int> center_to_nshell_;
208 std::vector<unsigned int> center_to_nfunction_;
209 unsigned int nbasis_;
219 int havepure,
int pure,
bool missing_ok);
221 void get_shells_(
unsigned int atom,
Ref<KeyVal>& keyval,
const char* elemname,
const char* sbasisname,
BasisFileSet& bases,
222 int havepure,
int pure,
bool missing_ok);
224 int count_even_temp_shells_(
Ref<KeyVal>& keyval,
const char* elemname,
const char* sbasisname,
225 int havepure,
int pure);
227 void get_even_temp_shells_(
unsigned int atom,
Ref<KeyVal>& keyval,
const char* elemname,
const char* sbasisname,
228 int havepure,
int pure);
230 void recursively_get_shell(
unsigned int atom,
Ref<KeyVal>&,
232 int,
int,
int,
bool missing_ok);
245 void validate_point_group()
const;
254 void init(std::string
name,
257 const std::vector<Shell>&
shell);
447 const std::vector<GaussianShell>& shells,
449 std::string
name = std::string(),
450 std::string
label = std::string());
469 #ifdef MPQC_NEW_FEATURES
470 virtual boost::property_tree::ptree& write_xml(boost::property_tree::ptree& parent,
const XMLWriter& writer);
482 const std::string&
name()
const {
return name_; }
486 const std::string&
label()
const {
if (!name_.empty())
return name_;
else return label_; }
500 unsigned int nshell()
const {
return shells_.size(); }
514 unsigned int nbasis()
const {
return nbasis_; }
544 #ifdef MPQC_NEW_FEATURES
563 const Shell&
operator()(
int icenter,
int ishell)
const;
576 double r(
int icenter,
int xyz)
const;
586 double*g_values,
double* basis_values=0)
const;
592 double*g_values=0,
double* basis_values=0)
const;
596 ValueData *,
double* basis_values)
const;
602 double*g_values,
double* basis_values=0)
const;
607 ValueData *,
double *h_values,
608 double*g_values=0,
double* basis_values=0)
const;
620 Ref<GaussianBasisSet>
621 operator+(
const Ref<GaussianBasisSet>& A,
const Ref<GaussianBasisSet>& B);
626 const GaussianShell& A);
629 Ref<GaussianBasisSet>
630 operator+(
const Ref<GaussianBasisSet>& A,
const Ref<GaussianBasisSet>& B);
634 std::vector<unsigned int>
operator<<(
const GaussianBasisSet& B,
const GaussianBasisSet& A);
636 std::vector<int>
map(
const GaussianBasisSet& B,
const GaussianBasisSet& A);
670 std::vector<int> smap_;
672 std::vector<int> fmap_;
674 std::vector<int> fblock_to_function_;
676 std::vector<int> fblock_size_;
683 std::vector<int>
map;
684 int operator()(
int o)
const {
return map[o]; }
685 std::size_t
ndim()
const {
return map.size(); }
691 BasisFunctionMap bfmap_;
693 void label(
char* buffer);
695 void calculate_values(
const std::vector<SCVector3>& Points, std::vector<double>& Values);
697 std::size_t
ndim()
const {
return bfmap_.ndim(); }
708 std::string gridformat,
714 #ifdef MPQC_NEW_FEATURES
715 virtual boost::property_tree::ptree& write_xml(boost::property_tree::ptree& parent,
const XMLWriter& writer);
unsigned int max_am_for_contraction(int con) const
Return the maximum angular momentum found in the given contraction number for any shell.
int shell_to_center(int ishell) const
Return the center on which the given shell is located.
Definition: gaussbas.h:512
unsigned int nshell() const
Return the number of shells.
Definition: gaussbas.h:500
void save_data_state(StateOut &so)
saves this to so
const std::string & name() const
Return the name of the basis set (is nonnull only if keyword "name" was provided)
Definition: gaussbas.h:482
Ref< GaussianBasisSet > operator+(const Ref< GaussianBasisSet > &A, const Ref< GaussianBasisSet > &B)
Nonmember operator+ is more convenient to use than the member operator+.
unsigned int max_nfunction_in_shell() const
Return the maximum number of functions that any shell has.
WriteVectorGrid provides an interface for writing the value of a vector function evaluated at a given...
Definition: grid.h:141
void initialize()
Prepares some pre-calculated values before the repetitive grid calculations are perfomed.
CartesianIter gives the ordering of the Cartesian functions within a shell for the particular integra...
Definition: cartiter.h:35
A template class that maintains references counts.
Definition: ref.h:361
UnionBasisSet constructs a union of two GaussianBasisSet objects.
Definition: union.h:42
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,...
int map_shell(int s) const
maps shell s in Source to its location in Target
std::size_t ndim() const
number of dimensions of the vector
Definition: gaussbas.h:697
unsigned int nbasis_on_center(int icenter) const
Return the number of basis functions on the given center.
int ishell_on_center(int icenter, const Ref< GaussianBasisSet > &bs, const GaussianShell &A)
Find A in bs on center icenter and return its index.
const Shell & operator[](int i) const
Return a reference to Shell number i.
Definition: gaussbas.h:554
int fblock_size(int b) const
the number of basis functions in fblock b
unsigned int nbasis() const
Return the number of basis functions.
Definition: gaussbas.h:514
unsigned int max_ncontraction() const
Return the maximum number of Gaussians in a contraction in any shell.
Shell is a GaussianShell that is part of GaussianBasisSet, i.e. has a center on which it's centered.
Definition: gaussbas.h:149
int values(const SCVector3 &r, ValueData *, double *basis_values) const
Compute the values for this basis set at position r.
bool equiv(const Shell &s) const
Returns true if this and the argument are equivalent.
virtual void print(std::ostream &=ExEnv::out0()) const
Print a detailed description of the basis set.
const Shell & operator()(int i) const
Return a reference to Shell number i.
Definition: gaussbas.h:550
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.
const DimensionMap & dimension_map() const
dimension map
Definition: gaussbas.h:696
Shell & shell(int i, int j)
Return a reference to Shell number j on center i.
Definition: gaussbas.h:569
RefSCDimension basisdim()
Returns the SCDimension object for the dimension.
Definition: gaussbas.h:495
The RefSCDimension class is a smart pointer to an SCDimension specialization.
Definition: dim.h:152
This class is used to contain information about classes.
Definition: class.h:147
int map_function(int f) const
maps function f in Source to its location in Target
int shell_values(const SCVector3 &r, int sh, ValueData *, double *basis_values) const
Compute the values for the given shell functions at position r.
unsigned int max_angular_momentum() const
Return the highest angular momentum in any shell.
static Ref< GaussianBasisSet > unit()
This will produce a GaussianBasisSet object composed of a a single "unit" basis function,...
int function_to_shell(int i) const
Return the shell to which the given function belongs.
int fblock_to_function(int b) const
returns the Source index of the first basis function in fblock b
Shell & shell(int i)
Return a reference to Shell number i.
Definition: gaussbas.h:560
std::vector< unsigned int > operator<<(const GaussianBasisSet &B, const GaussianBasisSet &A)
computes a map from basis functions in A to the equivalent basis functions in B.
void calculate_values(const std::vector< SCVector3 > &Points, std::vector< double > &Values)
Returns the value of the vector function at the given coordinate.
int find(int C, const GaussianShell &S) const
Return the absolute index of shell S located at center C in this basis. If the shell is not found,...
std::vector< int > map(const GaussianBasisSet &B, const GaussianBasisSet &A)
same as operator<<, except A does not have to be contained in B, map[a] = -1 if function a is not in ...
void label(char *buffer)
A label that identifies the scalar function evaluated at the grid points, is written to the buffer ar...
Definition: gaussbas.h:680
Ref< Molecule > molecule() const
Return the Molecule object.
Definition: gaussbas.h:489
SpinCase1 other(SpinCase1 S)
given 1-spin return the other 1-spin
unsigned int max_ncartesian_in_shell(int aminc=0) const
Return the maximum number of Cartesian functions that any shell has.
int equiv(const Ref< GaussianBasisSet > &b)
Returns true if this and the argument are equivalent.
Definition: stateout.h:71
const std::string & label() const
Return the label of the basis set.
Definition: gaussbas.h:486
Definition: xmlwriter.h:215
int shell_on_center(int icenter, int shell) const
Return the overall shell number, given a center and the shell number on that center.
A heavy-duty map from one GaussianBasisSet to another GaussianBasisSet.
Definition: gaussbas.h:640
Shell & operator()(int i)
Return a reference to Shell number i.
Definition: gaussbas.h:552
Ref< SCMatrixKit > matrixkit()
Returns the SCMatrixKit that is to be used for AO bases.
Definition: gaussbas.h:491
bool has_pure() const
Return true if basis contains solid harmonics Gaussians.
Definition: gaussbas.h:520
const Shell & shell(int i, int j) const
Return a reference to Shell number j on center i.
Definition: gaussbas.h:567
int nfblock() const
it is useful to organize sets of basis functions that are adjacent in Source and in Target.
double r(int icenter, int xyz) const
The location of center icenter.
unsigned int max_nprimitive_in_shell() const
Return the maximum number of primitive Gaussian that any shell has.
The GaussianBasisSet class is used describe a basis set composed of atomic gaussian orbitals.
Definition: gaussbas.h:141
a 3-element version of SCVector
Definition: vector3.h:43
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:261
Ref< SCMatrixKit > so_matrixkit()
Returns the SCMatrixKit that is to be used for SO bases.
Definition: gaussbas.h:493
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.
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,...
unsigned int nprimitive() const
Return the number of primitive Gaussians (sum of number of primitives for each Shell)
Definition: gaussbas.h:518
Base class for objects that can save/restore state.
Definition: state.h:45
The base class for all reference counted objects.
Definition: ref.h:192
int shell_to_function(int i) const
Return the number of the first function in the given shell.
Definition: gaussbas.h:540
Shell & operator[](int i)
Return a reference to Shell number i.
Definition: gaussbas.h:556
GaussianBasisSetMap(const Ref< GaussianBasisSet > &Source, const Ref< GaussianBasisSet > &Target)
will throw if Source is not contained in Target
unsigned int max_cartesian() const
Return the maximum number of Cartesian functions in any shell.
int nshell_on_center(int icenter) const
Return the number of shells on the given center.
const Shell & shell(int i) const
Return a reference to Shell number i.
Definition: gaussbas.h:558
Ref< Molecule > get_molecule()
Returns the molecule around which the grid values are calculated.
Definition: gaussbas.h:694
Ref< GaussianBasisSet > operator+(const Ref< GaussianBasisSet > &B)
Uses UnionBasisSet to construct the sum of this and B.
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
void print_brief(std::ostream &=ExEnv::out0()) const
Print a brief description of the basis set.
A shell of Gaussian functions.
Definition: gaussshell.h:51
unsigned int ncenter() const
Return the number of centers.
Generated at Sun Jan 26 2020 23:23:57 for MPQC
3.0.0-alpha using the documentation package Doxygen
1.8.16.