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"
52class SphericalTransformIter;
142#ifdef MPQC_NEW_FEATURES
154 basis_(
other.basis_),
155 center_(
other.center_) {}
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_;
186 friend class UnionBasisSet;
194 protected: Ref<Molecule> molecule_;
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_;
213 Ref<SCMatrixKit> matrixkit_;
214 Ref<SCMatrixKit> so_matrixkit_;
215 RefSCDimension basisdim_;
218 int count_shells_(Ref<KeyVal>& keyval,
const char* elemname,
const char* sbasisname, BasisFileSet& bases,
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>&,
231 const char*,
const char*,BasisFileSet&,
232 int,
int,
int,
bool missing_ok);
235 void init(Ref<Molecule>&,Ref<KeyVal>&,
245 void validate_point_group()
const;
251 virtual void set_matrixkit(
const Ref<SCMatrixKit>&);
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
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;
608 double*g_values=0,
double* basis_values=0)
const;
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_;
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);
CartesianIter gives the ordering of the Cartesian functions within a shell for the particular integra...
Definition cartiter.h:35
This class is used to contain information about classes.
Definition class.h:147
static std::ostream & out0()
Return an ostream that writes from node 0.
A heavy-duty map from one GaussianBasisSet to another GaussianBasisSet.
Definition gaussbas.h:640
int fblock_to_function(int b) const
returns the Source index of the first basis function in fblock b
GaussianBasisSetMap(const Ref< GaussianBasisSet > &Source, const Ref< GaussianBasisSet > &Target)
will throw if Source is not contained in Target
int map_shell(int s) const
maps shell s in Source to its location in Target
int fblock_size(int b) const
the number of basis functions in fblock b
int nfblock() const
it is useful to organize sets of basis functions that are adjacent in Source and in Target.
int map_function(int f) const
maps function f in Source to its location in Target
Shell is a GaussianShell that is part of GaussianBasisSet, i.e. has a center on which it's centered.
Definition gaussbas.h:149
bool equiv(const Shell &s) const
Returns true if this and the argument are equivalent.
This holds scratch data needed to compute basis function values.
Definition gaussbas.h:261
The GaussianBasisSet class is used describe a basis set composed of atomic gaussian orbitals.
Definition gaussbas.h:145
Shell & operator()(int i)
Return a reference to Shell number i.
Definition gaussbas.h:552
const std::string & label() const
Return the label of the basis set.
Definition gaussbas.h:486
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,...
const Shell & shell(int i) const
Return a reference to Shell number i.
Definition gaussbas.h:558
const Shell & operator()(int i) const
Return a reference to Shell number i.
Definition gaussbas.h:550
virtual void print(std::ostream &=ExEnv::out0()) const
Print a detailed description of the basis set.
GaussianBasisSet(const Ref< Molecule > &molecule, const std::vector< GaussianShell > &shells, const std::vector< unsigned int > &shell_to_center, std::string name=std::string(), std::string label=std::string())
Constructs GaussianBasisSet from a Molecule and a vector of GaussianShells.
int nshell_on_center(int icenter) const
Return the number of shells on the given center.
RefSCDimension basisdim()
Returns the SCDimension object for the dimension.
Definition gaussbas.h:495
bool has_pure() const
Return true if basis contains solid harmonics Gaussians.
Definition gaussbas.h:520
unsigned int max_nprimitive_in_shell() const
Return the maximum number of primitive Gaussian that any shell has.
int function_to_shell(int i) const
Return the shell to which the given function belongs.
unsigned int nprimitive() const
Return the number of primitive Gaussians (sum of number of primitives for each Shell)
Definition gaussbas.h:518
const Shell & operator()(int icenter, int ishell) const
Return a reference to Shell number ishell on center icenter.
unsigned int nshell() const
Return the number of shells.
Definition gaussbas.h:500
int shell_to_function(int i) const
Return the number of the first function in the given shell.
Definition gaussbas.h:540
unsigned int max_cartesian() const
Return the maximum number of Cartesian functions in any shell.
unsigned int nbasis() const
Return the number of basis functions.
Definition gaussbas.h:514
Ref< SCMatrixKit > matrixkit()
Returns the SCMatrixKit that is to be used for AO bases.
Definition gaussbas.h:491
unsigned int nbasis_on_center(int icenter) const
Return the number of basis functions on the given center.
int equiv(const Ref< GaussianBasisSet > &b)
Returns true if this and the argument are equivalent.
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.
void init(std::string name, std::string label, const Ref< Molecule > &molecule, const std::vector< Shell > &shell)
Initializes everything.
void save_data_state(StateOut &so)
saves this to so
Shell & operator[](int i)
Return a reference to Shell number i.
Definition gaussbas.h:556
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,...
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.
Shell & shell(int i, int j)
Return a reference to Shell number j on center i.
Definition gaussbas.h:569
Shell & operator()(int icenter, int ishell)
Return a reference to Shell number ishell on center icenter.
int shell_on_center(int icenter, int shell) const
Return the overall shell number, given a center and the shell number on that center.
Ref< GaussianBasisSet > operator+(const Ref< GaussianBasisSet > &B)
Uses UnionBasisSet to construct the sum of this and B.
unsigned int max_ncontraction() const
Return the maximum number of Gaussians in a contraction in any shell.
unsigned int max_ncartesian_in_shell(int aminc=0) const
Return the maximum number of Cartesian functions that any shell has.
unsigned int max_nfunction_in_shell() const
Return the maximum number of functions that any shell has.
Ref< Molecule > molecule() const
Return the Molecule object.
Definition gaussbas.h:489
int shell_values(const SCVector3 &r, int sh, ValueData *, double *basis_values) const
Compute the values for the given shell functions at position r.
static Ref< GaussianBasisSet > unit()
This will produce a GaussianBasisSet object composed of a a single "unit" basis function,...
GaussianBasisSet(StateIn &si)
restores this from si
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.
unsigned int max_angular_momentum() const
Return the highest angular momentum in any shell.
Ref< SCMatrixKit > so_matrixkit()
Returns the SCMatrixKit that is to be used for SO bases.
Definition gaussbas.h:493
const std::string & name() const
Return the name of the basis set (is nonnull only if keyword "name" was provided)
Definition gaussbas.h:482
GaussianBasisSet(const Ref< KeyVal > &)
The KeyVal constructor.
const Shell & shell(int i, int j) const
Return a reference to Shell number j on center i.
Definition gaussbas.h:567
int shell_to_center(int ishell) const
Return the center on which the given shell is located.
Definition gaussbas.h:512
Shell & shell(int i)
Return a reference to Shell number i.
Definition gaussbas.h:560
unsigned int max_am_for_contraction(int con) const
Return the maximum angular momentum found in the given contraction number for any shell.
const Shell & operator[](int i) const
Return a reference to Shell number i.
Definition gaussbas.h:554
unsigned int ncenter() const
Return the number of centers.
A shell of Gaussian functions.
Definition gaussshell.h:57
The base class for all reference counted objects.
Definition ref.h:192
The RefSCDimension class is a smart pointer to an SCDimension specialization.
Definition dim.h:152
A template class that maintains references counts.
Definition ref.h:361
a 3-element version of SCVector
Definition vector3.h:44
Base class for objects that can save/restore state.
Definition state.h:45
Restores fundamental and user-defined types from images created with StateOut.
Definition statein.h:79
Serializes fundamental and user-defined types.
Definition stateout.h:71
Definition gaussbas.h:680
void label(char *buffer)
A label that identifies the scalar function evaluated at the grid points, is written to the buffer ar...
const DimensionMap & dimension_map() const
dimension map
Definition gaussbas.h:696
void calculate_values(const std::vector< SCVector3 > &Points, std::vector< double > &Values)
Returns the value of the vector function at the given coordinate.
Ref< Molecule > get_molecule()
Returns the molecule around which the grid values are calculated.
Definition gaussbas.h:694
std::size_t ndim() const
number of dimensions of the vector
Definition gaussbas.h:697
void initialize()
Prepares some pre-calculated values before the repetitive grid calculations are perfomed.
WriteVectorGrid provides an interface for writing the value of a vector function evaluated at a given...
Definition grid.h:145
Definition xmlwriter.h:223
int ishell_on_center(int icenter, const Ref< GaussianBasisSet > &bs, const GaussianShell &A)
Find A in bs on center icenter and return its index.
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 ...
Ref< GaussianBasisSet > operator+(const Ref< GaussianBasisSet > &A, const Ref< GaussianBasisSet > &B)
Nonmember operator+ is more convenient to use than the member operator+.
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.
SpinCase1 other(SpinCase1 S)
given 1-spin return the other 1-spin
Contains all MPQC code up to version 3.
Definition mpqcin.h:14