21#ifndef _libint2_src_bin_libint_cr11r2dotr2g1211_h_
22#define _libint2_src_bin_libint_cr11r2dotr2g1211_h_
26#include <default_params.h>
30#include <prefactors.h>
31#include <r2dotr2g12_11_11.h>
48template <
template <
class>
class I,
class BFSet>
54 typedef I<BFSet> TargetType;
63 static std::shared_ptr<ThisType>
Instance(
const std::shared_ptr<TargetType>&);
69 std::shared_ptr<TargetType>
target()
const {
return target_; };
71 std::shared_ptr<ChildType>
child(
unsigned int i)
const;
73 std::shared_ptr<DGVertex>
rr_target()
const override {
74 return std::static_pointer_cast<DGVertex, TargetType>(
target());
77 std::shared_ptr<DGVertex>
rr_child(
unsigned int i)
const override {
78 return std::dynamic_pointer_cast<DGVertex, ChildType>(
child(i));
93 bool register_with_rrstack()
const;
96 static const unsigned int max_nchildren_ = 3;
97 std::shared_ptr<TargetType> target_;
98 std::shared_ptr<ChildType> children_[max_nchildren_];
99 unsigned int nchildren_;
101 std::string generate_label()
const override {
102 std::ostringstream os;
103 os <<
"RR ( " <<
rr_target()->label() <<
" )";
108template <
template <
class>
class I,
class F>
110 const std::shared_ptr<TargetType>& Tint) {
111 std::shared_ptr<ThisType> this_ptr(
new ThisType(Tint));
113 if (this_ptr->num_children() != 0) {
114 this_ptr->register_with_rrstack<
ThisType>();
117 return std::shared_ptr<ThisType>();
120template <
template <
class>
class I,
class F>
122 const std::shared_ptr<I<F> >& Tint)
123 : ParentType(), target_(Tint), nchildren_(0) {
124 F sh_a(Tint->bra(0, 0));
125 F sh_b(Tint->ket(0, 0));
126 F sh_c(Tint->bra(1, 0));
127 F sh_d(Tint->ket(1, 0));
136 auto* bra_ref = &bra;
137 auto* ket_ref = &ket;
139 const unsigned int ndirs =
is_simple() ? 3 : 1;
140 for (
int xyz = 0; xyz < ndirs; xyz++) {
142 bra_ref->operator[](1).inc(xyz);
143 ket_ref->operator[](1).inc(xyz);
144 int next_child = nchildren_;
145 children_[next_child] =
146 ChildType::Instance(bra[0], ket[0], bra[1], ket[1], 0);
150 std::shared_ptr<ExprType> expr0_ptr(
new ExprType(
151 ExprType::OperatorTypes::Times, Scalar(1.0),
rr_child(next_child)));
155 bra_ref->operator[](1).dec(xyz);
156 ket_ref->operator[](1).dec(xyz);
160template <
template <
class>
class I,
class F>
161std::shared_ptr<typename CR_11_R2dotR2G12_11<I, F>::ChildType>
163 assert(i >= 0 && i < nchildren_);
165 for (
int c = 0; c < max_nchildren_; c++) {
166 if (children_[c] != 0) {
167 if (nc == i)
return children_[c];
AlgebraicOperator is an algebraic operator that acts on objects of type T.
Definition algebra.h:47
Set of basis functions.
Definition bfset.h:43
Compute relation for 2-e integrals of the r2.r2 x G12 operators.
Definition comp_11_r2dotr2g12_11.h:49
std::shared_ptr< ChildType > child(unsigned int i) const
child(i) returns pointer to the i-th child
Definition comp_11_r2dotr2g12_11.h:162
std::shared_ptr< DGVertex > rr_child(unsigned int i) const override
Implementation of RecurrenceRelation::rr_child()
Definition comp_11_r2dotr2g12_11.h:77
static std::shared_ptr< ThisType > Instance(const std::shared_ptr< TargetType > &)
Use Instance() to obtain an instance of RR.
Definition comp_11_r2dotr2g12_11.h:109
bool is_simple() const override
Implementation of RecurrenceRelation::is_simple()
Definition comp_11_r2dotr2g12_11.h:81
std::shared_ptr< DGVertex > rr_target() const override
Implementation of RecurrenceRelation::rr_target()
Definition comp_11_r2dotr2g12_11.h:73
unsigned int num_children() const override
Implementation of RecurrenceRelation::num_children()
Definition comp_11_r2dotr2g12_11.h:67
RecurrenceRelation::ExprType ExprType
The type of expressions in which RecurrenceRelations result.
Definition comp_11_r2dotr2g12_11.h:57
std::shared_ptr< TargetType > target() const
target() returns pointer to the i-th child
Definition comp_11_r2dotr2g12_11.h:69
Definition integral_decl.h:40
RecurrenceRelation describes all recurrence relations.
Definition rr.h:97
void add_expr(const std::shared_ptr< ExprType > &a, int minus=1)
Adds a (or -a, if minus = -1) to expr_.
Definition rr.cc:305
Defaults definitions for various parameters assumed by Libint.
Definition algebra.cc:24
CR_11_R2dotR2G12_11< R2dotR2G12_11_11, CGShell > CR_11_R2dotR2G12_11_sq
Useful typedefs.
Definition comp_11_r2dotr2g12_11.h:174
TrivialBFSet<T> defines static member result, which is true if T is a basis function set consisting o...
Definition bfset.h:906