MPQC 2.3.1
tbint.h
1//
2// tbint.h
3//
4// Copyright (C) 1996 Limit Point Systems, Inc.
5//
6// Author: Edward Seidl <seidl@janed.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_tbint_h
29#define _chemistry_qc_basis_tbint_h
30
31#ifdef __GNUC__
32#pragma interface
33#endif
34
35#include <util/ref/ref.h>
36#include <util/group/message.h>
37#include <chemistry/qc/basis/gaussbas.h>
38#include <chemistry/qc/basis/dercent.h>
39
40namespace sc {
41
42// //////////////////////////////////////////////////////////////////////////
43
44class Integral;
45
49class TwoBodyInt : public RefCount {
50 protected:
51 // this is who created me
52 Integral *integral_;
53
58
59 double *buffer_;
60
61 int redundant_;
62
63 TwoBodyInt(Integral *integral,
64 const Ref<GaussianBasisSet>&bs1,
65 const Ref<GaussianBasisSet>&bs2,
66 const Ref<GaussianBasisSet>&bs3,
67 const Ref<GaussianBasisSet>&bs4);
68 public:
69 virtual ~TwoBodyInt();
70
72 int nbasis() const;
73
75 int nbasis1() const;
77 int nbasis2() const;
79 int nbasis3() const;
81 int nbasis4() const;
82
84 int nshell() const;
85
87 int nshell1() const;
89 int nshell2() const;
91 int nshell3() const;
93 int nshell4() const;
94
97
106
111 enum tbint_type { eri=0, r12=1, r12t1=2, r12t2=3};
113 static const int num_tbint_types = 4;
114
119 virtual const double * buffer(tbint_type type = eri) const;
120
124 virtual void compute_shell(int,int,int,int) = 0;
125
129 virtual int log2_shell_bound(int= -1,int= -1,int= -1,int= -1) = 0;
130
133 virtual int redundant() const { return redundant_; }
135 virtual void set_redundant(int i) { redundant_ = i; }
136
138 virtual void set_integral_storage(size_t storage);
139
141 Integral *integral() const { return integral_; }
142
143};
144
145// //////////////////////////////////////////////////////////////////////////
146
150class TwoBodyThreeCenterInt : public RefCount {
151 protected:
152 // this is who created me
153 Integral *integral_;
154
158
159 double *buffer_;
160
161 int redundant_;
162
163 TwoBodyThreeCenterInt(Integral *integral,
164 const Ref<GaussianBasisSet>&bs1,
165 const Ref<GaussianBasisSet>&bs2,
166 const Ref<GaussianBasisSet>&bs3);
167 public:
168 virtual ~TwoBodyThreeCenterInt();
169
171 int nbasis() const;
172
174 int nbasis1() const;
176 int nbasis2() const;
178 int nbasis3() const;
179
181 int nshell() const;
182
184 int nshell1() const;
186 int nshell2() const;
188 int nshell3() const;
189
192
199
204 enum tbint_type { eri=0, r12=1, r12t1=2, r12t2=3};
206 static const int num_tbint_types = 4;
207
212 virtual const double * buffer(tbint_type type = eri) const;
213
217 virtual void compute_shell(int,int,int) = 0;
218
222 virtual int log2_shell_bound(int= -1,int= -1,int= -1) = 0;
223
226 int redundant() const { return redundant_; }
228 void set_redundant(int i) { redundant_ = i; }
229
231 virtual void set_integral_storage(size_t storage);
232
234 Integral *integral() const { return integral_; }
235
236};
237
238// //////////////////////////////////////////////////////////////////////////
239
244class TwoBodyTwoCenterInt : public RefCount {
245 protected:
246 // this is who created me
247 Integral *integral_;
248
251
252 double *buffer_;
253
254 int redundant_;
255
256 TwoBodyTwoCenterInt(Integral *integral,
257 const Ref<GaussianBasisSet>&bs1,
258 const Ref<GaussianBasisSet>&bs2);
259 public:
260 virtual ~TwoBodyTwoCenterInt();
261
263 int nbasis() const;
264
266 int nbasis1() const;
268 int nbasis2() const;
269
271 int nshell() const;
272
274 int nshell1() const;
276 int nshell2() const;
277
280
285
290 enum tbint_type { eri=0, r12=1, r12t1=2, r12t2=3};
292 static const int num_tbint_types = 4;
293
298 virtual const double * buffer(tbint_type type = eri) const;
299
303 virtual void compute_shell(int,int) = 0;
304
308 virtual int log2_shell_bound(int= -1,int= -1) = 0;
309
312 int redundant() const { return redundant_; }
314 void set_redundant(int i) { redundant_ = i; }
315
317 virtual void set_integral_storage(size_t storage);
318
320 Integral *integral() const { return integral_; }
321
322};
323
324// //////////////////////////////////////////////////////////////////////////
325
326class ShellQuartetIter {
327 protected:
328 const double * buf;
329 double scale_;
330
331 int redund_;
332
333 int e12;
334 int e34;
335 int e13e24;
336
337 int index;
338
339 int istart;
340 int jstart;
341 int kstart;
342 int lstart;
343
344 int iend;
345 int jend;
346 int kend;
347 int lend;
348
349 int icur;
350 int jcur;
351 int kcur;
352 int lcur;
353
354 int i_;
355 int j_;
356 int k_;
357 int l_;
358
359 public:
360 ShellQuartetIter();
361 virtual ~ShellQuartetIter();
362
363 virtual void init(const double *,
364 int, int, int, int,
365 int, int, int, int,
366 int, int, int, int,
367 double, int);
368
369 virtual void start();
370 virtual void next();
371
372 int ready() const { return icur < iend; }
373
374 int i() const { return i_; }
375 int j() const { return j_; }
376 int k() const { return k_; }
377 int l() const { return l_; }
378
379 int nint() const { return iend*jend*kend*lend; }
380
381 double val() const { return buf[index]*scale_; }
382};
383
384class TwoBodyIntIter {
385 protected:
386 Ref<TwoBodyInt> tbi;
388
389 int iend;
390
391 int icur;
392 int jcur;
393 int kcur;
394 int lcur;
395
396 public:
397 TwoBodyIntIter();
398 TwoBodyIntIter(const Ref<TwoBodyInt>&);
399
400 virtual ~TwoBodyIntIter();
401
402 virtual void start();
403 virtual void next();
404
405 int ready() const { return (icur < iend); }
406
407 int ishell() const { return icur; }
408 int jshell() const { return jcur; }
409 int kshell() const { return kcur; }
410 int lshell() const { return lcur; }
411
412 virtual double scale() const;
413
414 ShellQuartetIter& current_quartet();
415};
416
417// //////////////////////////////////////////////////////////////////////////
418
422class TwoBodyDerivInt : public RefCount {
423 protected:
424 // this is who created me
425 Integral *integral_;
426
431
432 double *buffer_;
433
434 TwoBodyDerivInt(Integral* integral,
435 const Ref<GaussianBasisSet>&b1,
436 const Ref<GaussianBasisSet>&b2,
437 const Ref<GaussianBasisSet>&b3,
438 const Ref<GaussianBasisSet>&b4);
439 public:
440 virtual ~TwoBodyDerivInt();
441
443 int nbasis() const;
444
446 int nbasis1() const;
448 int nbasis2() const;
450 int nbasis3() const;
452 int nbasis4() const;
453
455 int nshell() const;
456
458 int nshell1() const;
460 int nshell2() const;
462 int nshell3() const;
464 int nshell4() const;
465
468
477
481 const double * buffer() const;
482
485 virtual void compute_shell(int,int,int,int,DerivCenters&) = 0;
486
489 virtual int log2_shell_bound(int= -1,int= -1,int= -1,int= -1) = 0;
490};
491
492// //////////////////////////////////////////////////////////////////////////
493
497class TwoBodyThreeCenterDerivInt : public RefCount {
498 protected:
499 // this is who created me
500 Integral *integral_;
501
505
506 double *buffer_;
507
508 TwoBodyThreeCenterDerivInt(Integral* integral,
509 const Ref<GaussianBasisSet>&b1,
510 const Ref<GaussianBasisSet>&b2,
511 const Ref<GaussianBasisSet>&b3);
512 public:
513 virtual ~TwoBodyThreeCenterDerivInt();
514
516 int nbasis() const;
517
519 int nbasis1() const;
521 int nbasis2() const;
523 int nbasis3() const;
524
526 int nshell() const;
527
529 int nshell1() const;
531 int nshell2() const;
533 int nshell3() const;
534
537
544
548 const double * buffer() const;
549
552 virtual void compute_shell(int,int,int,DerivCenters&) = 0;
553
556 virtual int log2_shell_bound(int= -1,int= -1,int= -1) = 0;
557};
558
559// //////////////////////////////////////////////////////////////////////////
560
564class TwoBodyTwoCenterDerivInt : public RefCount {
565 protected:
566 // this is who created me
567 Integral *integral_;
568
571
572 double *buffer_;
573
574 TwoBodyTwoCenterDerivInt(Integral* integral,
575 const Ref<GaussianBasisSet>&b1,
576 const Ref<GaussianBasisSet>&b2);
577 public:
578 virtual ~TwoBodyTwoCenterDerivInt();
579
581 int nbasis() const;
582
584 int nbasis1() const;
586 int nbasis2() const;
587
589 int nshell() const;
590
592 int nshell1() const;
594 int nshell2() const;
595
598
603
607 const double * buffer() const;
608
611 virtual void compute_shell(int,int,DerivCenters&) = 0;
612
615 virtual int log2_shell_bound(int= -1,int= -1) = 0;
616};
617
618}
619
620#endif
621
622// Local Variables:
623// mode: c++
624// c-file-style: "ETS"
625// End:
DerivCenters keeps track the centers that derivatives are taken with respect to.
Definition dercent.h:41
The Integral abstract class acts as a factory to provide objects that compute one and two electron in...
Definition integral.h:58
A template class that maintains references counts.
Definition ref.h:332
Definition tbint.h:326
int nshell2() const
Return the number of shells on center two.
virtual void compute_shell(int, int, int, int, DerivCenters &)=0
Given for shell indices, this will cause the integral buffer to be filled in.
int nbasis() const
Return the number of basis functions on center one.
int nshell3() const
Return the number of shells on center three.
int nshell1() const
Return the number of shells on center one.
virtual int log2_shell_bound(int=-1, int=-1, int=-1, int=-1)=0
Return log base 2 of the maximum magnitude of any integral in a shell block.
Ref< GaussianBasisSet > basis2()
Return the basis set on center two.
int nshell4() const
Return the number of shells on center four.
int nbasis3() const
Return the number of basis functions on center three.
int nbasis2() const
Return the number of basis functions on center two.
int nbasis1() const
Return the number of basis functions on center one.
Ref< GaussianBasisSet > basis3()
Return the basis set on center three.
const double * buffer() const
The computed shell integrals will be put in the buffer returned by this member.
Ref< GaussianBasisSet > basis4()
Return the basis set on center four.
Ref< GaussianBasisSet > basis()
Return the basis set on center one.
Ref< GaussianBasisSet > basis1()
Return the basis set on center one.
int nbasis4() const
Return the number of basis functions on center four.
int nshell() const
Return the number of shells on center one.
virtual void set_integral_storage(size_t storage)
This storage is used to cache computed integrals.
int nbasis2() const
Return the number of basis functions on center two.
Ref< GaussianBasisSet > basis()
Return the basis set on center one.
virtual int redundant() const
If redundant is true, then keep redundant integrals in the buffer.
Definition tbint.h:133
virtual int log2_shell_bound(int=-1, int=-1, int=-1, int=-1)=0
Return log base 2 of the maximum magnitude of any integral in a shell block obtained from compute_she...
int nbasis3() const
Return the number of basis functions on center three.
virtual void set_redundant(int i)
See redundant().
Definition tbint.h:135
Ref< GaussianBasisSet > basis2()
Return the basis set on center two.
int nbasis1() const
Return the number of basis functions on center one.
int nshell2() const
Return the number of shells on center two.
int nshell3() const
Return the number of shells on center three.
int nbasis4() const
Return the number of basis functions on center four.
int nshell1() const
Return the number of shells on center one.
virtual void compute_shell(int, int, int, int)=0
Given four shell indices, integrals will be computed and placed in the buffer.
Ref< GaussianBasisSet > basis4()
Return the basis set on center four.
static const int num_tbint_types
The total number of such types.
Definition tbint.h:113
virtual const double * buffer(tbint_type type=eri) const
The computed shell integrals will be put in the buffer returned by this member.
int nshell() const
Return the number of shells on center one.
int nbasis() const
Return the number of basis functions on center one.
tbint_type
Types of two-body integrals that TwoBodyInt understands: eri stands for electron repulsion integral,...
Definition tbint.h:111
int nshell4() const
Return the number of shells on center four.
Ref< GaussianBasisSet > basis1()
Return the basis set on center one.
Ref< GaussianBasisSet > basis3()
Return the basis set on center three.
Integral * integral() const
Return the integral factory that was used to create this object.
Definition tbint.h:141
int nbasis() const
Return the number of basis functions on center one.
int nbasis3() const
Return the number of basis functions on center three.
virtual int log2_shell_bound(int=-1, int=-1, int=-1)=0
Return log base 2 of the maximum magnitude of any integral in a shell block.
Ref< GaussianBasisSet > basis1()
Return the basis set on center one.
Ref< GaussianBasisSet > basis()
Return the basis set on center one.
const double * buffer() const
The computed shell integrals will be put in the buffer returned by this member.
int nbasis2() const
Return the number of basis functions on center two.
int nshell() const
Return the number of shells on center one.
int nshell2() const
Return the number of shells on center two.
int nbasis1() const
Return the number of basis functions on center one.
virtual void compute_shell(int, int, int, DerivCenters &)=0
Given for shell indices, this will cause the integral buffer to be filled in.
Ref< GaussianBasisSet > basis2()
Return the basis set on center two.
int nshell1() const
Return the number of shells on center one.
Ref< GaussianBasisSet > basis3()
Return the basis set on center three.
int nshell3() const
Return the number of shells on center three.
int redundant() const
If redundant is true, then keep redundant integrals in the buffer.
Definition tbint.h:226
int nshell() const
Return the number of shells on center one.
virtual const double * buffer(tbint_type type=eri) const
The computed shell integrals will be put in the buffer returned by this member.
Ref< GaussianBasisSet > basis2()
Return the basis set on center two.
int nbasis3() const
Return the number of basis functions on center three.
Ref< GaussianBasisSet > basis()
Return the basis set on center one.
virtual void compute_shell(int, int, int)=0
Given three shell indices, integrals will be computed and placed in the buffer.
virtual void set_integral_storage(size_t storage)
This storage is used to cache computed integrals.
static const int num_tbint_types
The total number of such types.
Definition tbint.h:206
Ref< GaussianBasisSet > basis1()
Return the basis set on center one.
int nshell1() const
Return the number of shells on center one.
Ref< GaussianBasisSet > basis3()
Return the basis set on center three.
int nbasis2() const
Return the number of basis functions on center two.
int nbasis() const
Return the number of basis functions on center one.
virtual int log2_shell_bound(int=-1, int=-1, int=-1)=0
Return log base 2 of the maximum magnitude of any integral in a shell block obtained from compute_she...
Integral * integral() const
Return the integral factory that was used to create this object.
Definition tbint.h:234
int nshell3() const
Return the number of shells on center three.
int nbasis1() const
Return the number of basis functions on center one.
int nshell2() const
Return the number of shells on center two.
tbint_type
Types of two-body integrals that TwoBodyInt understands: eri stands for electron repulsion integral,...
Definition tbint.h:204
void set_redundant(int i)
See redundant().
Definition tbint.h:228
int nbasis() const
Return the number of basis functions on center one.
Ref< GaussianBasisSet > basis2()
Return the basis set on center two.
virtual void compute_shell(int, int, DerivCenters &)=0
Given for shell indices, this will cause the integral buffer to be filled in.
int nbasis1() const
Return the number of basis functions on center one.
int nshell() const
Return the number of shells on center one.
int nshell1() const
Return the number of shells on center one.
int nshell2() const
Return the number of shells on center two.
virtual int log2_shell_bound(int=-1, int=-1)=0
Return log base 2 of the maximum magnitude of any integral in a shell block.
Ref< GaussianBasisSet > basis()
Return the basis set on center one.
int nbasis2() const
Return the number of basis functions on center two.
Ref< GaussianBasisSet > basis1()
Return the basis set on center one.
const double * buffer() const
The computed shell integrals will be put in the buffer returned by this member.
tbint_type
Types of two-body integrals that TwoBodyInt understands: eri stands for electron repulsion integral,...
Definition tbint.h:290
int nshell2() const
Return the number of shells on center two.
int nshell1() const
Return the number of shells on center one.
int nshell() const
Return the number of shells on center one.
int redundant() const
If redundant is true, then keep redundant integrals in the buffer.
Definition tbint.h:312
virtual void set_integral_storage(size_t storage)
This storage is used to cache computed integrals.
int nbasis1() const
Return the number of basis functions on center one.
virtual int log2_shell_bound(int=-1, int=-1)=0
Return log base 2 of the maximum magnitude of any integral in a shell block obtained from compute_she...
int nbasis2() const
Return the number of basis functions on center two.
Ref< GaussianBasisSet > basis2()
Return the basis set on center two.
virtual const double * buffer(tbint_type type=eri) const
The computed shell integrals will be put in the buffer returned by this member.
void set_redundant(int i)
See redundant().
Definition tbint.h:314
Ref< GaussianBasisSet > basis1()
Return the basis set on center one.
Integral * integral() const
Return the integral factory that was used to create this object.
Definition tbint.h:320
Ref< GaussianBasisSet > basis()
Return the basis set on center one.
static const int num_tbint_types
The total number of such types.
Definition tbint.h:292
int nbasis() const
Return the number of basis functions on center one.
virtual void compute_shell(int, int)=0
Given four shell indices, integrals will be computed and placed in the buffer.

Generated at Fri Jan 31 2025 00:00:00 for MPQC 2.3.1 using the documentation package Doxygen 1.13.2.