20 #ifndef _libint2_src_bin_libint_vrr1onep1_h_ 21 #define _libint2_src_bin_libint_vrr1onep1_h_ 23 #include <generic_rr.h> 33 template <
class BFSet, FunctionPosition where>
36 GenIntegralSet_1_1<BFSet,OverlapOper,EmptySet> >
44 static const unsigned int max_nchildren = 9;
46 using ParentType::Instance;
49 static bool directional() {
return ParentType::default_directional(); }
52 using ParentType::RecurrenceRelation::expr_;
53 using ParentType::RecurrenceRelation::nflops_;
54 using ParentType::target_;
55 using ParentType::is_simple;
60 static std::string descr() {
return "OSVRROverlap"; }
63 template <
class F, FunctionPosition where>
71 const F& _1 = unit<F>(dir);
84 const bool deriv = dA.
zero() ==
false ||
93 auto a = ( where == InBra ? Tint->bra(0,0) - _1 : Tint->bra(0,0) );
95 auto b = ( where == InKet ? Tint->ket(0,0) - _1 : Tint->ket(0,0) );
99 if (is_simple()) { expr_ = Vector(where == InBra ?
"PA" :
"PB")[dir] * AB; nflops_+=1; }
101 auto am1 = a - _1;
auto am1_exists =
exists(am1);
102 auto bm1 = b - _1;
auto bm1_exists =
exists(bm1);
106 if (is_simple()) { expr_ += (Scalar(a[dir]) * Scalar(
"oo2z")) * Am1B; nflops_+=3; }
110 if (is_simple()) { expr_ += (Scalar(b[dir]) * Scalar(
"oo2z")) * ABm1; nflops_+=3; }
118 F a( where == InBra ? Tint->bra(0,0) - _1 : Tint->bra(0,0) );
119 F b( where == InKet ? Tint->ket(0,0) - _1 : Tint->ket(0,0) );
124 for(
unsigned int dxyz=0; dxyz<3; ++dxyz) {
126 if (is_simple() && dxyz != dir)
131 SafePtr<DGVertex> _nullptr;
140 if (where == InBra) {
141 expr_ -= Vector(dA)[dxyz] * Scalar(
"rho12_over_alpha1") * AB; nflops_ += 3; }
142 if (where == InKet) {
143 expr_ += Vector(dA)[dxyz] * Scalar(
"rho12_over_alpha2") * AB; nflops_ += 3; }
156 if (where == InBra) {
157 expr_ += Vector(dB)[dxyz] * Scalar(
"rho12_over_alpha1") * AB; nflops_ += 3; }
158 if (where == InKet) {
159 expr_ -= Vector(dB)[dxyz] * Scalar(
"rho12_over_alpha2") * AB; nflops_ += 3; }
174 template <CartesianAxis Axis, FunctionPosition where>
177 GenIntegralSet_1_1<CGF1d<Axis>,OverlapOper,EmptySet> >
185 static const unsigned int max_nchildren = 9;
186 static constexpr CartesianAxis axis = Axis;
188 using ParentType::Instance;
191 static bool directional() {
return ParentType::default_directional(); }
194 using ParentType::RecurrenceRelation::expr_;
195 using ParentType::RecurrenceRelation::nflops_;
196 using ParentType::target_;
197 using ParentType::is_simple;
202 static std::string descr() {
return std::string(
"OSVRROverlap") +
to_string(axis); }
205 template <CartesianAxis Axis, FunctionPosition where>
216 const F& _1 = unit<F>(dir);
221 if (a.contracted() ||
229 const bool deriv = dA.
zero() ==
false ||
238 auto zero = Tint->bra(0,0).zero() and Tint->ket(0,0).zero() and not deriv;
240 SafePtr<DGVertex> int00 = Vector(
"_0_Overlap_0")[Axis];
241 expr_ = Scalar(0u) + int00;
242 this->add_child(int00);
249 auto a = ( where == InBra ? Tint->bra(0,0) - _1 : Tint->bra(0,0) );
251 auto b = ( where == InKet ? Tint->ket(0,0) - _1 : Tint->ket(0,0) );
255 if (is_simple()) { expr_ = Vector(where == InBra ?
"PA" :
"PB")[Axis] * AB; nflops_+=1; }
257 auto am1 = a - _1;
auto am1_exists =
exists(am1);
258 auto bm1 = b - _1;
auto bm1_exists =
exists(bm1);
262 if (is_simple()) { expr_ += (Scalar(a.qn()) * Scalar(
"oo2z")) * Am1B; nflops_+=3; }
266 if (is_simple()) { expr_ += (Scalar(b.qn()) * Scalar(
"oo2z")) * ABm1; nflops_+=3; }
274 F a( where == InBra ? Tint->bra(0,0) - _1 : Tint->bra(0,0) );
275 F b( where == InKet ? Tint->ket(0,0) - _1 : Tint->ket(0,0) );
280 SafePtr<DGVertex> _nullptr;
289 if (where == InBra) {
290 expr_ -= Scalar(dA[0]) * Scalar(
"rho12_over_alpha1") * AB; nflops_ += 3; }
291 if (where == InKet) {
292 expr_ += Scalar(dA[0]) * Scalar(
"rho12_over_alpha2") * AB; nflops_ += 3; }
305 if (where == InBra) {
306 expr_ += Scalar(dB[0]) * Scalar(
"rho12_over_alpha1") * AB; nflops_ += 3; }
307 if (where == InKet) {
308 expr_ -= Scalar(dB[0]) * Scalar(
"rho12_over_alpha2") * AB; nflops_ += 3; }
324 template <
class BFSet, FunctionPosition where>
327 GenIntegralSet_1_1<BFSet,KineticOper,EmptySet> >
335 static const unsigned int max_nchildren = 9;
337 using ParentType::Instance;
340 static bool directional() {
return ParentType::default_directional(); }
343 using ParentType::RecurrenceRelation::expr_;
344 using ParentType::RecurrenceRelation::nflops_;
345 using ParentType::target_;
346 using ParentType::is_simple;
351 static std::string descr() {
return "OSVRRKinetic"; }
354 template <
class F, FunctionPosition where>
362 const F& _1 = unit<F>(dir);
367 if (a.contracted() ||
375 const bool deriv = dA.
zero() ==
false ||
386 auto a = ( where == InBra ? Tint->bra(0,0) - _1 : Tint->bra(0,0) );
388 auto b = ( where == InKet ? Tint->ket(0,0) - _1 : Tint->ket(0,0) );
392 if (is_simple()) { expr_ = Vector(where == InBra ?
"PA" :
"PB")[dir] * AB; nflops_+=1; }
397 auto S_Am1B = (where == InBra) ? overlap_factory.
make_child(am1,b) : SafePtr<DGVertex>();
399 if (where == InBra) {
400 expr_ += Scalar(a[dir]) * ( Scalar(
"oo2z") * Am1B -
401 Scalar(
"rho12_over_alpha1") * S_Am1B );
405 expr_ += Scalar(a[dir]) * Scalar(
"oo2z") * Am1B;
413 auto S_ABm1 = (where == InKet) ? overlap_factory.
make_child(a,bm1) : SafePtr<DGVertex>();
415 if (where == InKet) {
416 expr_ += Scalar(b[dir]) * ( Scalar(
"oo2z") * ABm1 -
417 Scalar(
"rho12_over_alpha2") * S_ABm1 );
421 expr_ += Scalar(b[dir]) * Scalar(
"oo2z") * ABm1;
428 auto S_AB_target = where == InBra ? overlap_factory.
make_child(a + _1,b) : overlap_factory.
make_child(a,b + _1);
430 expr_ += Scalar(
"two_rho12") * S_AB_target;
443 F a( where == InBra ? Tint->bra(0,0) - _1 : Tint->bra(0,0) );
444 F b( where == InKet ? Tint->ket(0,0) - _1 : Tint->ket(0,0) );
449 for(
unsigned int dxyz=0; dxyz<3; ++dxyz) {
451 if (is_simple() && dxyz != dir)
456 SafePtr<DGVertex> _nullptr;
465 if (where == InBra) {
466 expr_ -= Vector(dA)[dxyz] * Scalar(
"rho12_over_alpha1") * AB; nflops_ += 3; }
467 if (where == InKet) {
468 expr_ += Vector(dA)[dxyz] * Scalar(
"rho12_over_alpha2") * AB; nflops_ += 3; }
481 if (where == InBra) {
482 expr_ += Vector(dB)[dxyz] * Scalar(
"rho12_over_alpha1") * AB; nflops_ += 3; }
483 if (where == InKet) {
484 expr_ -= Vector(dB)[dxyz] * Scalar(
"rho12_over_alpha2") * AB; nflops_ += 3; }
499 template <
class BFSet, FunctionPosition where>
502 GenIntegralSet_1_1<BFSet,ElecPotOper,mType> >
510 static const unsigned int max_nchildren = 9;
512 using ParentType::Instance;
515 static bool directional() {
return ParentType::default_directional(); }
518 using ParentType::RecurrenceRelation::expr_;
519 using ParentType::RecurrenceRelation::nflops_;
520 using ParentType::target_;
521 using ParentType::is_simple;
526 static std::string descr() {
return "OSVRRElecPot"; }
530 std::string generate_label()
const 532 typedef typename TargetType::AuxIndexType
mType;
533 static SafePtr<mType> aux0(
new mType(0u));
536 << genintegralset_label(target_->bra(),target_->ket(),aux0,target_->oper());
541 template <
class F, FunctionPosition where>
549 const unsigned int m = Tint->aux()->elem(0);
550 const F& _1 = unit<F>(dir);
555 if (a.contracted() ||
563 const bool deriv = dA.
zero() ==
false ||
572 auto a = ( where == InBra ? Tint->bra(0,0) - _1 : Tint->bra(0,0) );
574 auto b = ( where == InKet ? Tint->ket(0,0) - _1 : Tint->ket(0,0) );
580 expr_ = Vector(where == InBra ?
"PA" :
"PB")[dir] * AB_m -
581 Vector(
"PC")[dir] * AB_mp1;
588 auto Am1B_mp1 = factory.
make_child(am1,b,m+1);
589 if (is_simple()) { expr_ += Scalar(a[dir]) * Scalar(
"oo2z") * (Am1B_m - Am1B_mp1); nflops_+=4; }
594 auto ABm1_mp1 = factory.
make_child(a,bm1,m+1);
595 if (is_simple()) { expr_ += Scalar(b[dir]) * Scalar(
"oo2z") * (ABm1_m - ABm1_mp1); nflops_+=4; }
603 F a( where == InBra ? Tint->bra(0,0) - _1 : Tint->bra(0,0) );
604 F b( where == InKet ? Tint->ket(0,0) - _1 : Tint->ket(0,0) );
609 for(
unsigned int dxyz=0; dxyz<3; ++dxyz) {
611 if (is_simple() && dxyz != dir)
616 SafePtr<DGVertex> _nullptr;
625 if (where == InBra) {
626 expr_ -= Vector(dA)[dxyz] * Scalar(
"rho12_over_alpha1") * AB; nflops_ += 3; }
627 if (where == InKet) {
628 expr_ += Vector(dA)[dxyz] * Scalar(
"rho12_over_alpha2") * AB; nflops_ += 3; }
641 if (where == InBra) {
642 expr_ += Vector(dB)[dxyz] * Scalar(
"rho12_over_alpha1") * AB; nflops_ += 3; }
643 if (where == InKet) {
644 expr_ -= Vector(dB)[dxyz] * Scalar(
"rho12_over_alpha2") * AB; nflops_ += 3; }
static bool directional()
Default directionality.
Definition: vrr_1_onep_1.h:191
const SafePtr< DGVertex > & make_child(const F &A, const F &B, const F &C, const F &D, const AuxIndexType &aux=AuxIndexType(), const OperType &oper=OperType())
make_child
Definition: generic_rr.h:157
Cartesian components of 3D CGF = 1D CGF.
Definition: bfset.h:425
static bool directional()
Default directionality.
Definition: vrr_1_onep_1.h:515
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:23
Definition: stdarray.h:18
Definition: prefactors.h:159
VRR Recurrence Relation for 1-e overlap integrals.
Definition: vrr_1_onep_1.h:34
VRR Recurrence Relation for 1-e electrostatic potential integrals.
Definition: vrr_1_onep_1.h:500
static bool directional()
Default directionality.
Definition: vrr_1_onep_1.h:49
RRImpl must inherit GenericRecurrenceRelation<RRImpl>
Definition: generic_rr.h:48
QuantumNumbersA<T,N> is a set of N quantum numbers of type T implemented in terms of a C-style array...
Definition: quanta.h:198
VRR Recurrence Relation for 1-d overlap integrals.
Definition: vrr_1_onep_1.h:175
std::string to_string(const T &x)
Converts x to its string representation.
Definition: entity.h:71
void inc(unsigned int xyz, unsigned int c=1u)
Add c quanta along xyz.
Definition: bfset.h:134
these objects help to construct BraketPairs
Definition: braket.h:442
Generic integral over a one-body operator with one bfs for each particle in bra and ket...
Definition: integral_1_1.h:32
bool exists(const IncableBFSet &A)
Return true if A is valid.
Definition: bfset.h:91
Set of basis functions.
Definition: bfset.h:41
static bool directional()
Default directionality.
Definition: vrr_1_onep_1.h:340
bool zero() const
norm() == 0
Definition: bfset.h:153
Helps GenericRecurrenceRelation to work around the compiler problem with make_child.
Definition: generic_rr.h:148
VRR Recurrence Relation for 1-e kinetic energy integrals.
Definition: vrr_1_onep_1.h:325