MPQC 3.0.0-alpha
Loading...
Searching...
No Matches
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
35namespace 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
168 enum type {
169 S=0,
170 T=1,
171 V=2,
172 h=3,
173 mu=4,
174 q=5,
175 phi=6,
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
191
192 };
193
195 template <OneBodyOperSet::type Type> struct OneBodyOperSetProperties;
197 static const int size = 1;
198 static OneBodyOper::type value[];
199 static std::string key;
200 };
202 static const int size = 1;
203 static OneBodyOper::type value[];
204 static std::string key;
205 };
207 static const int size = 1;
208 static OneBodyOper::type value[];
209 static std::string key;
210 };
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 };
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
254 public:
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 {
333 static int max_ntypes;
337 static std::string to_string(type t);
339 static type to_type(const std::string& key);
340 };
341
355
357 static std::string to_string(type t);
359 static type to_type(const std::string& key);
360
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
422 public:
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
Used to pass params to Integral::g12().
Definition intparams.h:144
Passes params to Integral::dipole() and other factory methods which need r information.
Definition intparams.h:118
Passes params to Integral::electron_repulsion() and other factory methods which do not need parameter...
Definition intparams.h:107
Describes permutational properties (hermiticity) of one-body operators.
Definition operator.h:54
int perm_symm(unsigned int i) const
Implementation of OperatorDescr::perm_symm()
int perm_symm(unsigned int i, unsigned int j) const
Implementation of OperatorDescr::perm_symm()
unsigned int num_particles() const
Implementation of OperatorDescr::num_particles()
runtime version of OneBodyOperSetProperties
Definition operator.h:253
For an operator (e.g.
Definition operator.h:40
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...
virtual int perm_symm(unsigned int i, unsigned int j) const =0
Reports symmetry with respect to permutation of particles i and j in bra, or ket.
The base class for all reference counted objects.
Definition ref.h:192
A template class that maintains references counts.
Definition ref.h:361
Describes permutational properties (hermiticity, Bose/Fermi) of a two-body operator.
Definition operator.h:70
unsigned int num_particles() const
Implementation of OperatorDescr::num_particles()
int perm_symm(unsigned int i, unsigned int j) const
Implementation of OperatorDescr::perm_symm()
int perm_symm(unsigned int i) const
Implementation of OperatorDescr::perm_symm()
Describes sets of two-body operator.
Definition operator.h:421
Contains all MPQC code up to version 3.
Definition mpqcin.h:14
which parameter set needed to specify the operator set?
Definition operator.h:272
Describes sets of two-body operators (.
Definition operator.h:195
Describes sets of one-body operator.
Definition operator.h:164
type
one-body operator sets (
Definition operator.h:168
@ pVp
{pVp}
Definition operator.h:178
@ V
{V}
Definition operator.h:171
@ p4
{p4}
Definition operator.h:179
@ ddphi
{ddphi_xx, ddphi_xy, ddphi_xz, ddphi_yy, ddphi_yz, ddphi_zz}
Definition operator.h:177
@ phi
{phi}
Definition operator.h:175
@ T
{T}
Definition operator.h:170
@ S
{S}
Definition operator.h:169
@ mu
{mu_x, mu_y, mu_z}
Definition operator.h:173
@ q
{q_xx, q_xy, q_xz, q_yy, q_yz, q_zz}
Definition operator.h:174
@ h
{h}
Definition operator.h:172
@ dphi
{dphi_x, dphi_y, dphi_z}
Definition operator.h:176
static type to_type(const std::string &key)
converts string representation to type
static type to_type(OneBodyOper::type oper)
maps TwoBodyOper::type to type
static std::string to_string(type t)
converts type to string representation
Describes one-body operators.
Definition operator.h:98
static int max_ntypes
The max number of such types.
Definition operator.h:147
static type to_type(const std::string &key)
converts string representation to type
static Ref< OneBodyOperDescr > descr(OneBodyOper::type t)
Returns a descriptor for integral type t.
static std::string to_string(type t)
converts type to string
type
Types of one-body operators, includes various context-dependent "projectors", such as 1-RDM,...
Definition operator.h:103
@ dphi_y
electric field along y
Definition operator.h:134
@ iL_x
x component of negative imaginary part of angular momentum ( )
Definition operator.h:129
@ V
nuclear (Coulomb) potential
Definition operator.h:106
@ Nabla_y
y component of Nabla operator ( )
Definition operator.h:127
@ dphi_x
electric field along x
Definition operator.h:133
@ dphi_z
electric field along z
Definition operator.h:135
@ F
Fock operator.
Definition operator.h:110
@ K
(electronic) exchange
Definition operator.h:109
@ h
core Hamiltonian = T+V
Definition operator.h:107
@ Nabla_x
x component of Nabla operator ( )
Definition operator.h:126
@ hJ
h+J
Definition operator.h:111
@ gamma
1-body reduced density matrix
Definition operator.h:104
@ q_yy
yy component of quadrupole moment
Definition operator.h:118
@ mu_z
z component of electric dipole moment
Definition operator.h:114
@ p4
Definition operator.h:125
@ mu_y
y component of electric dipole moment
Definition operator.h:113
@ pxVp_z
z component of $f \underline{\hat{p}} \cross V \underline{\hat{p}}
Definition operator.h:124
@ ddphi_xy
electric field along x, gradient along y
Definition operator.h:137
@ mu_x
x component of electric dipole moment
Definition operator.h:112
@ ddphi_yy
electric field along y, gradient along y
Definition operator.h:139
@ S
identity kernel, i.e. overlap
Definition operator.h:142
@ q_xy
xy component of quadrupole moment
Definition operator.h:116
@ q_xz
xz component of quadrupole moment
Definition operator.h:117
@ ddphi_xx
electric field along x, gradient along x
Definition operator.h:136
@ pxVp_x
x component of $f \underline{\hat{p}} \cross V \underline{\hat{p}}
Definition operator.h:122
@ q_xx
xx component of quadrupole moment
Definition operator.h:115
@ iL_y
y component of negative imaginary part of angular momentum ( )
Definition operator.h:130
@ ddphi_zz
electric field along z, gradient along z
Definition operator.h:141
@ q_yz
yz component of quadrupole moment
Definition operator.h:119
@ ddphi_xz
electric field along x, gradient along z
Definition operator.h:138
@ phi
electrostatic potential
Definition operator.h:132
@ q_zz
zz component of quadrupole moment
Definition operator.h:120
@ pxVp_y
y component of $f \underline{\hat{p}} \cross V \underline{\hat{p}}
Definition operator.h:123
@ J
(electronic) Coulomb
Definition operator.h:108
@ ddphi_yz
electric field along y, gradient along z
Definition operator.h:140
@ pVp
$f \underline{\hat{p}} \cdot V \underline{\hat{p}}
Definition operator.h:121
@ iL_z
z component of negative imaginary part of angular momentum ( )
Definition operator.h:131
@ T
(nonrelativitic) kinetic energy
Definition operator.h:105
@ Nabla_z
z component of Nabla operator ( )
Definition operator.h:128
which parameter set needed to specify the operator set?
Definition operator.h:438
Describes sets of two-body operators (.
Definition operator.h:368
Known two-body operator sets.
Definition operator.h:343
static std::string to_string(type t)
converts type to string representation
type
Definition operator.h:344
@ G12
{eri, r12_0_g12, r12_m1_g12, t1g12, t2g12, g12t1g12}
Definition operator.h:347
@ R12
{eri, r12, r12t1, r12t2}
Definition operator.h:346
@ R12_0_G12
{r12_0_g12}
Definition operator.h:350
@ G12DKH
{g12p4g12_m_g12t1g12t1}
Definition operator.h:349
@ ERI
{eri}
Definition operator.h:345
@ R12_m1_G12
{r12_m1_g12}
Definition operator.h:351
@ G12_T1_G12
{g12t1g12}
Definition operator.h:352
@ G12NC
{eri, r12_0_g12, r12_m1_g12, g12t1g12, anti_g12g12}
Definition operator.h:348
@ DeltaFunction
{delta}
Definition operator.h:353
static type to_type(TwoBodyOper::type oper)
maps TwoBodyOper::type to type
static type to_type(const std::string &key)
converts string representation to type
Describes two-body operators.
Definition operator.h:314
static std::string to_string(type t)
converts type to string representation
static int max_ntypes
The max number of such types.
Definition operator.h:333
static Ref< TwoBodyOperDescr > descr(TwoBodyOper::type t)
Returns a descriptor for integral type t.
static type to_type(const std::string &key)
converts string representation to type
type
types of known two-body operators
Definition operator.h:318
@ r12t1
Definition operator.h:321
@ g12p4g12_m_g12t1g12t1
Definition operator.h:328
@ g12t1g12
Definition operator.h:327
@ r12t2
Definition operator.h:322
@ r12
interelectronic distance
Definition operator.h:320
@ delta
Definition operator.h:330
@ eri
two-body Coulomb
Definition operator.h:319
@ t1g12
Definition operator.h:325
@ r12_0_g12
(contracted) Gaussian geminal,
Definition operator.h:323
@ anti_g12g12
anti_g12g12
Definition operator.h:329
@ r12_m1_g12
(contracted) Gaussian geminal over Coulomb,
Definition operator.h:324
@ t2g12
Definition operator.h:326

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