20 #ifndef _libint2_src_bin_libint_gaussoper_h_ 21 #define _libint2_src_bin_libint_gaussoper_h_ 23 #include <boost/type_traits/is_same.hpp> 25 #include <prefactors.h> 26 #include <global_macros.h> 31 template <
class F, BraketType BKType>
36 if (BKType == CBra || BKType == CKet)
37 throw std::logic_error(
"R12vec_dot_Nabla1 can only be applied to physicists brakets");
39 const char* zeta = (BKType == PBra) ?
"zeta_A" :
"zeta_B";
40 const char* XY = (BKType == PBra) ?
"AC" :
"BD";
42 const auto& f = bkt[0];
43 const auto& g = bkt[1];
49 result += make_pair(Scalar((
double)f.norm()),
52 const unsigned int nxyz = boost::is_same<F,CGF>::value ? 3 : 1;
53 for(
unsigned int xyz=0; xyz<nxyz; ++xyz) {
56 const F& fm1 = f - _1;
57 const F& gp1 = g + _1;
59 const double f_xyz = (double)(f.qn(xyz));
60 result += make_pair(Scalar(-1.0*f_xyz),
62 result += make_pair(Scalar(f_xyz)*Vector(XY)[xyz],
65 const F& fp1 = f + _1;
66 const F& fp2 = fp1 + _1;
67 result += make_pair(Scalar(-2.0) * Scalar(zeta),
69 result += make_pair(Scalar(2.0) * Scalar(zeta),
71 result += make_pair(Scalar(-2.0) * Scalar(zeta) * Vector(XY)[xyz],
79 template <
class F, BraketType BKType>
84 if (BKType == CBra || BKType == CKet)
85 throw std::logic_error(
"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";
97 result += make_pair(Scalar(-1.0*g.norm()),
100 const unsigned int nxyz = boost::is_same<F,CGF>::value ? 3 : 1;
101 for(
unsigned int xyz=0; xyz<nxyz; ++xyz) {
104 const F& fp1 = f + _1;
105 const F& gm1 = g - _1;
107 const double g_xyz = (double)(g.qn(xyz));
108 result += make_pair(Scalar(g_xyz),
110 result += make_pair(Scalar(g_xyz)*Vector(XY)[xyz],
113 const F& gp1 = g + _1;
114 const F& gp2 = gp1 + _1;
115 result += make_pair(Scalar(-2.0) * Scalar(zeta),
117 result += make_pair(Scalar(2.0) * Scalar(zeta),
119 result += make_pair(Scalar(-2.0) * Scalar(zeta) * Vector(XY)[xyz],
127 template <
class F, BraketType BKType>
132 if (BKType == CBra || BKType == CKet)
133 throw std::logic_error(
"Nabla1 can only be applied to physicists brakets");
135 const char* zeta = (BKType == PBra) ?
"zeta_A" :
"zeta_B";
145 const unsigned int dir = boost::is_same<F,CGF>::value ? xyz : 0;
147 const F& fm1 = f - _1;
149 const double f_xyz = (double)(f.qn(dir));
150 result += make_pair(Scalar(f_xyz),
153 const F& fp1 = f + _1;
154 result += make_pair(Scalar(-2.0) * Scalar(zeta),
160 template <
class F, BraketType BKType>
165 if (BKType == CBra || BKType == CKet)
166 throw std::logic_error(
"Nabla2 can only be applied to physicists brakets");
168 const char* zeta = (BKType == PBra) ?
"zeta_C" :
"zeta_D";
178 const unsigned int dir = boost::is_same<F,CGF>::value ? xyz : 0;
180 const F& gm1 = g - _1;
182 const double g_xyz = (double)(g.qn(dir));
183 result += make_pair(Scalar(g_xyz),
186 const F& gp1 = g + _1;
187 result += make_pair(Scalar(-2.0) * Scalar(zeta),
193 template <
class F, BraketType BKType>
199 if (BKType == CBra || BKType == CKet)
200 throw std::logic_error(
"R12v can only be applied to physicists brakets");
202 const char* XY = (BKType == PBra) ?
"AC" :
"BD";
212 const unsigned int dir = boost::is_same<F,CGF>::value ? xyz : 0;
214 const F& fp1 = f + _1;
215 const F& gp1 = g + _1;
216 result += make_pair(Scalar(1.0),
218 result += make_pair(Scalar(-1.0),
220 result += make_pair(Vector(XY)[xyz],
227 #endif // header guard LinearCombination< SafePtr< DGVertex >, BraketPair< F, BKType > > R12vec_dot_Nabla1(const BraketPair< F, BKType > &bkt)
Applies R12vec_dot_Nabla1 to a physicists' braket.
Definition: gaussoper.h:35
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:23
Definition: prefactors.h:159
LinearCombination< SafePtr< DGVertex >, BraketPair< F, BKType > > Nabla1(const BraketPair< F, BKType > &bkt, int xyz)
Applies Nabla1 to a physicists' braket.
Definition: gaussoper.h:131
represents linear combination of objects of type T with coefficients of type C
Definition: algebra.h:222
LinearCombination< SafePtr< DGVertex >, BraketPair< F, BKType > > R12v(const BraketPair< F, BKType > &bkt, unsigned int xyz)
Applies R12v to a physicists' braket.
Definition: gaussoper.h:197
LinearCombination< SafePtr< DGVertex >, BraketPair< F, BKType > > R12vec_dot_Nabla2(const BraketPair< F, BKType > &bkt)
Applies R12vec_dot_Nabla2 to a physicists' braket.
Definition: gaussoper.h:83
bool exists(const IncableBFSet &A)
Return true if A is valid.
Definition: bfset.h:91
LinearCombination< SafePtr< DGVertex >, BraketPair< F, BKType > > Nabla2(const BraketPair< F, BKType > &bkt, int xyz)
Applies Nabla2 to a physicists' braket.
Definition: gaussoper.h:164
BraketPair is a trimmed down version of ArrayBraket specialized for same-particle or different-partic...
Definition: braket.h:416