28#ifndef _chemistry_qc_basis_gaussshell_h
29#define _chemistry_qc_basis_gaussshell_h
32#include <util/state/state.h>
33#include <math/scmat/vector3.h>
34#include <util/keyval/keyval.h>
35#ifdef MPQC_NEW_FEATURES
36# include <util/misc/xml.h>
42class SphericalTransformIter;
52#ifdef MPQC_NEW_FEATURES
59 enum PrimitiveType { Normalized, Unnormalized };
60 enum GaussianType { Cartesian, Pure };
63 static double epsilon() {
return 1.0e-13; }
66 std::vector<unsigned int> l;
67 std::vector<bool> puream;
68 std::vector<double> exp;
69 std::vector<double> coef_blk;
72 void init_computed_data();
73 static void chomp(std::vector<double>& exp, std::vector<double>& coef_blk,
77 std::vector<double*> coef;
84 std::vector<int> contr_to_func_;
85 std::vector<int> func_to_contr_;
87 double shell_normalization(
int);
89 void normalize_shell();
90 PrimitiveType keyval_init(
const Ref<KeyVal>&,
int,
int);
91 int test_monobound(
double &r,
double &bound)
const;
101 static const char* amtypes;
102 static const char* AMTYPES;
118 const std::vector<bool>& puream,
119 const std::vector<double>& exps,
120 const std::vector<double>& contr_coefs,
121 PrimitiveType pt = GaussianShell::Normalized,
122 bool normalize_shell =
true);
164 PrimitiveType pt = GaussianShell::Normalized,
165 bool do_normalize_shell =
true);
177 PrimitiveType pt = GaussianShell::Normalized);
199 const std::vector<unsigned int>&
am()
const {
return l; }
201 unsigned int am(
int con)
const {
return l[con]; }
203 unsigned int max_am()
const {
return max_am_; }
205 unsigned int min_am()
const {
return min_am_; }
207 char amchar(
int con)
const {
return amtypes[l[con]]; }
216 unsigned int ncartesian(
int con)
const {
return ((l[con]+2)*(l[con]+1))>>1; }
222 bool is_pure(
int con)
const {
return puream[con]; }
224 const std::vector<bool>&
is_pure()
const {
return puream; }
238 double exponent(
int iprim)
const {
return exp[iprim]; }
240 const std::vector<double>&
exponents()
const {
return this->exp; }
245 const SCVector3& r,
double* basis_values);
251 double* basis_values=0)
const;
256 double* h_values,
double* g_values=0,
257 double* basis_values=0)
const;
263 int con,
int func1,
int func2)
const;
269 int a1,
int b1,
int c1,
270 int a2,
int b2,
int c2)
const;
288 virtual boost::property_tree::ptree& write_xml(
289 boost::property_tree::ptree& parent,
const XMLWriter& writer
301 template <
typename Filter>
305 std::vector<unsigned int> am;
306 std::vector<bool> pure;
310 am.push_back(shell.
am(c));
311 pure.push_back(shell.
is_pure(c));
317 std::vector<double> coefs(am.size() * shell.
nprimitive());
CartesianIter gives the ordering of the Cartesian functions within a shell for the particular integra...
Definition cartiter.h:35
Classes which need runtime information about themselves and their relationship to other classes can v...
Definition class.h:233
static std::ostream & out0()
Return an ostream that writes from node 0.
A shell of Gaussian functions.
Definition gaussshell.h:57
void print(std::ostream &=ExEnv::out0()) const
Print the object.
int contraction_to_function(int c) const
Returns the number of the first function in the given contraction.
Definition gaussshell.h:228
unsigned int nprimitive() const
The number of primitive Gaussian shells.
Definition gaussshell.h:187
unsigned int min_am() const
The minimum angular momentum of any contraction.
Definition gaussshell.h:205
unsigned int am(int con) const
The angular momentum of the given contraction.
Definition gaussshell.h:201
const std::vector< double > & exponents() const
Returns the exponents.
Definition gaussshell.h:240
bool is_cartesian(int con) const
Returns nonzero if contraction con is Cartesian.
Definition gaussshell.h:218
int max_cartesian() const
The maximum number of Cartesian functions in any contraction.
const std::vector< unsigned int > & am() const
The angular momenta of contractions.
Definition gaussshell.h:199
friend void FromStateIn(GaussianShell &s, StateIn &si, int &count)
reads GaussianShell from sc::StateIn
double coefficient_norm(int con, int prim) const
Returns the contraction coef for normalized primitives.
GaussianShell(const Ref< KeyVal > &kv, int pure=-1)
Construct a GaussianShell object from KeyVal input.
DEPRECATED GaussianShell(int ncn, int nprm, double *e, int *am, int *pure, double **c, PrimitiveType pt=GaussianShell::Normalized, bool do_normalize_shell=true)
int grad_values(CartesianIter **, SphericalTransformIter **, const SCVector3 &R, double *g_values, double *basis_values=0) const
Like values(...), but computes gradients of the basis function values, too.
unsigned int nfunction(int con) const
The number of basis functions coming from the given contraction.
const std::vector< bool > & is_pure() const
Vector of booleans that indicate whether each contraction is solid harmonics.
Definition gaussshell.h:224
char amchar(int con) const
The character symbol for the angular momentum of the given contraction.
Definition gaussshell.h:207
double relative_overlap(int con, int a1, int b1, int c1, int a2, int b2, int c2) const
Returns the intra-generalized-contraction overlap matrix element <con func1|con func2> within an arbi...
double coefficient_unnorm(int con, int prim) const
Returns the contraction coef for unnormalized primitives.
Definition gaussshell.h:232
bool has_pure() const
Returns true if any contraction is solid harmonics.
Definition gaussshell.h:226
double extent(double threshold) const
Returns a radius.
int function_to_contraction(int f) const
Returns the contraction to which this function belongs.
Definition gaussshell.h:230
unsigned int ncontraction() const
The number of contractions formed from the primitives.
Definition gaussshell.h:189
static double epsilon()
Definition gaussshell.h:63
GaussianShell(const GaussianShell &other)
Copy constructor (deep :-)
DEPRECATED GaussianShell(int ncn, int nprm, double *e, int *am, GaussianType pure, double **c, PrimitiveType pt=GaussianShell::Normalized)
static GaussianShell unit()
bool is_pure(int con) const
Returns true if contraction con is solid harmonics.
Definition gaussshell.h:222
const std::vector< double > & coefficient_unnorm_block() const
returns coefficients for unnormalization primitives, in block form
Definition gaussshell.h:236
friend void ToStateOut(const GaussianShell &s, StateOut &so, int &count)
writes GaussianShell to sc::StateOut
unsigned int ncartesian_with_aminc(int aminc) const
The total number of Cartesian functions if this shift is applied to all of the angular momentums.
int max_angular_momentum() const
The maximum angular momentum in the shell.
Definition gaussshell.h:193
int min_angular_momentum() const
The minimum angular momentum in the shell.
Definition gaussshell.h:195
unsigned int max_am() const
The maximum angular momentum of any contraction.
Definition gaussshell.h:203
unsigned int ncartesian() const
The total number of functions if this shell was Cartesian.
Definition gaussshell.h:211
double monobound(double r) const
Returns a bound for the basis function.
int hessian_values(CartesianIter **, SphericalTransformIter **, const SCVector3 &R, 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 values(CartesianIter **, SphericalTransformIter **, const SCVector3 &r, double *basis_values)
Compute the values for this shell at position r.
double relative_overlap(const Ref< Integral > &, int con, int func1, int func2) const
Returns the intra-generalized-contraction overlap matrix element <con func1|con func2> within an arbi...
bool has_cartesian() const
Returns nonzero if any contraction is Cartesian.
Definition gaussshell.h:220
GaussianShell(const std::vector< unsigned int > &am, const std::vector< bool > &puream, const std::vector< double > &exps, const std::vector< double > &contr_coefs, PrimitiveType pt=GaussianShell::Normalized, bool normalize_shell=true)
Constructs GaussianShell programmatically.
bool equiv(const GaussianShell &s) const
Returns true if this and the argument are equivalent.
double exponent(int iprim) const
Returns the exponents of the given primitive.
Definition gaussshell.h:238
unsigned int nfunction() const
The number of basis functions.
Definition gaussshell.h:191
unsigned int ncartesian(int con) const
The number of Cartesian functions for the given contraction.
Definition gaussshell.h:216
A template class that maintains references counts.
Definition ref.h:361
a 3-element version of SCVector
Definition vector3.h:44
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 xmlwriter.h:223
GaussianShell filter(const GaussianShell &shell, Filter f)
constructs a new GaussianShell from shell by applying Filter filter
Definition gaussshell.h:302
SpinCase1 other(SpinCase1 S)
given 1-spin return the other 1-spin
void FromStateIn(Atom &a, StateIn &si, int &count)
reads Atom from sc::StateIn
void ToStateOut(const Atom &a, StateOut &so, int &count)
writes Atom to sc::StateOut
Contains all MPQC code up to version 3.
Definition mpqcin.h:14