21#ifndef _libint2_src_bin_libint_cr11r1dotr1g1211_h_
22#define _libint2_src_bin_libint_cr11r1dotr1g1211_h_
34#include <r1dotr1g12_11_11.h>
37#include <prefactors.h>
39#include <default_params.h>
47 template <
template <
class>
class I,
class BFSet>
55 typedef I<BFSet> TargetType;
63 static SafePtr<ThisType>
Instance(
const SafePtr<TargetType>&);
69 SafePtr<TargetType>
target()
const {
return target_; };
71 SafePtr<ChildType>
child(
unsigned int i)
const;
73 SafePtr<DGVertex>
rr_target()
const override {
return static_pointer_cast<DGVertex,TargetType>(
target()); }
75 SafePtr<DGVertex>
rr_child(
unsigned int i)
const override {
return dynamic_pointer_cast<DGVertex,ChildType>(
child(i)); }
91 bool register_with_rrstack()
const;
94 static const unsigned int max_nchildren_ = 18;
95 SafePtr<TargetType> target_;
96 SafePtr<ChildType> children_[max_nchildren_];
97 unsigned int nchildren_;
99 std::string generate_label()
const override
101 std::ostringstream os;
102 os <<
"RR ( " <<
rr_target()->label() <<
" )";
109 template <
template <
class>
class I,
class F>
110 SafePtr< CR_11_R1dotR1G12_11<I,F> >
113 SafePtr<ThisType> this_ptr(
new ThisType(Tint));
115 if (this_ptr->num_children() != 0) {
116 this_ptr->register_with_rrstack<
ThisType>();
119 return SafePtr<ThisType>();
122 template <
template <
class>
class I,
class F>
124 ParentType(), target_(Tint), nchildren_(0)
126 F sh_a(Tint->bra(0,0));
127 F sh_b(Tint->ket(0,0));
128 F sh_c(Tint->bra(1,0));
129 F sh_d(Tint->ket(1,0));
138 auto* bra_ref = &bra;
139 auto* ket_ref = &ket;
141 const unsigned int ndirs =
is_simple() ? 3 : 1;
142 for(
int xyz=0; xyz<ndirs; xyz++) {
145 bra_ref->operator[](0).inc(xyz);
146 ket_ref->operator[](0).inc(xyz);
147 int next_child = nchildren_;
148 children_[next_child] = ChildType::Instance(bra[0],ket[0],bra[1],ket[1],0);
152 SafePtr<ExprType> expr0_ptr(
new ExprType(ExprType::OperatorTypes::Times,Scalar(1.0),
rr_child(next_child)));
156 bra_ref->operator[](0).dec(xyz);
157 ket_ref->operator[](0).dec(xyz);
161 template <
template <
class>
class I,
class F>
162 SafePtr< typename CR_11_R1dotR1G12_11<I,F>::ChildType >
165 assert(i>=0 && i<nchildren_);
167 for(
int c=0; c<max_nchildren_; c++) {
168 if (children_[c] != 0) {
AlgebraicOperator is an algebraic operator that acts on objects of type T.
Definition: algebra.h:50
Set of basis functions.
Definition: bfset.h:42
Compute relation for 2-e integrals of the r1.r1 x G12 operators.
Definition: comp_11_r1dotr1g12_11.h:49
RecurrenceRelation::ExprType ExprType
The type of expressions in which RecurrenceRelations result.
Definition: comp_11_r1dotr1g12_11.h:58
unsigned int num_children() const override
Implementation of RecurrenceRelation::num_children()
Definition: comp_11_r1dotr1g12_11.h:67
SafePtr< ChildType > child(unsigned int i) const
child(i) returns pointer to the i-th child
Definition: comp_11_r1dotr1g12_11.h:163
SafePtr< DGVertex > rr_target() const override
Implementation of RecurrenceRelation::rr_target()
Definition: comp_11_r1dotr1g12_11.h:73
bool is_simple() const override
Implementation of RecurrenceRelation::is_simple()
Definition: comp_11_r1dotr1g12_11.h:77
static SafePtr< ThisType > Instance(const SafePtr< TargetType > &)
Use Instance() to obtain an instance of RR.
Definition: comp_11_r1dotr1g12_11.h:111
SafePtr< TargetType > target() const
target() returns pointer to the i-th child
Definition: comp_11_r1dotr1g12_11.h:69
SafePtr< DGVertex > rr_child(unsigned int i) const override
Implementation of RecurrenceRelation::rr_child()
Definition: comp_11_r1dotr1g12_11.h:75
Definition: integral_decl.h:38
RecurrenceRelation describes all recurrence relations.
Definition: rr.h:99
void add_expr(const SafePtr< ExprType > &a, int minus=1)
Adds a (or -a, if minus = -1) to expr_.
Definition: rr.cc:307
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:24
CR_11_R1dotR1G12_11< R1dotR1G12_11_11, CGShell > CR_11_R1dotR1G12_11_sq
Useful typedefs.
Definition: comp_11_r1dotr1g12_11.h:174
TrivialBFSet<T> defines static member result, which is true if T is a basis function set consisting o...
Definition: bfset.h:892