21#ifndef _libint2_src_bin_libint_gaussoper_h_
22#define _libint2_src_bin_libint_gaussoper_h_
25#include <global_macros.h>
26#include <prefactors.h>
28#include <boost/type_traits/is_same.hpp>
33template <
class F, BraketType BKType>
34LinearCombination<std::shared_ptr<DGVertex>, BraketPair<F, BKType> >
36 if (BKType == CBra || BKType == CKet)
37 throw std::logic_error(
38 "R12vec_dot_Nabla1 can only be applied to physicists brakets");
40 const char* zeta = (BKType == PBra) ?
"zeta_A" :
"zeta_B";
41 const char* XY = (BKType == PBra) ?
"AC" :
"BD";
43 const auto& f = bkt[0];
44 const auto& g = bkt[1];
49 using namespace libint2::prefactor;
53 const unsigned int nxyz = boost::is_same<F, CGF>::value ? 3 : 1;
54 for (
unsigned int xyz = 0; xyz < nxyz; ++xyz) {
55 using namespace libint2::algebra;
57 const F& fm1 = f - _1;
58 const F& gp1 = g + _1;
60 const double f_xyz = (double)(f.qn(xyz));
63 result += make_pair(Scalar(f_xyz) * Vector(XY)[xyz],
66 const F& fp1 = f + _1;
67 const F& fp2 = fp1 + _1;
72 result += make_pair(Scalar(-2.0) * Scalar(zeta) * Vector(XY)[xyz],
80template <
class F, BraketType BKType>
83 if (BKType == CBra || BKType == CKet)
84 throw std::logic_error(
85 "R12vec_dot_Nabla2 can only be applied to physicists brakets");
87 const char* zeta = (BKType == PBra) ?
"zeta_C" :
"zeta_D";
88 const char* XY = (BKType == PBra) ?
"AC" :
"BD";
96 using namespace libint2::prefactor;
100 const unsigned int nxyz = boost::is_same<F, CGF>::value ? 3 : 1;
101 for (
unsigned int xyz = 0; xyz < nxyz; ++xyz) {
102 using namespace libint2::algebra;
104 const F& fp1 = f + _1;
105 const F& gm1 = g - _1;
107 const double g_xyz = (double)(g.qn(xyz));
109 result += make_pair(Scalar(g_xyz) * Vector(XY)[xyz],
112 const F& gp1 = g + _1;
113 const F& gp2 = gp1 + _1;
118 result += make_pair(Scalar(-2.0) * Scalar(zeta) * Vector(XY)[xyz],
126template <
class F, BraketType BKType>
129 if (BKType == CBra || BKType == CKet)
130 throw std::logic_error(
"Nabla1 can only be applied to physicists brakets");
132 const char* zeta = (BKType == PBra) ?
"zeta_A" :
"zeta_B";
140 using namespace libint2::prefactor;
141 using namespace libint2::algebra;
143 const unsigned int dir = boost::is_same<F, CGF>::value ? xyz : 0;
145 const F& fm1 = f - _1;
147 const double f_xyz = (double)(f.qn(dir));
150 const F& fp1 = f + _1;
157template <
class F, BraketType BKType>
160 if (BKType == CBra || BKType == CKet)
161 throw std::logic_error(
"Nabla2 can only be applied to physicists brakets");
163 const char* zeta = (BKType == PBra) ?
"zeta_C" :
"zeta_D";
171 using namespace libint2::prefactor;
172 using namespace libint2::algebra;
174 const unsigned int dir = boost::is_same<F, CGF>::value ? xyz : 0;
176 const F& gm1 = g - _1;
178 const double g_xyz = (double)(g.qn(dir));
181 const F& gp1 = g + _1;
188template <
class F, BraketType BKType>
191 if (BKType == CBra || BKType == CKet)
192 throw std::logic_error(
"R12v can only be applied to physicists brakets");
194 const char* XY = (BKType == PBra) ?
"AC" :
"BD";
202 using namespace libint2::prefactor;
203 using namespace libint2::algebra;
205 const unsigned int dir = boost::is_same<F, CGF>::value ? xyz : 0;
207 const F& fp1 = f + _1;
208 const F& gp1 = g + _1;
BraketPair is a trimmed down version of ArrayBraket specialized for same-particle or different-partic...
Definition src/bin/libint/braket.h:247
represents linear combination of objects of type T with coefficients of type C
Definition algebra.h:222
Defaults definitions for various parameters assumed by Libint.
Definition algebra.cc:24
bool exists(const IncableBFSet &A)
Return true if A is valid.
Definition bfset.h:96
LinearCombination< std::shared_ptr< DGVertex >, BraketPair< F, BKType > > R12vec_dot_Nabla1(const BraketPair< F, BKType > &bkt)
Applies R12vec_dot_Nabla1 to a physicists' braket.
Definition gaussoper.h:35
LinearCombination< std::shared_ptr< DGVertex >, BraketPair< F, BKType > > Nabla1(const BraketPair< F, BKType > &bkt, int xyz)
Applies Nabla1 to a physicists' braket.
Definition gaussoper.h:127
LinearCombination< std::shared_ptr< DGVertex >, BraketPair< F, BKType > > Nabla2(const BraketPair< F, BKType > &bkt, int xyz)
Applies Nabla2 to a physicists' braket.
Definition gaussoper.h:158
LinearCombination< std::shared_ptr< DGVertex >, BraketPair< F, BKType > > R12vec_dot_Nabla2(const BraketPair< F, BKType > &bkt)
Applies R12vec_dot_Nabla2 to a physicists' braket.
Definition gaussoper.h:82
LinearCombination< std::shared_ptr< DGVertex >, BraketPair< F, BKType > > R12v(const BraketPair< F, BKType > &bkt, unsigned int xyz)
Applies R12v to a physicists' braket.
Definition gaussoper.h:189