MPQC  3.0.0-alpha
operator.h
1 //
2 // operator.h
3 //
4 // Copyright (C) 2007 Edward Valeev
5 //
6 // Author: Edward Valeev <evaleev@vt.edu>
7 // Maintainer: EV
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 #include <util/ref/ref.h>
29 #include <math/distarray4/distarray4.h>
30 #include <chemistry/qc/basis/intparams.h>
31 
32 #ifndef _chemistry_qc_basis_operator_h
33 #define _chemistry_qc_basis_operator_h
34 
35 namespace sc {
36 
40  class OperatorDescr : public RefCount {
41  public:
42  OperatorDescr() {}
43  virtual ~OperatorDescr() {}
44 
45  virtual unsigned int num_particles() const =0;
48  virtual int perm_symm(unsigned int p) const =0;
50  virtual int perm_symm(unsigned int i, unsigned int j) const =0;
51  };
52 
55  public:
56  OneBodyOperDescr(int perm);
57 
59  unsigned int num_particles() const;
61  int perm_symm(unsigned int i) const;
63  int perm_symm(unsigned int i, unsigned int j) const;
64 
65  private:
66  int perm_;
67  };
68 
71  public:
72  TwoBodyOperDescr(int perm_p1, int perm_p2, int perm_p12);
73 
75  unsigned int num_particles() const;
77  int perm_symm(unsigned int i) const;
79  int perm_symm(unsigned int i, unsigned int j) const;
80 
81  private:
82  int perm_p1_;
83  int perm_p2_;
84  int perm_p12_;
85 
86  };
87 
89  // One-Body Operators
91 
93 
98  struct OneBodyOper {
103  enum type {
104  gamma = -1,
105  T = 0,
106  V = 1,
107  h = 2,
108  J = 3,
109  K = 4,
110  F = 5,
111  hJ = 6,
112  mu_x = 7,
113  mu_y = 8,
114  mu_z = 9,
115  q_xx = 10,
116  q_xy = 11,
117  q_xz = 12,
118  q_yy = 13,
119  q_yz = 14,
120  q_zz = 15,
121  pVp = 16,
122  pxVp_x = 17,
123  pxVp_y = 18,
124  pxVp_z = 19,
125  p4 = 20,
126  Nabla_x = 21,
127  Nabla_y = 22,
128  Nabla_z = 23,
129  iL_x = 24,
130  iL_y = 25,
131  iL_z = 26,
132  phi = 27,
133  dphi_x = 28,
134  dphi_y = 29,
135  dphi_z = 30,
136  ddphi_xx = 31,
137  ddphi_xy = 32,
138  ddphi_xz = 33,
139  ddphi_yy = 34,
140  ddphi_yz = 35,
141  ddphi_zz = 36,
142  S = 37,
143  invalid = 38
144  };
145 
147  static int max_ntypes;
148 
151 
153  static std::string to_string(type t);
155  static type to_type(const std::string& key);
156  };
157 
159 
164  struct OneBodyOperSet {
168  enum type {
169  S=0,
170  T=1,
171  V=2,
172  h=3,
173  mu=4,
174  q=5,
175  phi=6,
176  dphi=7,
177  ddphi=8,
178  pVp=9,
179  p4=10,
180  invalid=11
181  };
182 
184  static std::string to_string(type t);
186  static type to_type(const std::string& key);
187 
190  static type to_type(OneBodyOper::type oper);
191 
192  };
193 
195  template <OneBodyOperSet::type Type> struct OneBodyOperSetProperties;
196  template <> struct OneBodyOperSetProperties<OneBodyOperSet::S> {
197  static const int size = 1;
198  static OneBodyOper::type value[];
199  static std::string key;
200  };
201  template <> struct OneBodyOperSetProperties<OneBodyOperSet::T> {
202  static const int size = 1;
203  static OneBodyOper::type value[];
204  static std::string key;
205  };
206  template <> struct OneBodyOperSetProperties<OneBodyOperSet::V> {
207  static const int size = 1;
208  static OneBodyOper::type value[];
209  static std::string key;
210  };
211  template <> struct OneBodyOperSetProperties<OneBodyOperSet::h> {
212  static const int size = 1;
213  static OneBodyOper::type value[];
214  static std::string key;
215  };
216  template <> struct OneBodyOperSetProperties<OneBodyOperSet::mu> {
217  static const int size = 3;
218  static OneBodyOper::type value[];
219  static std::string key;
220  };
221  template <> struct OneBodyOperSetProperties<OneBodyOperSet::q> {
222  static const int size = 6;
223  static OneBodyOper::type value[];
224  static std::string key;
225  };
226  template <> struct OneBodyOperSetProperties<OneBodyOperSet::pVp> {
227  static const int size = 1;
228  static OneBodyOper::type value[];
229  static std::string key;
230  };
231  template <> struct OneBodyOperSetProperties<OneBodyOperSet::p4> {
232  static const int size = 1;
233  static OneBodyOper::type value[];
234  static std::string key;
235  };
236  template <> struct OneBodyOperSetProperties<OneBodyOperSet::phi> {
237  static const int size = 1;
238  static OneBodyOper::type value[];
239  static std::string key;
240  };
241  template <> struct OneBodyOperSetProperties<OneBodyOperSet::dphi> {
242  static const int size = 3;
243  static OneBodyOper::type value[];
244  static std::string key;
245  };
246  template <> struct OneBodyOperSetProperties<OneBodyOperSet::ddphi> {
247  static const int size = 6;
248  static OneBodyOper::type value[];
249  static std::string key;
250  };
251 
253  class OneBodyOperSetDescr : public RefCount {
254  public:
255  static Ref<OneBodyOperSetDescr> instance(OneBodyOperSet::type oset);
256  int size() const { return size_; }
257  OneBodyOper::type opertype(unsigned int o) const;
258  unsigned int opertype(OneBodyOper::type o) const;
259  std::string key() const { return key_; }
260  private:
261  OneBodyOperSetDescr(int size,
262  const OneBodyOper::type* value,
263  std::string key) :
264  size_(size), value_(value), key_(key) { }
265 
266  int size_;
267  const OneBodyOper::type* value_;
268  std::string key_;
269  };
270 
272  template <OneBodyOperSet::type Type> struct OneBodyIntParamsType;
273  template <> struct OneBodyIntParamsType<OneBodyOperSet::T> {
274  typedef IntParamsVoid value;
275  };
276  template <> struct OneBodyIntParamsType<OneBodyOperSet::V> {
277  typedef IntParamsVoid value;
278  };
279  template <> struct OneBodyIntParamsType<OneBodyOperSet::h> {
280  typedef IntParamsVoid value;
281  };
282  template <> struct OneBodyIntParamsType<OneBodyOperSet::mu> {
283  typedef IntParamsOrigin value;
284  };
285  template <> struct OneBodyIntParamsType<OneBodyOperSet::q> {
286  typedef IntParamsOrigin value;
287  };
288  template <> struct OneBodyIntParamsType<OneBodyOperSet::pVp> {
289  typedef IntParamsVoid value;
290  };
291  template <> struct OneBodyIntParamsType<OneBodyOperSet::p4> {
292  typedef IntParamsVoid value;
293  };
294  template <> struct OneBodyIntParamsType<OneBodyOperSet::phi> {
295  typedef IntParamsOrigin value;
296  };
297  template <> struct OneBodyIntParamsType<OneBodyOperSet::dphi> {
298  typedef IntParamsOrigin value;
299  };
300  template <> struct OneBodyIntParamsType<OneBodyOperSet::ddphi> {
301  typedef IntParamsOrigin value;
302  };
303 
305  // Two-Body Operators
307 
309 
314  struct TwoBodyOper {
318  enum type {
319  eri =0,
320  r12 =1,
321  r12t1 =2,
322  r12t2 =3,
325  t1g12 =6,
326  t2g12 =7,
327  g12t1g12 =8,
330  delta =11
331  };
333  static int max_ntypes;
337  static std::string to_string(type t);
339  static type to_type(const std::string& key);
340  };
341 
343  struct TwoBodyOperSet {
344  enum type {
345  ERI,
346  R12,
347  G12,
354  };
355 
357  static std::string to_string(type t);
359  static type to_type(const std::string& key);
360 
363  static type to_type(TwoBodyOper::type oper);
364 
365  };
366 
368  template <TwoBodyOperSet::type Type> struct TwoBodyOperSetProperties;
369  template <> struct TwoBodyOperSetProperties<TwoBodyOperSet::ERI> {
370  static const int size = 1;
371  static TwoBodyOper::type value[];
372  static std::string key;
373  };
374  template <> struct TwoBodyOperSetProperties<TwoBodyOperSet::R12> {
375  static const int size = 4;
376  static TwoBodyOper::type value[];
377  static std::string key;
378  };
379  template <> struct TwoBodyOperSetProperties<TwoBodyOperSet::G12> {
380  static const int size = 6;
381  static TwoBodyOper::type value[];
382  static std::string key;
383  };
384  template <> struct TwoBodyOperSetProperties<TwoBodyOperSet::G12NC> {
385  static const int size = 5;
386  static TwoBodyOper::type value[];
387  static std::string key;
388  };
389  template <> struct TwoBodyOperSetProperties<TwoBodyOperSet::G12DKH> {
390  static const int size = 1;
391  static TwoBodyOper::type value[];
392  static std::string key;
393  };
394  template <> struct TwoBodyOperSetProperties<TwoBodyOperSet::R12_0_G12> {
395  static const int size = 1;
396  static TwoBodyOper::type value[];
397  static std::string key;
398  };
399  template <> struct TwoBodyOperSetProperties<TwoBodyOperSet::R12_m1_G12> {
400  static const int size = 1;
401  static TwoBodyOper::type value[];
402  static std::string key;
403  };
404  template <> struct TwoBodyOperSetProperties<TwoBodyOperSet::G12_T1_G12> {
405  static const int size = 1;
406  static TwoBodyOper::type value[];
407  static std::string key;
408  };
409  template <> struct TwoBodyOperSetProperties<TwoBodyOperSet::DeltaFunction> {
410  static const int size = 1;
411  static TwoBodyOper::type value[];
412  static std::string key;
413  };
414 
416 
421  class TwoBodyOperSetDescr : public RefCount {
422  public:
423  static Ref<TwoBodyOperSetDescr> instance(TwoBodyOperSet::type oset);
424  int size() const { return size_; }
425  TwoBodyOper::type opertype(unsigned int o) const;
426  unsigned int opertype(TwoBodyOper::type o) const;
427  std::string key() const { return key_; }
428  private:
429  TwoBodyOperSetDescr(int size,
430  const TwoBodyOper::type* value,
431  const std::string& key);
432  int size_;
433  const TwoBodyOper::type* value_;
434  std::string key_;
435  };
436 
438  template <TwoBodyOperSet::type Type> struct TwoBodyIntParamsType;
439  template <> struct TwoBodyIntParamsType<TwoBodyOperSet::ERI> {
440  typedef IntParamsVoid value;
441  };
442  template <> struct TwoBodyIntParamsType<TwoBodyOperSet::R12> {
443  typedef IntParamsVoid value;
444  };
445  template <> struct TwoBodyIntParamsType<TwoBodyOperSet::G12> {
446  typedef IntParamsG12 value;
447  };
448  template <> struct TwoBodyIntParamsType<TwoBodyOperSet::G12NC> {
449  typedef IntParamsG12 value;
450  };
451  template <> struct TwoBodyIntParamsType<TwoBodyOperSet::G12DKH> {
452  typedef IntParamsG12 value;
453  };
454  template <> struct TwoBodyIntParamsType<TwoBodyOperSet::R12_0_G12> {
455  typedef IntParamsG12 value;
456  };
457  template <> struct TwoBodyIntParamsType<TwoBodyOperSet::R12_m1_G12> {
458  typedef IntParamsG12 value;
459  };
460  template <> struct TwoBodyIntParamsType<TwoBodyOperSet::G12_T1_G12> {
461  typedef IntParamsG12 value;
462  };
463  template <> struct TwoBodyIntParamsType<TwoBodyOperSet::DeltaFunction> {
464  typedef IntParamsVoid value;
465  };
466 
467 
468 }
469 
470 #endif
471 
sc::TwoBodyOper::descr
static Ref< TwoBodyOperDescr > descr(TwoBodyOper::type t)
Returns a descriptor for integral type t.
sc::TwoBodyOperSet::G12NC
{eri, r12_0_g12, r12_m1_g12, g12t1g12, anti_g12g12}
Definition: operator.h:348
sc::OneBodyOper::J
(electronic) Coulomb
Definition: operator.h:108
sc::OneBodyOper::phi
electrostatic potential
Definition: operator.h:132
sc::OneBodyOper::ddphi_yy
electric field along y, gradient along y
Definition: operator.h:139
sc::TwoBodyOperSet
Known two-body operator sets.
Definition: operator.h:343
sc::OneBodyOper::hJ
h+J
Definition: operator.h:111
sc::OneBodyOper::type
type
Types of one-body operators, includes various context-dependent "projectors", such as 1-RDM,...
Definition: operator.h:103
sc::OneBodyOper::pxVp_z
z component of $f \underline{\hat{p}} \cross V \underline{\hat{p}}
Definition: operator.h:124
sc::TwoBodyOperDescr
Describes permutational properties (hermiticity, Bose/Fermi) of a two-body operator.
Definition: operator.h:70
sc::OneBodyOper::S
identity kernel, i.e. overlap
Definition: operator.h:142
sc::OneBodyOper::ddphi_xy
electric field along x, gradient along y
Definition: operator.h:137
sc::OneBodyOper::dphi_x
electric field along x
Definition: operator.h:133
sc::OneBodyOper::q_yy
yy component of quadrupole moment
Definition: operator.h:118
sc::IntParamsVoid
Passes params to Integral::electron_repulsion() and other factory methods which do not need parameter...
Definition: intparams.h:107
sc::OneBodyOper::q_zz
zz component of quadrupole moment
Definition: operator.h:120
sc::OneBodyOper
Describes one-body operators.
Definition: operator.h:98
sc::TwoBodyOper
Describes two-body operators.
Definition: operator.h:314
sc::OneBodyOperSet::mu
{mu_x, mu_y, mu_z}
Definition: operator.h:173
sc::OneBodyOper::iL_x
x component of negative imaginary part of angular momentum ( )
Definition: operator.h:129
sc::TwoBodyOperSet::type
type
Definition: operator.h:344
sc::TwoBodyOper::delta
Definition: operator.h:330
sc::Ref
A template class that maintains references counts.
Definition: ref.h:361
sc::OneBodyOperSetProperties
Describes sets of two-body operators (.
Definition: operator.h:195
sc::OneBodyOper::ddphi_zz
electric field along z, gradient along z
Definition: operator.h:141
sc::OneBodyOperSet::pVp
{pVp}
Definition: operator.h:178
sc::OneBodyOper::K
(electronic) exchange
Definition: operator.h:109
sc::OneBodyOper::descr
static Ref< OneBodyOperDescr > descr(OneBodyOper::type t)
Returns a descriptor for integral type t.
sc::OneBodyOper::pxVp_y
y component of $f \underline{\hat{p}} \cross V \underline{\hat{p}}
Definition: operator.h:123
sc::TwoBodyOperSetProperties
Describes sets of two-body operators (.
Definition: operator.h:368
sc::OneBodyOper::dphi_z
electric field along z
Definition: operator.h:135
sc::OperatorDescr::perm_symm
virtual int perm_symm(unsigned int p) const =0
Reports symmetry with respect to the permutation of function in bra with function in ket for particle...
sc::OneBodyOper::mu_x
x component of electric dipole moment
Definition: operator.h:112
sc::TwoBodyOperSet::R12
{eri, r12, r12t1, r12t2}
Definition: operator.h:346
sc::TwoBodyOperSet::R12_m1_G12
{r12_m1_g12}
Definition: operator.h:351
sc::OneBodyOper::ddphi_xz
electric field along x, gradient along z
Definition: operator.h:138
sc::TwoBodyOperSet::G12DKH
{g12p4g12_m_g12t1g12t1}
Definition: operator.h:349
sc::OneBodyOperSet::S
{S}
Definition: operator.h:169
sc::OneBodyOperDescr
Describes permutational properties (hermiticity) of one-body operators.
Definition: operator.h:54
sc::OneBodyOperDescr::perm_symm
int perm_symm(unsigned int i) const
Implementation of OperatorDescr::perm_symm()
sc::IntParamsOrigin
Passes params to Integral::dipole() and other factory methods which need r information.
Definition: intparams.h:118
sc::OneBodyOper::ddphi_xx
electric field along x, gradient along x
Definition: operator.h:136
sc::OneBodyOper::p4
Definition: operator.h:125
sc::OneBodyOper::Nabla_x
x component of Nabla operator ( )
Definition: operator.h:126
sc::TwoBodyOperSet::G12_T1_G12
{g12t1g12}
Definition: operator.h:352
sc::OneBodyOperSet::ddphi
{ddphi_xx, ddphi_xy, ddphi_xz, ddphi_yy, ddphi_yz, ddphi_zz}
Definition: operator.h:177
sc::OneBodyIntParamsType
which parameter set needed to specify the operator set?
Definition: operator.h:272
sc::TwoBodyOper::to_type
static type to_type(const std::string &key)
converts string representation to type
sc::TwoBodyOper::t1g12
Definition: operator.h:325
sc::OneBodyOper::V
nuclear (Coulomb) potential
Definition: operator.h:106
sc::OneBodyOperSet::V
{V}
Definition: operator.h:171
sc::OneBodyOperSet::p4
{p4}
Definition: operator.h:179
sc::TwoBodyOper::max_ntypes
static int max_ntypes
The max number of such types.
Definition: operator.h:333
sc::TwoBodyOperDescr::perm_symm
int perm_symm(unsigned int i) const
Implementation of OperatorDescr::perm_symm()
sc::TwoBodyOperDescr::num_particles
unsigned int num_particles() const
Implementation of OperatorDescr::num_particles()
sc::OneBodyOper::dphi_y
electric field along y
Definition: operator.h:134
sc::OneBodyOperSet::to_string
static std::string to_string(type t)
converts type to string representation
sc::TwoBodyOper::t2g12
Definition: operator.h:326
sc::OneBodyOper::Nabla_y
y component of Nabla operator ( )
Definition: operator.h:127
sc::TwoBodyOperSet::DeltaFunction
{delta}
Definition: operator.h:353
sc::OneBodyOper::iL_z
z component of negative imaginary part of angular momentum ( )
Definition: operator.h:131
sc::OneBodyOperSet::h
{h}
Definition: operator.h:172
sc::OneBodyOperSet::T
{T}
Definition: operator.h:170
sc::OneBodyOper::q_xz
xz component of quadrupole moment
Definition: operator.h:117
sc::TwoBodyOperSet::ERI
{eri}
Definition: operator.h:345
sc::OneBodyOper::mu_y
y component of electric dipole moment
Definition: operator.h:113
sc::OneBodyOperSet::dphi
{dphi_x, dphi_y, dphi_z}
Definition: operator.h:176
sc::OneBodyOper::gamma
1-body reduced density matrix
Definition: operator.h:104
sc::TwoBodyOper::eri
two-body Coulomb
Definition: operator.h:319
sc::OneBodyOper::pxVp_x
x component of $f \underline{\hat{p}} \cross V \underline{\hat{p}}
Definition: operator.h:122
sc::OneBodyOper::ddphi_yz
electric field along y, gradient along z
Definition: operator.h:140
sc::OneBodyOper::q_xx
xx component of quadrupole moment
Definition: operator.h:115
sc::OneBodyOper::h
core Hamiltonian = T+V
Definition: operator.h:107
sc::OneBodyOper::F
Fock operator.
Definition: operator.h:110
sc::OneBodyOperSetDescr
runtime version of OneBodyOperSetProperties
Definition: operator.h:253
sc::TwoBodyOperSetDescr
Describes sets of two-body operator.
Definition: operator.h:421
sc::TwoBodyIntParamsType
which parameter set needed to specify the operator set?
Definition: operator.h:438
sc::TwoBodyOperSet::R12_0_G12
{r12_0_g12}
Definition: operator.h:350
sc::TwoBodyOper::r12t2
Definition: operator.h:322
sc::TwoBodyOperSet::to_string
static std::string to_string(type t)
converts type to string representation
sc::OneBodyOper::T
(nonrelativitic) kinetic energy
Definition: operator.h:105
sc::OneBodyOperSet
Describes sets of one-body operator.
Definition: operator.h:164
sc::TwoBodyOper::type
type
types of known two-body operators
Definition: operator.h:318
sc::OneBodyOperDescr::num_particles
unsigned int num_particles() const
Implementation of OperatorDescr::num_particles()
sc::IntParamsG12
Used to pass params to Integral::g12().
Definition: intparams.h:144
sc::OneBodyOperSet::phi
{phi}
Definition: operator.h:175
sc::TwoBodyOper::g12p4g12_m_g12t1g12t1
Definition: operator.h:328
sc::RefCount
The base class for all reference counted objects.
Definition: ref.h:192
sc::OneBodyOper::max_ntypes
static int max_ntypes
The max number of such types.
Definition: operator.h:147
sc::OneBodyOperSet::to_type
static type to_type(const std::string &key)
converts string representation to type
sc::TwoBodyOperSet::to_type
static type to_type(const std::string &key)
converts string representation to type
sc::TwoBodyOper::to_string
static std::string to_string(type t)
converts type to string representation
sc::OneBodyOper::mu_z
z component of electric dipole moment
Definition: operator.h:114
sc::OneBodyOper::to_type
static type to_type(const std::string &key)
converts string representation to type
sc::OneBodyOper::pVp
$f \underline{\hat{p}} \cdot V \underline{\hat{p}}
Definition: operator.h:121
sc::OperatorDescr
For an operator (e.g.
Definition: operator.h:40
sc::OneBodyOper::Nabla_z
z component of Nabla operator ( )
Definition: operator.h:128
sc::OneBodyOper::q_yz
yz component of quadrupole moment
Definition: operator.h:119
sc::TwoBodyOper::g12t1g12
Definition: operator.h:327
sc::OneBodyOper::to_string
static std::string to_string(type t)
converts type to string
sc::OneBodyOper::iL_y
y component of negative imaginary part of angular momentum ( )
Definition: operator.h:130
sc::OneBodyOper::q_xy
xy component of quadrupole moment
Definition: operator.h:116
sc::TwoBodyOper::r12_m1_g12
(contracted) Gaussian geminal over Coulomb,
Definition: operator.h:324
sc
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
sc::TwoBodyOper::r12_0_g12
(contracted) Gaussian geminal,
Definition: operator.h:323
sc::OneBodyOperSet::q
{q_xx, q_xy, q_xz, q_yy, q_yz, q_zz}
Definition: operator.h:174
sc::TwoBodyOper::r12
interelectronic distance
Definition: operator.h:320
sc::TwoBodyOper::r12t1
Definition: operator.h:321
sc::OneBodyOperSet::type
type
one-body operator sets (
Definition: operator.h:168
sc::TwoBodyOper::anti_g12g12
anti_g12g12
Definition: operator.h:329
sc::TwoBodyOperSet::G12
{eri, r12_0_g12, r12_m1_g12, t1g12, t2g12, g12t1g12}
Definition: operator.h:347

Generated at Sun Jan 26 2020 23:23:57 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.16.