MPQC 3.0.0-alpha
Loading...
Searching...
No Matches
obint.h
1//
2// obint.h
3//
4// Copyright (C) 1996 Limit Point Systems, Inc.
5//
6// Author: Curtis Janssen <cljanss@limitpt.com>
7// Maintainer: LPS
8//
9// This file is part of the SC Toolkit.
10//
11// The SC Toolkit is free software; you can redistribute it and/or modify
12// it under the terms of the GNU Library General Public License as published by
13// the Free Software Foundation; either version 2, or (at your option)
14// any later version.
15//
16// The SC Toolkit 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 Library General Public License for more details.
20//
21// You should have received a copy of the GNU Library General Public License
22// along with the SC Toolkit; see the file COPYING.LIB. If not, write to
23// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24//
25// The U.S. Government is granted a limited license as per AL 91-7.
26//
27
28#ifndef _chemistry_qc_basis_obint_h
29#define _chemistry_qc_basis_obint_h
30
31#include <util/ref/ref.h>
32#include <util/state/state.h>
33#include <util/container/stdarray.h>
34#include <math/scmat/matrix.h>
35#include <math/scmat/elemop.h>
36
37#include <chemistry/qc/basis/gaussbas.h>
38#include <chemistry/qc/basis/dercent.h>
39#include <chemistry/qc/basis/intparams.h>
40
41namespace sc {
42
43class Integral;
44
45// //////////////////////////////////////////////////////////////////////////
46
49class OneBodyInt : public RefCount {
50 protected:
51 // this is who created me
52 Integral *integral_;
53
56
57 double *buffer_;
58
59 OneBodyInt(Integral *integral,
60 const Ref<GaussianBasisSet>&b1,
61 const Ref<GaussianBasisSet>&b2 = 0);
62
63 public:
64 virtual ~OneBodyInt();
65
67 int nbasis() const;
68
70 int nbasis1() const;
72 int nbasis2() const;
73
75 int nshell() const;
76
78 int nshell1() const;
80 int nshell2() const;
81
87
92
94 const double * buffer() const;
95
98 virtual void compute_shell(int,int) = 0;
99
103 std::pair<const double *, std::array<unsigned long, 2> > compute_shell_array(int,int);
104
107 virtual void reinitialize();
108
111 virtual bool cloneable() const;
112
116
117 Integral *integral() const { return integral_; }
118};
119
120// //////////////////////////////////////////////////////////////////////////
121
125 protected:
126 // this is who created me
127 Integral *integral_;
128
130
131 double *buffer_;
132
134 const Ref<GaussianBasisSet>&b1);
135
136 public:
137 virtual ~OneBodyOneCenterInt();
138
140 int nbasis() const;
141
143 int nbasis1() const;
144
146 int nshell() const;
147
149 int nshell1() const;
150
156
159
161 const double * buffer() const;
162
165 virtual void compute_shell(int) = 0;
166
169 virtual void reinitialize();
170
173 virtual bool cloneable() const;
174
178
179 Integral *integral() const { return integral_; }
180};
181
182// //////////////////////////////////////////////////////////////////////////
183
185 Ref<OneBodyInt> ob_;
186 int jsh_;
187 public:
189 int sh2 = 0);
190 void compute_shell(int);
191};
192
193// //////////////////////////////////////////////////////////////////////////
194
196 private:
197 const double * buf;
198 double scale_;
199
200 int e12;
201
202 int index;
203
204 int ioffset;
205 int joffset;
206
207 int iend;
208 int jend;
209
210 int icur;
211 int jcur;
212
213 public:
216
217 void init(const double * buffer, int ishell, int jshell,
218 int ioff, int joff, int nfunci, int nfuncj, int redund=0,
219 double scale=1.0);
220
221 void start() { icur=jcur=index=0; }
222 int ready() const { return (icur < iend); }
223
224 void next() {
225 if (jcur < ((e12)?(icur):((jend)-1))) {
226 index++;
227 jcur++;
228 return;
229 }
230
231 jcur=0;
232 icur++;
233
234 index = icur*jend;
235 }
236
237 int current_i() const { return icur; }
238 int current_j() const { return jcur; }
239
240 int i() const { return icur+ioffset; }
241 int j() const { return jcur+joffset; }
242
243 int nint() const { return iend*jend; }
244
245 double val() const { return buf[index]*scale_; }
246};
247
248// //////////////////////////////////////////////////////////////////////////
249
250class OneBodyIntIter : public RefCount {
251 protected:
252 Ref<OneBodyInt> obi; // help me obi wan
253 ShellPairIter spi;
254
255 int redund;
256
257 int istart;
258 int jstart;
259
260 int iend;
261 int jend;
262
263 int icur;
264 int jcur;
265
266 int ij;
267
268 public:
271 virtual ~OneBodyIntIter();
272
273 virtual void start(int ist=0, int jst=0, int ien=0, int jen=0);
274 virtual void next();
275
276 int ready() const { return (icur < iend); }
277
278 int ishell() const { return icur; }
279 int jshell() const { return jcur; }
280
281 int ijshell() const { return ij; }
282
283 int redundant() const { return redund; }
284 void set_redundant(int i) { redund=i; }
285
286 virtual double scale() const;
287
288 Ref<OneBodyInt> one_body_int() { return obi; }
289
290 ShellPairIter& current_pair();
291
292 virtual bool cloneable() const;
293 virtual Ref<OneBodyIntIter> clone();
294};
295
296
297
298// //////////////////////////////////////////////////////////////////////////
299
301 protected:
303
304 public:
307 virtual ~OneBodyIntOp();
308
311 void process_spec_ltri(SCMatrixLTriBlock*);
312 void process_spec_rectsub(SCMatrixRectSubBlock*);
313 void process_spec_ltrisub(SCMatrixLTriSubBlock*);
314
315 bool cloneable() const;
317
319};
320
322 private:
324
325 public:
328 virtual ~OneBody3IntOp();
329
330 void process(SCMatrixBlockIter&,
333 void process_spec_rect(SCMatrixRectBlock*,
336 void process_spec_ltri(SCMatrixLTriBlock*,
339
340 int has_side_effects();
341 int has_side_effects_in_arg1();
342 int has_side_effects_in_arg2();
343
344};
345
346// //////////////////////////////////////////////////////////////////////////
347
350class OneBodyDerivInt : public RefCount {
351 protected:
352 // this is who created me
353 Integral *integral_;
354
357
358 double *buffer_;
359
360 public:
363 const Ref<GaussianBasisSet>&b1,
364 const Ref<GaussianBasisSet>&b2);
365 virtual ~OneBodyDerivInt();
366
368 int nbasis() const;
370 int nbasis1() const;
372 int nbasis2() const;
373
375 int nshell() const;
377 int nshell1() const;
379 int nshell2() const;
380
387
403 const double * buffer() const;
404
407 virtual void compute_shell(int ish, int jsh, int center) = 0;
408
411 virtual void reinitialize();
412
414 Integral *integral() const { return integral_; }
415};
416
417// //////////////////////////////////////////////////////////////////////////
418
422 protected:
423 // this is who created me
424 Integral *integral_;
425
427
428 double *buffer_;
429
430 public:
433
435 int nbasis() const;
437 int nbasis1() const;
438
440 int nshell() const;
442 int nshell1() const;
443
448
451 const double * buffer() const;
452
455 virtual void compute_shell(int ish, int center) = 0;
456
459 virtual void reinitialize();
460
462 Integral *integral() const { return integral_; }
463};
464
465}
466
467#endif
468
469// Local Variables:
470// mode: c++
471// c-file-style: "ETS"
472// End:
The Integral abstract class acts as a factory to provide objects that compute one and two electron in...
Definition integral.h:111
Definition obint.h:321
OneBodyDerivInt is an abstract base class for objects that compute one body derivative integrals.
Definition obint.h:350
Ref< GaussianBasisSet > basis2() const
Return the basis set on center two.
int nshell2() const
Return the number of shells on center two.
Integral * integral() const
Return the integral factory that was used to create this object.
Definition obint.h:414
int nshell1() const
Return the number of shells on center one.
Ref< GaussianBasisSet > basis1() const
Return the basis set on center one.
virtual void compute_shell(int ish, int jsh, int center)=0
Compute the derivative integrals with respect to the given center and place the result in the buffer ...
int nbasis1() const
Return the number of basis functions on the center one.
int nbasis2() const
Return the number of basis functions on the center two.
Ref< GaussianBasisSet > basis() const
Return the basis set on center one.
virtual void reinitialize()
This is called for one body integrals that take data to let them know that the data they reference ha...
int nshell() const
Return the number of shells on center one.
const double * buffer() const
The computed shell integrals will be put in the buffer returned by this member.
int nbasis() const
Return the number of basis functions on center one.
Definition obint.h:250
Definition obint.h:300
int has_side_effects()
By default this returns nonzero.
Ref< SCElementOp > clone()
Returns a clone of this object.
void process(SCMatrixBlockIter &)
This is the fallback routine to process blocks and is called by process_spec members that are not ove...
void process_spec_rect(SCMatrixRectBlock *)
Matrices should call these members when the type of block is known.
bool cloneable() const
Returns true if this SCElementOp supports the clone() member.
OneBodyInt is an abstract base class for objects that compute integrals between two basis functions.
Definition obint.h:49
Ref< GaussianBasisSet > basis1() const
Return the basis set on the center one.
std::pair< const double *, std::array< unsigned long, 2 > > compute_shell_array(int, int)
Computes the integrals between basis functions in the given shell pair.
Ref< GaussianBasisSet > basis(size_t c) const
Return the basis set on center one.
int nshell2() const
Return the number of shells on the center two.
virtual Ref< OneBodyInt > clone()
Returns a clone of this.
virtual bool cloneable() const
Return true if the clone member can be called.
virtual void compute_shell(int, int)=0
Computes the integrals between basis functions in the given shell pair.
int nbasis1() const
Returns the number of basis functions on the center one.
int nbasis() const
Returns the number of basis functions on center one.
const double * buffer() const
Returns the buffer where the integrals are placed.
virtual void reinitialize()
This is called for one body integrals that take data to let them know that the data they reference ha...
Ref< GaussianBasisSet > basis2() const
Return the basis set on the center two.
int nbasis2() const
Returns the number of basis functions on the center two.
int nshell1() const
Return the number of shells on the center one.
int nshell() const
Return the number of shells on center one.
OneBodyOneCenterDerivInt is an abstract base class for objects that compute one body derivative integ...
Definition obint.h:421
Ref< GaussianBasisSet > basis1() const
Return the basis set on center one.
Ref< GaussianBasisSet > basis() const
Return the basis set on center one.
int nshell1() const
Return the number of shells on center one.
const double * buffer() const
The computed shell integrals will be put in the buffer returned by this member.
virtual void compute_shell(int ish, int center)=0
Compute the derivative integrals with respect to the given center and place the result in the buffer ...
virtual void reinitialize()
This is called for one body integrals that take data to let them know that the data they reference ha...
int nbasis1() const
Return the number of basis functions on center one.
int nbasis() const
Return the number of basis functions on center one.
Integral * integral() const
Return the integral factory that was used to create this object.
Definition obint.h:462
int nshell() const
Return the number of shells on center one.
OneBodyOneCenterInt is an abstract base class for objects that compute integrals between two basis fu...
Definition obint.h:124
int nshell1() const
Return the number of shells on the center one.
const double * buffer() const
Returns the buffer where the integrals are placed.
Ref< GaussianBasisSet > basis(size_t c) const
Return the basis set on center one.
virtual void reinitialize()
This is called for one body integrals that take data to let them know that the data they reference ha...
int nbasis1() const
Returns the number of basis functions on the center one.
Ref< GaussianBasisSet > basis1() const
Return the basis set on the center one.
virtual bool cloneable() const
Return true if the clone member can be called.
virtual Ref< OneBodyOneCenterInt > clone()
Returns a clone of this.
virtual void compute_shell(int)=0
Computes the integrals for basis functions on the given shell.
int nbasis() const
Returns the number of basis functions on center one.
int nshell() const
Return the number of shells on center one.
Definition obint.h:184
void compute_shell(int)
Computes the integrals for basis functions on the given shell.
The base class for all reference counted objects.
Definition ref.h:192
A template class that maintains references counts.
Definition ref.h:361
The SCElementOp3 class is very similar to the SCElementOp class except that a triplet of blocks is tr...
Definition elemop.h:181
Objects of class SCElementOp are used to perform operations on the elements of matrices.
Definition elemop.h:94
The SCMatrixBlockIter class is used to described iterates that loop through the elements in a block.
Definition blkiter.h:46
The SCMatrixLTriBlock describes a triangular piece of a matrix.
Definition block.h:253
The SCMatrixLTriSubBlock describes a triangular subblock of a matrix.
Definition block.h:288
The SCMatrixRectBlock describes a rectangular piece of a matrix.
Definition block.h:183
The SCMatrixRectSubBlock describes a rectangular piece of a matrix.
Definition block.h:219
Definition obint.h:195
Contains all MPQC code up to version 3.
Definition mpqcin.h:14

Generated at Wed Sep 25 2024 02:45:29 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.12.0.