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 
40 namespace sc {
41 
42 // //////////////////////////////////////////////////////////////////////////
43 
44 class Integral;
45 
49 class TwoBodyInt : public RefCount {
50  protected:
51  // this is who created me
52  Integral *integral_;
53 
58 
59  double *buffer_;
60 
61  int redundant_;
62 
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 
151  protected:
152  // this is who created me
153  Integral *integral_;
154 
158 
159  double *buffer_;
160 
161  int redundant_;
162 
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 
245  protected:
246  // this is who created me
247  Integral *integral_;
248 
251 
252  double *buffer_;
253 
254  int redundant_;
255 
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 
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:
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 
385  protected:
386  Ref<TwoBodyInt> tbi;
387  ShellQuartetIter sqi;
388 
389  int iend;
390 
391  int icur;
392  int jcur;
393  int kcur;
394  int lcur;
395 
396  public:
397  TwoBodyIntIter();
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 
422 class 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 
498  protected:
499  // this is who created me
500  Integral *integral_;
501 
505 
506  double *buffer_;
507 
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 
565  protected:
566  // this is who created me
567  Integral *integral_;
568 
571 
572  double *buffer_;
573 
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:
int nshell() const
Return the number of shells on center one.
int nshell4() const
Return the number of shells on center four.
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 nbasis3() const
Return the number of basis functions on center three.
Ref< GaussianBasisSet > basis4()
Return the basis set on center four.
Ref< GaussianBasisSet > basis4()
Return the basis set on center four.
Ref< GaussianBasisSet > basis2()
Return the basis set on center two.
int nshell3() const
Return the number of shells on center three.
static const int num_tbint_types
The total number of such types.
Definition: tbint.h:206
int nbasis2() const
Return the number of basis functions on center two.
This is an abstract base type for classes that compute integrals involving two electrons in two Gauss...
Definition: tbint.h:244
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 > basis3()
Return the basis set on center three.
virtual void compute_shell(int, int, int, DerivCenters &)=0
Given for shell indices, this will cause the integral buffer to be filled in.
const double * buffer() const
The computed shell integrals will be put in the buffer returned by this member.
virtual const double * buffer(tbint_type type=eri) const
The computed shell integrals will be put in the buffer returned by this member.
virtual void compute_shell(int, int, int)=0
Given three shell indices, integrals will be computed and placed in the buffer.
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.
tbint_type
Types of two-body integrals that TwoBodyInt understands: eri stands for electron repulsion integral...
Definition: tbint.h:290
int nbasis1() const
Return the number of basis functions on center one.
Definition: tbint.h:326
int nbasis1() const
Return the number of basis functions on center one.
int nbasis2() const
Return the number of basis functions on center two.
int nshell1() const
Return the number of shells on center one.
tbint_type
Types of two-body integrals that TwoBodyInt understands: eri stands for electron repulsion integral...
Definition: tbint.h:111
int nbasis2() const
Return the number of basis functions on center two.
static const int num_tbint_types
The total number of such types.
Definition: tbint.h:292
int nshell1() const
Return the number of shells on center one.
The Integral abstract class acts as a factory to provide objects that compute one and two electron in...
Definition: integral.h:58
int nbasis2() const
Return the number of basis functions on center two.
int nbasis1() 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:204
int nshell3() const
Return the number of shells on center three.
int nshell() const
Return the number of shells on center one.
int nbasis() const
Return the number of basis functions on center one.
int nshell1() const
Return the number of shells on center one.
virtual void compute_shell(int, int, DerivCenters &)=0
Given for shell indices, this will cause the integral buffer to be filled in.
Ref< GaussianBasisSet > basis1()
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)=0
Return log base 2 of the maximum magnitude of any integral in a shell block obtained from compute_she...
int nbasis1() const
Return the number of basis functions on center one.
The base class for all reference counted objects.
Definition: ref.h:194
int nshell() const
Return the number of shells on center one.
virtual void set_redundant(int i)
See redundant().
Definition: tbint.h:135
int nshell() const
Return the number of shells 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.
int nshell2() const
Return the number of shells on center two.
This is an abstract base type for classes that compute three centers integrals involving two electron...
Definition: tbint.h:497
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.
virtual void set_integral_storage(size_t storage)
This storage is used to cache computed integrals.
int nbasis4() const
Return the number of basis functions on center four.
int redundant() const
If redundant is true, then keep redundant integrals in the buffer.
Definition: tbint.h:312
int nshell3() const
Return the number of shells on center three.
int nbasis() const
Return the number of basis functions on center one.
Ref< GaussianBasisSet > basis1()
Return the basis set on center one.
int nbasis() const
Return the number of basis functions on center one.
Ref< GaussianBasisSet > basis2()
Return the basis set on center two.
int nshell2() const
Return the number of shells on center two.
void set_redundant(int i)
See redundant().
Definition: tbint.h:314
virtual void compute_shell(int, int)=0
Given four shell indices, integrals will be computed and placed in the buffer.
Ref< GaussianBasisSet > basis()
Return the basis set on center one.
Ref< GaussianBasisSet > basis()
Return the basis set on center one.
Ref< GaussianBasisSet > basis2()
Return the basis set on center two.
Ref< GaussianBasisSet > basis2()
Return the basis set on center two.
Integral * integral() const
Return the integral factory that was used to create this object.
Definition: tbint.h:141
Ref< GaussianBasisSet > basis()
Return the basis set on center one.
Definition: mpqcin.h:13
Ref< GaussianBasisSet > basis2()
Return the basis set on center two.
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 redundant() const
If redundant is true, then keep redundant integrals in the buffer.
Definition: tbint.h:226
Ref< GaussianBasisSet > basis3()
Return the basis set on center three.
Ref< GaussianBasisSet > basis1()
Return the basis set on center one.
Ref< GaussianBasisSet > basis()
Return the basis set on center one.
int nshell1() const
Return the number of shells on center one.
Ref< GaussianBasisSet > basis2()
Return the basis set on center two.
DerivCenters keeps track the centers that derivatives are taken with respect to.
Definition: dercent.h:41
virtual const double * buffer(tbint_type type=eri) const
The computed shell integrals will be put in the buffer returned by this member.
int nbasis4() const
Return the number of basis functions on center four.
Ref< GaussianBasisSet > basis1()
Return the basis set on center one.
int nbasis2() const
Return the number of basis functions on center two.
Ref< GaussianBasisSet > basis3()
Return the basis set on center three.
This is an abstract base type for classes that compute integrals involving two electrons.
Definition: tbint.h:49
int nbasis() const
Return the number of basis functions on center one.
This is an abstract base type for classes that compute integrals involving two electrons in three Gau...
Definition: tbint.h:150
Ref< GaussianBasisSet > basis3()
Return the basis set on center three.
int nshell3() const
Return the number of shells on center three.
int nshell2() const
Return the number of shells on center two.
int nshell2() const
Return the number of shells on center two.
void set_redundant(int i)
See redundant().
Definition: tbint.h:228
This is an abstract base type for classes that compute integrals involving two electrons.
Definition: tbint.h:422
Ref< GaussianBasisSet > basis()
Return the basis set on center one.
This is an abstract base type for classes that compute two centers integrals involving two electrons...
Definition: tbint.h:564
int nshell2() const
Return the number of shells on center two.
int nshell2() const
Return the number of shells on center two.
int nshell4() const
Return the number of shells on center four.
Ref< GaussianBasisSet > basis1()
Return the basis set on center one.
Ref< GaussianBasisSet > basis1()
Return the basis set 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.
int nbasis3() const
Return the number of basis functions on center three.
int nbasis() const
Return the number of basis functions on center one.
int nbasis1() const
Return the number of basis functions on center one.
Definition: tbint.h:384
Integral * integral() const
Return the integral factory that was used to create this object.
Definition: tbint.h:234
virtual void set_integral_storage(size_t storage)
This storage is used to cache computed integrals.
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.
int nbasis3() const
Return the number of basis functions on center three.
Ref< GaussianBasisSet > basis()
Return the basis set on center one.
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.
virtual void compute_shell(int, int, int, int)=0
Given four shell indices, integrals will be computed and placed in the buffer.
int nbasis1() const
Return the number of basis functions on center one.
const double * buffer() const
The computed shell integrals will be put in the buffer returned by this member.
static const int num_tbint_types
The total number of such types.
Definition: tbint.h:113
int nbasis3() const
Return the number of basis functions on center three.
Integral * integral() const
Return the integral factory that was used to create this object.
Definition: tbint.h:320
int nshell1() const
Return the number of shells on center one.
int nshell1() const
Return the number of shells on center one.
int nshell() const
Return the number of shells on center one.

Generated at Fri Feb 16 2018 01:48:56 for MPQC 2.3.1 using the documentation package Doxygen 1.8.14.