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 program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License along
22  * with this program; if not, write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24  *
25  * @END LICENSE
26  */
27 
28 #ifndef _psi_src_lib_libmints_onebody_h_
29 #define _psi_src_lib_libmints_onebody_h_
30 
31 #include <vector>
32 #ifdef _POSIX_C_SOURCE
33 #undef _POSIX_C_SOURCE
34 #endif
35 #ifdef _XOPEN_SOURCE
36 #undef _XOPEN_SOURCE
37 #endif
39 #include "typedefs.h"
40 #include "psi4/libmints/vector3.h"
41 
43 
44 namespace psi {
45 
46 class IntegralFactory;
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:240
virtual void compute_pair(const GaussianShell &s1, const GaussianShell &s2)=0
std::shared_ptr< BasisSet > basis1()
Basis set on center one.
Definition: onebody.cc:101
OneBodyAOInt(std::vector< SphericalTransform > &, std::shared_ptr< BasisSet > bs1, std::shared_ptr< BasisSet > bs2, int deriv=0)
Definition: onebody.cc:77
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:246
void normalize_am(const GaussianShell &, const GaussianShell &, int nchunk=1)
Normalize Cartesian functions based on angular momentum.
Definition: onebody.cc:126
virtual bool has_deriv2()
Does the method provide second derivatives?
Definition: onebody.h:127
int buffer_size_
Definition: onebody.h:77
Definition: vector3.h:36
virtual ~OneBodyAOInt()
Definition: onebody.cc:90
double * target_
Definition: onebody.h:65
virtual void compute_pair_deriv1(const GaussianShell &s1, const GaussianShell &s2)
Definition: onebody.cc:235
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:157
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:343
std::shared_ptr< BasisSet > basis2()
Basis set on center two.
Definition: onebody.cc:106
std::shared_ptr< BasisSet > bs2_
Definition: onebody.h:59
void compute(SharedMatrix &result)
Definition: onebody.cc:262
Gaussian orbital shell.
Definition: gshell.h:191
std::shared_ptr< BasisSet > basis()
Basis set on center one.
Definition: onebody.cc:96
std::shared_ptr< Matrix > SharedMatrix
Definition: adc.h:50
virtual void compute_shell_deriv2(int, int)
Computes the integrals between basis function in the given shell pair.
Definition: onebody.cc:462
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:116
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:111
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:121
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:403
void compute_shell(int, int)
Compute the integrals between basis function in the given shell pair.
Definition: onebody.cc:216
unsigned int count_
Definition: onebody.h:71
int nchunk_
Definition: onebody.h:75