MADNESS  version 0.9
chem/molecularbasis.h
Go to the documentation of this file.
1 /*
2  This file is part of MADNESS.
3 
4  Copyright (C) 2007,2010 Oak Ridge National Laboratory
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 
20  For more information please contact:
21 
22  Robert J. Harrison
23  Oak Ridge National Laboratory
24  One Bethel Valley Road
25  P.O. Box 2008, MS-6367
26 
27  email: harrisonrj@ornl.gov
28  tel: 865-241-3937
29  fax: 865-572-0680
30 
31  $Id$
32 */
33 #ifndef MADNESS_CHEM_MOLECULAR_BASIS_H__INCLUDED
34 #define MADNESS_CHEM_MOLECULAR_BASIS_H__INCLUDED
35 
36 #include <madness/madness_config.h>
37 #include <madness/constants.h>
38 #include <chem/molecule.h>
39 #include <chem/atomutil.h>
41 #include <madness/tensor/tensor.h>
42 
43 #include <vector>
44 #include <algorithm>
45 #include <iostream>
46 #include <sstream>
47 #include <iomanip>
48 #include <cstdio>
49 
50 namespace madness {
53  int type;
54  std::vector<double> coeff;
55  std::vector<double> expnt;
56  double rsqmax;
57  int numbf;
58 
59  void normalize() {
60  // nwcchem cartesian normalization conventions
61  // translation of nmcoeff.F into python and thence to c++
62  int np = coeff.size();
63  if (np == 1) coeff[0] = 1.0e0;
64 
65  double pi32=pow(madness::constants::pi,1.5);
66  int l_lim = 2*type - 1;
67  double f = 1.0e00;
68  for (int n=l_lim; n>1; n-=2) f *= n;
69 
70  for (int n=0; n<np; ++n)
71  coeff[n] *= pow(2.e0*expnt[n]/madness::constants::pi,0.75e0)*pow(4.e0*expnt[n],0.5E0*type)/sqrt(f);
72 
73  double sum = 0.0;
74  for (int n1=0; n1<np; ++n1) {
75  for (int n2=0; n2<np; ++n2) {
76  double S =pi32/pow(expnt[n1]+expnt[n2],1.5e0+type)/pow(2e0,type);
77  sum = sum + coeff[n1]*coeff[n2]*S;
78  }
79  }
80  sum *= f;
81 
82  f = 1e0/sqrt(sum);
83  for (int n=0; n<np; ++n) coeff[n] *= f;
84  }
85 
86 public:
88  : type(-1), coeff(), expnt(), rsqmax(0.0), numbf(0) {};
89 
91  const std::vector<double>& coeff,
92  const std::vector<double>& expnt,
93  bool donorm=true)
94  : type(type), coeff(coeff), expnt(expnt), numbf((type+1)*(type+2)/2) {
95  if (donorm) normalize();
96  double minexpnt = expnt[0];
97  for (unsigned int i=1; i<expnt.size(); ++i)
98  minexpnt = std::min(minexpnt,expnt[i]);
99  rsqmax = 27.6/minexpnt; // 27.6 = log(1e12)
100  }
101 
102 
104  double rangesq() const {
105  return rsqmax;
106  }
107 
108 
110  double eval_radial(double rsq) const {
111  if (rsq > rsqmax) return 0.0;
112  double sum = 0.0;
113  for (unsigned int i=0; i<coeff.size(); ++i) {
114  double ersq = expnt[i]*rsq;
115  if (ersq < 27.6) sum += coeff[i]*exp(-ersq); // 27.6 = log(1e12)
116  }
117  return sum;
118  }
119 
120 
122  double* eval(double rsq, double x, double y, double z, double* bf) const {
123  double R = eval_radial(rsq);
124  if (fabs(R) < 1e-12) {
125  for (int i=0; i<numbf; ++i) bf[i] = 0.0;
126 
127  }
128  else {
129  switch (type) {
130  case 0:
131  bf[0] = R;
132  break;
133  case 1:
134  bf[0] = R*x;
135  bf[1] = R*y;
136  bf[2] = R*z;
137  break;
138  case 2:
139  { // braces need by some compilers to limit scope of fac
140  static const double fac = 1.0; //sqrt(3.0);
141  bf[0] = R*x*x;
142  bf[1] = R*x*y*fac;
143  bf[2] = R*x*z*fac;
144  bf[3] = R*y*y;
145  bf[4] = R*y*z*fac;
146  bf[5] = R*z*z;
147  }
148  break;
149  case 3:
150  bf[0] = R*x*x*x;
151  bf[1] = R*x*x*y;
152  bf[2] = R*x*x*z;
153  bf[3] = R*x*y*y;
154  bf[4] = R*x*y*z;
155  bf[5] = R*x*z*z;
156  bf[6] = R*y*y*y;
157  bf[7] = R*y*y*z;
158  bf[8] = R*y*z*z;
159  bf[9] = R*z*z*z;
160  break;
161 
162  default:
163  throw "UNKNOWN ANGULAR MOMENTUM";
164  }
165  }
166  return bf+numbf;
167  }
168 
169 
171  int angular_momentum() const {
172  return type;
173  }
174 
176  int nbf() const {
177  return numbf;
178  }
179 
181  int nprim() const {
182  return coeff.size();
183  }
184 
186  const std::vector<double>& get_coeff() const {
187  return coeff;
188  }
189 
191  const std::vector<double>& get_expnt() const {
192  return expnt;
193  }
194 
196  const char* get_desc(int ibf) const {
197  static const char* tags[4][10] = {
198  {"s" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" ,"" } ,
199  {"px" ,"py" ,"pz" ,"" ,"" ,"" ,"" ,"" ,"" ,"" } ,
200  {"dxx" ,"dxy" ,"dxz" ,"dyy" ,"dyz" ,"dzz" ,"" ,"" ,"" ,"" } ,
201  {"fxxx","fxxy","fxxz","fxyy","fxyz","fxzz","fxzz","fyyy","fyzz","fzzz"}
202  };
203  MADNESS_ASSERT(ibf<numbf && ibf >= 0);
204  return tags[type][ibf];
205  }
206 
207  template <typename Archive>
208  void serialize(Archive& ar) {
209  ar & type & coeff & expnt & rsqmax & numbf;
210  }
211 };
212 
214 class AtomicBasis {
215  std::vector<ContractedGaussianShell> g;
216  double rmaxsq;
217  int numbf;
218  Tensor<double> dmat, avec, bvec;
219 
220 public:
221  AtomicBasis() : g(), rmaxsq(0.0), numbf(0) {};
222 
223  AtomicBasis(const std::vector<ContractedGaussianShell>& g)
224  : g(g) {
225  rmaxsq = 0.0;
226  numbf = 0;
227  for (unsigned int i=0; i<g.size(); ++i) {
228  rmaxsq = std::max(rmaxsq, g[i].rangesq());
229  numbf += g[i].nbf();
230  }
231  }
232 
233  void set_guess_info(const Tensor<double>& dmat,
234  const Tensor<double>& avec, const Tensor<double>& bvec) {
235  this->dmat = copy(dmat);
236  this->avec = copy(avec);
237  this->bvec = copy(bvec);
238  }
239 
241  int nbf() const {
242  return numbf;
243  }
244 
246  int nshell() const {
247  return g.size();
248  }
249 
251  const std::vector<ContractedGaussianShell>& get_shells() const {
252  return g;
253  };
254 
256 
260  double* eval(double x, double y, double z, double* bf) const {
261  double rsq = x*x + y*y + z*z;
262  if (rsq > rmaxsq) {
263  for (int i=0; i<numbf; ++i) bf[i] = 0.0;
264  return bf+numbf;
265  }
266 
267  double* bfstart = bf;
268  for (unsigned int i=0; i<g.size(); ++i) {
269  bf = g[i].eval(rsq, x, y, z, bf);
270  }
271  // paranoia is good
272  MADNESS_ASSERT(bf-bfstart == numbf);
273  return bf;
274  }
275 
277  double eval_guess_density(double x, double y, double z) const {
278  MADNESS_ASSERT(has_guess_info());
279  double rsq = x*x + y*y + z*z;
280  if (rsq > rmaxsq) return 0.0;
281 
282  double bf[numbf];
283  eval(x, y, z, bf);
284  const double* p = dmat.ptr();
285  double sum = 0.0;
286  for (int i=0; i<numbf; ++i, p+=numbf) {
287  double sumj = 0.0;
288  for (int j=0; j<numbf; ++j)
289  sumj += p[j]*bf[j];
290  sum += bf[i]*sumj;
291  }
292  return sum;
293  }
294 
296  const ContractedGaussianShell& get_shell_from_basis_function(int ibf, int& ibf_in_shell) const {
297  int n=0;
298  for (unsigned int i=0; i<g.size(); ++i) {
299  int nbf_in_shell = g[i].nbf();
300  if (ibf>=n && ibf<(n+nbf_in_shell)) {
301  ibf_in_shell = ibf-n;
302  return g[i];
303  }
304  else {
305  n += g[i].nbf();
306  }
307  }
308  MADNESS_EXCEPTION("AtomicBasis: get_shell_from_basis_function", ibf*100000 + nbf());
309  }
310 
311  bool has_guess_info() const {
312  return dmat.size()>0;
313  }
314 
315  const Tensor<double>& get_dmat() const {
316  return dmat;
317  };
318 
319  const Tensor<double>& get_avec() const {
320  return avec;
321  };
322 
323  const Tensor<double>& get_bvec() const {
324  return bvec;
325  };
326 
327  template <typename Archive>
328  void serialize(Archive& ar) {
329  ar & g & rmaxsq & numbf & dmat & avec & bvec;
330  }
331 
332 };
333 
336 private:
337  const double xx, yy, zz; // Coordinates of the center
338  const ContractedGaussianShell& shell; // Reference to the underlying atomic shell
339  const int ibf; // Index of basis function in the shell (0, 1, ...)
340  const int nbf; // Number of functions in the shell
341 
342 public:
343  AtomicBasisFunction(double x, double y, double z,
344  const ContractedGaussianShell& shell, int ibf)
345  : xx(x), yy(y), zz(z), shell(shell), ibf(ibf), nbf(shell.nbf()) {}
346 
347 
349  : xx(aofunc.xx)
350  , yy(aofunc.yy)
351  , zz(aofunc.zz)
352  , shell(aofunc.shell)
353  , ibf(aofunc.ibf)
354  , nbf(aofunc.nbf) {}
355 
356  double operator()(double x, double y, double z) const {
357  double bf[nbf];
358  x-=xx;
359  y-=yy;
360  z-=zz;
361  double rsq = x*x + y*y + z*z;
362  shell.eval(rsq, x, y, z, bf);
363  return bf[ibf];
364  }
365 
366  void print_me(std::ostream& s) const;
367 
369  return shell;
370  }
371 
372  int get_index() const {
373  return ibf;
374  }
375 
376  const char* get_desc() const {
377  return shell.get_desc(ibf);
378  }
379 
380  void get_coords(double& x, double& y, double& z) const {
381  x=xx; y=yy; z=zz;
382  return;
383  }
384 
386  return madness::vec(xx, yy, zz);
387  }
388 };
389 
392  std::string name;
393  std::vector<AtomicBasis> ag; //< Basis associated by atomic number = 1, 2, ...; 0=Bq.
394 
395  template <typename T>
396  std::vector<T> load_tixml_vector(TiXmlElement* node, int n, const char* name) {
397  TiXmlElement* child = node->FirstChildElement(name);
398  MADNESS_ASSERT(child);
399  std::istringstream s(child->GetText());
400  std::vector<T> r(n);
401  for (int i=0; i<n; ++i) {
402  MADNESS_ASSERT(s >> r[i]);
403  }
404  return r;
405  }
406 
407  template <typename T>
408  Tensor<T> load_tixml_matrix(TiXmlElement* node, int n, int m, const char* name) {
409  TiXmlElement* child = node->FirstChildElement(name);
410  MADNESS_ASSERT(child);
411  std::istringstream s(child->GetText());
412  Tensor<T> r(n,m);
413  for (int i=0; i<n; ++i) {
414  for (int j=0; j<m; ++j) {
415  MADNESS_ASSERT(s >> r(i,j));
416  }
417  }
418  return r;
419  }
420 
421 public:
422  AtomicBasisSet() : name("unknown"), ag(110) {}
423 
424 
425  AtomicBasisSet(std::string filename) : name(""), ag(110) {
426  read_file(filename);
427  }
428 
430 
434  void read_file(std::string filename);
435 
437  void atoms_to_bfn(const Molecule& molecule, std::vector<int>& at_to_bf, std::vector<int>& at_nbf) {
438  at_to_bf = std::vector<int>(molecule.natom());
439  at_nbf = std::vector<int>(molecule.natom());
440 
441  int n = 0;
442  for (int i=0; i<molecule.natom(); ++i) {
443  const Atom& atom = molecule.get_atom(i);
444  const int atn = atom.atomic_number;
445  MADNESS_ASSERT(is_supported(atn));
446  at_to_bf[i] = n;
447  at_nbf[i] = ag[atn].nbf();
448  n += at_nbf[i];
449  }
450  }
451 
452 
454  int basisfn_to_atom(const Molecule& molecule, int ibf) const {
455  MADNESS_ASSERT(ibf >= 0);
456  int n = 0;
457  for (int i=0; i<molecule.natom(); ++i) {
458  // Is the desired function on this atom?
459  const Atom& atom = molecule.get_atom(i);
460  const int atn = atom.atomic_number;
461  MADNESS_ASSERT(is_supported(atn));
462  const int nbf_on_atom = ag[atn].nbf();
463  if (ibf >= n && (n+nbf_on_atom) > ibf) {
464  return i;
465  }
466  else {
467  n += nbf_on_atom;
468  }
469  }
470  MADNESS_EXCEPTION("AtomicBasisSet: get_atomic_basis_function: confused?", ibf);
471  }
472 
474  AtomicBasisFunction get_atomic_basis_function(const Molecule& molecule, int ibf) const {
475  MADNESS_ASSERT(ibf >= 0);
476  int n = 0;
477  for (int i=0; i<molecule.natom(); ++i) {
478  // Is the desired function on this atom?
479  const Atom& atom = molecule.get_atom(i);
480  const int atn = atom.atomic_number;
481  MADNESS_ASSERT(is_supported(atn));
482  const int nbf_on_atom = ag[atn].nbf();
483  if (ibf >= n && (n+nbf_on_atom) > ibf) {
484  int index;
485  const ContractedGaussianShell& shell =
486  ag[atn].get_shell_from_basis_function(ibf-n, index);
487  return AtomicBasisFunction(atom.x, atom.y, atom.z, shell, index);
488  }
489  else {
490  n += nbf_on_atom;
491  }
492  }
493  MADNESS_EXCEPTION("AtomicBasisSet: get_atomic_basis_function: confused?", ibf);
494  }
495 
496 
498  int nbf(const Molecule& molecule) const {
499  int n = 0;
500  for (int i=0; i<molecule.natom(); ++i) {
501  const Atom& atom = molecule.get_atom(i);
502  const int atn = atom.atomic_number;
503  MADNESS_ASSERT(is_supported(atn));
504  n += ag[atn].nbf();
505  }
506  return n;
507  }
508 
510  void eval(const Molecule& molecule, double x, double y, double z, double *bf) const {
511  for (int i=0; i<molecule.natom(); ++i) {
512  const Atom& atom = molecule.get_atom(i);
513  const int atn = atom.atomic_number;
514  bf = ag[atn].eval(x-atom.x, y-atom.y, z-atom.z, bf);
515  }
516  }
517 
518 
520  double eval_guess_density(const Molecule& molecule, double x, double y, double z) const {
521  double sum = 0.0;
522  for (int i=0; i<molecule.natom(); ++i) {
523  const Atom& atom = molecule.get_atom(i);
524  const int atn = atom.atomic_number;
525  sum += ag[atn].eval_guess_density(x-atom.x, y-atom.y, z-atom.z);
526  }
527  return sum;
528  }
529 
530  bool is_supported(int atomic_number) const {
531  return ag[atomic_number].nbf() > 0;
532  }
533 
535  void print(const Molecule& molecule) const;
536 
537  template <typename T>
539  const Tensor<T> v;
540  public:
541  AnalysisSorter(const Tensor<T>& v) : v(v) {}
542  bool operator()(long i, long j) const {
543  return std::abs(v[i]) > std::abs(v[j]);
544  }
545  };
546 
548 
555  template <typename T>
556  void print_anal(const Molecule& molecule, const Tensor<T>& v) {
557  const double thresh = 0.2*v.normf();
558  if (thresh == 0.0) {
559  printf(" zero vector\n");
560  return;
561  }
562  long nbf = int(v.dim(0));
563  long list[nbf];
564  long ngot=0;
565  for (long i=0; i<nbf; ++i) {
566  if (std::abs(v(i)) > thresh) {
567  list[ngot++] = i;
568  }
569  }
570  std::sort(list,list+ngot,AnalysisSorter<T>(v));
571 
572  const char* format;
573  if (molecule.natom() < 10) {
574  format = " %2s(%1d)%4s(%2ld)%6.3f ";
575  }
576  else if (molecule.natom() < 100) {
577  format = " %2s(%2d)%4s(%3ld)%6.3f ";
578  }
579  else if (molecule.natom() < 1000) {
580  format = " %2s(%3d)%4s(%4ld)%6.3f ";
581  }
582  else {
583  format = " %2s(%4d)%4s(%5ld)%6.3f ";
584  }
585  printf(" ");
586  for (long ii=0; ii<ngot; ++ii) {
587  long ibf = list[ii];
588 
589  const int iat = basisfn_to_atom(molecule, ibf);
590  const Atom& atom = molecule.get_atom(iat);
591  const AtomicBasisFunction ao = get_atomic_basis_function(molecule, ibf);
592  const char* desc = ao.get_desc();
593  const char* element = get_atomic_data(atom.atomic_number).symbol;
594 
595  // This will need wrapping in a template for a complex MO vector
596  printf(format, element, iat, desc, ibf, v[ibf]);
597  }
598  printf("\n");
599  }
600 
602  void print_all() const;
603 
604  template <typename Archive>
605  void serialize(Archive& ar) {
606  ar & name & ag;
607  }
608 };
609 }
610 
611 
612 #endif
int np
Definition: tdse1d.cc:166
const double thresh
Definition: dielectric.cc:185
AtomicBasis()
Definition: chem/molecularbasis.h:221
const mpreal exp(const mpreal &v, mp_rnd_t rnd_mode)
Definition: mpreal.h:2234
int get_index() const
Definition: chem/molecularbasis.h:372
const double pi
Mathematical constant pi.
Definition: constants.h:44
const double R
Definition: dielectric.cc:191
double eval_guess_density(double x, double y, double z) const
Evaluates the guess atomic density at point x, y, z relative to atomic center.
Definition: chem/molecularbasis.h:277
const ContractedGaussianShell & get_shell_from_basis_function(int ibf, int &ibf_in_shell) const
Return shell that contains basis function ibf and also return index of function in the shell...
Definition: chem/molecularbasis.h:296
const ContractedGaussianShell & get_shell() const
Definition: chem/molecularbasis.h:368
const char *const symbol
Definition: chem/atomutil.h:54
double z
Definition: chem/molecule.h:57
double rangesq() const
Returns square of the distance beyond which function is less than 1e-8.
Definition: chem/molecularbasis.h:104
::std::string string
Definition: gtest-port.h:872
double operator()(double x, double y, double z) const
Definition: chem/molecularbasis.h:356
Defines common mathematical and physical constants.
void print_me(std::ostream &s) const
Definition: chem/molecularbasis.cc:73
void eval(const Molecule &molecule, double x, double y, double z, double *bf) const
Evaluates the basis functions.
Definition: chem/molecularbasis.h:510
double eval_radial(double rsq) const
Evaluates the radial part of the contracted function.
Definition: chem/molecularbasis.h:110
AtomicBasis(const std::vector< ContractedGaussianShell > &g)
Definition: chem/molecularbasis.h:223
const Tensor< double > & get_bvec() const
Definition: chem/molecularbasis.h:323
AtomicBasisFunction(double x, double y, double z, const ContractedGaussianShell &shell, int ibf)
Definition: chem/molecularbasis.h:343
int nprim() const
Returns the number of primitives in the contraction.
Definition: chem/molecularbasis.h:181
NDIM & f
Definition: mra.h:2179
AtomicBasisFunction get_atomic_basis_function(const Molecule &molecule, int ibf) const
Returns the ibf'th atomic basis function.
Definition: chem/molecularbasis.h:474
Represents multiple shells of contracted gaussians on a single center.
Definition: chem/molecularbasis.h:214
AtomicBasisSet(std::string filename)
Definition: chem/molecularbasis.h:425
AtomicBasisFunction(const AtomicBasisFunction &aofunc)
Definition: chem/molecularbasis.h:348
Defines and implements most of Tensor.
void print_anal(const Molecule &molecule, const Tensor< T > &v)
Given a vector of AO coefficients prints an analysis.
Definition: chem/molecularbasis.h:556
madness::Vector< double, 3 > get_coords_vec() const
Definition: chem/molecularbasis.h:385
int natom() const
Definition: chem/molecule.h:148
Represents a single shell of contracted, Cartesian, Gaussian primitives.
Definition: chem/molecularbasis.h:52
const AtomicData & get_atomic_data(unsigned int atomic_number)
Definition: chem/atomutil.cc:160
int nshell() const
Returns the number of shells on the center.
Definition: chem/molecularbasis.h:246
const std::vector< double > & get_expnt() const
Returns a const reference to the exponents.
Definition: chem/molecularbasis.h:191
int nbf(const Molecule &molecule) const
Given a molecule count the number of basis functions.
Definition: chem/molecularbasis.h:498
#define max(a, b)
Definition: lda.h:53
Vector< T, 1 > vec(T x)
Your friendly neighborhood factory function.
Definition: array.h:456
const char * get_desc(int ibf) const
Returns a string description of the basis function type.
Definition: chem/molecularbasis.h:196
Used to represent one basis function from a shell on a specific center.
Definition: chem/molecularbasis.h:335
void read_file(std::string filename)
read the atomic basis set from file
Definition: chem/molecularbasis.cc:107
Function< T, NDIM > copy(const Function< T, NDIM > &f, const std::shared_ptr< WorldDCPmapInterface< Key< NDIM > > > &pmap, bool fence=true)
Create a new copy of the function with different distribution and optional fence. ...
Definition: mra.h:1835
const mpreal min(const mpreal &x, const mpreal &y)
Definition: mpreal.h:2675
const TiXmlElement * FirstChildElement() const
Convenience function to get through elements.
Definition: tinyxml.cc:431
Definition: chem/molecularbasis.h:538
unsigned int atomic_number
Atomic number.
Definition: chem/molecule.h:58
const char * get_desc() const
Definition: chem/molecularbasis.h:376
int basisfn_to_atom(const Molecule &molecule, int ibf) const
Returns the number of the atom the ibf'th basis function is on.
Definition: chem/molecularbasis.h:454
bool is_supported(int atomic_number) const
Definition: chem/molecularbasis.h:530
tensorT sqrt(const tensorT &s, double tol=1e-8)
Computes matrix square root (not used any more?)
Definition: DFcode/moldft.cc:446
bool has_guess_info() const
Definition: chem/molecularbasis.h:311
double x
Definition: chem/molecule.h:57
void serialize(Archive &ar)
Definition: chem/molecularbasis.h:328
Definition: chem/molecule.h:55
double eval_guess_density(const Molecule &molecule, double x, double y, double z) const
Evaluates the guess density.
Definition: chem/molecularbasis.h:520
double * eval(double rsq, double x, double y, double z, double *bf) const
Evaluates the entire shell returning the incremented result pointer.
Definition: chem/molecularbasis.h:122
ContractedGaussianShell()
Definition: chem/molecularbasis.h:87
double y
Definition: chem/molecule.h:57
bool operator()(long i, long j) const
Definition: chem/molecularbasis.h:542
const mpreal sum(const mpreal tab[], unsigned long int n, mp_rnd_t rnd_mode)
Definition: mpreal.cc:241
const double m
Definition: gfit.cc:199
Definition: chem/molecule.h:83
int nbf() const
Returns the number of basis functions on the center.
Definition: chem/molecularbasis.h:241
void print_all() const
Print basis info for all supported atoms.
Definition: chem/molecularbasis.cc:97
Contracted Gaussian basis.
Definition: chem/molecularbasis.h:391
const Tensor< double > & get_dmat() const
Definition: chem/molecularbasis.h:315
double E0(double p)
Definition: gfit.cc:203
void serialize(Archive &ar)
Definition: chem/molecularbasis.h:208
const std::vector< double > & get_coeff() const
Returns a const reference to the coefficients.
Definition: chem/molecularbasis.h:186
#define MADNESS_EXCEPTION(msg, value)
Definition: worldexc.h:88
const char * GetText() const
Definition: tinyxml.cc:871
void atoms_to_bfn(const Molecule &molecule, std::vector< int > &at_to_bf, std::vector< int > &at_nbf)
Makes map from atoms to first basis function on atom and number of basis functions on atom...
Definition: chem/molecularbasis.h:437
AtomicBasisSet()
Definition: chem/molecularbasis.h:422
void serialize(Archive &ar)
Definition: chem/molecularbasis.h:605
const std::vector< ContractedGaussianShell > & get_shells() const
Returns a const reference to the shells.
Definition: chem/molecularbasis.h:251
const mpreal fabs(const mpreal &v, mp_rnd_t rnd_mode)
Definition: mpreal.h:2187
Holds machinery to set up Functions/FuncImpls using various Factories and Interfaces.
Definition: chem/atomutil.cc:45
ContractedGaussianShell(int type, const std::vector< double > &coeff, const std::vector< double > &expnt, bool donorm=true)
Definition: chem/molecularbasis.h:90
int angular_momentum() const
Returns the shell angular momentum.
Definition: chem/molecularbasis.h:171
void print(const Molecule &molecule) const
Print basis info for atoms in the molecule (once for each unique atom type)
Definition: chem/molecularbasis.cc:78
double * eval(double x, double y, double z, double *bf) const
Evaluates the basis functions at point x, y, z relative to atomic center.
Definition: chem/molecularbasis.h:260
AnalysisSorter(const Tensor< T > &v)
Definition: chem/molecularbasis.h:541
void get_coords(double &x, double &y, double &z) const
Definition: chem/molecularbasis.h:380
const Atom & get_atom(unsigned int i) const
Definition: chem/molecule.cc:223
const Tensor< double > & get_avec() const
Definition: chem/molecularbasis.h:319
Definition: tinyxml.h:945
void set_guess_info(const Tensor< double > &dmat, const Tensor< double > &avec, const Tensor< double > &bvec)
Definition: chem/molecularbasis.h:233
int nbf() const
Returns the number of basis functions in the shell.
Definition: chem/molecularbasis.h:176