Psi4
onebody.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Psi4: an open-source quantum chemistry software package
5  *
6  * Copyright (c) 2007-2017 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This file is part of Psi4.
12  *
13  * Psi4 is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser General Public License as published by
15  * the Free Software Foundation, version 3.
16  *
17  * Psi4 is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License along
23  * with Psi4; if not, write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25  *
26  * @END LICENSE
27  */
28 
29 #ifndef _psi_src_lib_libmints_onebody_h_
30 #define _psi_src_lib_libmints_onebody_h_
31 
32 #include <vector>
33 #ifdef _POSIX_C_SOURCE
34 #undef _POSIX_C_SOURCE
35 #endif
36 #ifdef _XOPEN_SOURCE
37 #undef _XOPEN_SOURCE
38 #endif
40 #include "typedefs.h"
41 #include "psi4/libmints/vector3.h"
42 
44 
45 namespace psi {
46 
47 class BasisSet;
48 class GaussianShell;
49 class SphericalTransform;
50 
56 {
57 protected:
58  std::shared_ptr<BasisSet> bs1_;
59  std::shared_ptr<BasisSet> bs2_;
60  std::vector<SphericalTransform>& spherical_transforms_;
61 
63 
64  double *buffer_;
65  double *target_;
66  double *tformbuf_;
67 
70 
71  unsigned int count_;
72  int deriv_;
73  int natom_;
74 
75  int nchunk_;
76 
78 
79  OneBodyAOInt(std::vector<SphericalTransform>&, std::shared_ptr<BasisSet> bs1, std::shared_ptr<BasisSet> bs2, int deriv=0);
80 
81  virtual void compute_pair(const GaussianShell& s1, const GaussianShell& s2) = 0;
82  virtual void compute_pair_deriv1(const GaussianShell& s1, const GaussianShell& s2);
83  virtual void compute_pair_deriv2(const GaussianShell& s1, const GaussianShell& s2);
84 
85  void set_chunks(int nchunk) { nchunk_ = nchunk; }
86  void pure_transform(const GaussianShell&, const GaussianShell&, int=1);
87 
89  void normalize_am(const GaussianShell&, const GaussianShell&, int nchunk=1);
90 
91 public:
92  virtual ~OneBodyAOInt();
93 
95  std::shared_ptr<BasisSet> basis();
97  std::shared_ptr<BasisSet> basis1();
99  std::shared_ptr<BasisSet> basis2();
100 
102  int nchunk() const { return nchunk_; }
103 
105  void set_force_cartesian(bool t_f) { force_cartesian_ = t_f; }
106 
108  const double *buffer() const;
109 
111  void compute_shell(int, int);
112 
117  void compute(SharedMatrix& result);
120  virtual void compute(std::vector<SharedMatrix > &result);
122 
124  virtual bool has_deriv1() { return false; }
125 
127  virtual bool has_deriv2() { return false; }
128 
130  int deriv() const { return deriv_; }
131 
133  virtual void compute_deriv1(std::vector<SharedMatrix > &result);
134 
136  virtual void compute_deriv2(std::vector<SharedMatrix > &result);
137 
139  virtual void compute_shell_deriv1(int, int);
141  virtual void compute_shell_deriv2(int, int);
142 
144  virtual bool cloneable() const;
145 
147  virtual OneBodyAOInt* clone() const;
148 
150  Vector3 origin() const { return origin_; }
151 
153  void set_origin(const Vector3& _origin) { origin_ = _origin; }
154 };
155 
156 typedef std::shared_ptr<OneBodyAOInt> SharedOneBodyAOInt;
157 }
158 
159 #endif
void set_chunks(int nchunk)
Definition: onebody.h:85
Definition: onebody.h:55
virtual void compute_pair_deriv2(const GaussianShell &s1, const GaussianShell &s2)
Definition: onebody.cc:241
virtual void compute_pair(const GaussianShell &s1, const GaussianShell &s2)=0
std::shared_ptr< BasisSet > basis1()
Basis set on center one.
Definition: onebody.cc:102
OneBodyAOInt(std::vector< SphericalTransform > &, std::shared_ptr< BasisSet > bs1, std::shared_ptr< BasisSet > bs2, int deriv=0)
Definition: onebody.cc:78
std::vector< SphericalTransform > & spherical_transforms_
Definition: onebody.h:60
void set_origin(const Vector3 &_origin)
Set the origin (useful for properties)
Definition: onebody.h:153
virtual void compute_shell_deriv1(int, int)
Computes the integrals between basis function in the given shell pair.
Definition: onebody.cc:247
void normalize_am(const GaussianShell &, const GaussianShell &, int nchunk=1)
Normalize Cartesian functions based on angular momentum.
Definition: onebody.cc:127
virtual bool has_deriv2()
Does the method provide second derivatives?
Definition: onebody.h:127
int buffer_size_
Definition: onebody.h:77
Definition: vector3.h:37
virtual ~OneBodyAOInt()
Definition: onebody.cc:91
double * target_
Definition: onebody.h:65
virtual void compute_pair_deriv1(const GaussianShell &s1, const GaussianShell &s2)
Definition: onebody.cc:236
std::shared_ptr< OneBodyAOInt > SharedOneBodyAOInt
Definition: onebody.h:156
Vector3 origin() const
Returns the origin (useful for properties)
Definition: onebody.h:150
double * tformbuf_
Definition: onebody.h:66
void pure_transform(const GaussianShell &, const GaussianShell &, int=1)
Definition: onebody.cc:158
int natom_
Definition: onebody.h:73
virtual void compute_deriv1(std::vector< SharedMatrix > &result)
Computes the first derivatives and stores them in result.
Definition: onebody.cc:344
std::shared_ptr< BasisSet > basis2()
Basis set on center two.
Definition: onebody.cc:107
std::shared_ptr< BasisSet > bs2_
Definition: onebody.h:59
void compute(SharedMatrix &result)
Definition: onebody.cc:263
Gaussian orbital shell.
Definition: gshell.h:222
std::shared_ptr< BasisSet > basis()
Basis set on center one.
Definition: onebody.cc:97
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:49
virtual void compute_shell_deriv2(int, int)
Computes the integrals between basis function in the given shell pair.
Definition: onebody.cc:463
int deriv_
Definition: onebody.h:72
virtual bool cloneable() const
Return true if the clone member can be called. By default returns false.
Definition: onebody.cc:117
Vector3 origin_
Definition: onebody.h:62
std::shared_ptr< BasisSet > bs1_
Definition: onebody.h:58
const double * buffer() const
Buffer where the integrals are placed.
Definition: onebody.cc:112
void set_force_cartesian(bool t_f)
Sets whether we&#39;re forcing this object to always generate Cartesian integrals.
Definition: onebody.h:105
virtual bool has_deriv1()
Does the method provide first derivatives?
Definition: onebody.h:124
bool force_cartesian_
Whether we want to always generate Cartesian integrals;.
Definition: onebody.h:69
int deriv() const
What order of derivative was requested?
Definition: onebody.h:130
virtual OneBodyAOInt * clone() const
Returns a clone of this object. By default throws an exception.
Definition: onebody.cc:122
int nchunk() const
Number of chunks. Normally 1, but dipoles (3) quadrupoles (6).
Definition: onebody.h:102
double * buffer_
Definition: onebody.h:64
virtual void compute_deriv2(std::vector< SharedMatrix > &result)
Computes the second derivatives and stores them in result.
Definition: onebody.cc:404
void compute_shell(int, int)
Compute the integrals between basis function in the given shell pair.
Definition: onebody.cc:217
unsigned int count_
Definition: onebody.h:71
int nchunk_
Definition: onebody.h:75