20 #ifndef _libint2_src_bin_libint_r1dotr1g121111_h_ 21 #define _libint2_src_bin_libint_r1dotr1g121111_h_ 34 template <
class BFS>
class R1dotR1G12_11_11 :
35 public GenIntegralSet< R1dotR1_G12, IncableBFSet, typename DefaultTwoPBraket<BFS>::Result, typename DefaultTwoPBraket<BFS>::Result, EmptySet >
38 typedef BFS BasisFunctionType;
39 typedef R1dotR1_G12 OperType;
40 typedef typename DefaultTwoPBraket<BFS>::Result BraType;
41 typedef typename DefaultTwoPBraket<BFS>::Result KetType;
43 typedef R1dotR1G12_11_11<BFS> this_type;
52 typedef typename parent_type::key_type key_type;
59 static const SafePtr<R1dotR1G12_11_11> Instance(
const BFS& bra0,
const BFS& ket0,
const BFS& bra1,
const BFS& ket1);
61 static const SafePtr<R1dotR1G12_11_11> Instance(
const BraType& bra,
const KetType& ket,
const AuxIndexType& aux);
65 bool operator==(
const this_type&)
const;
66 #if OVERLOAD_GENINTEGRALSET_LABEL 67 const std::string& label()
const;
73 R1dotR1G12_11_11(
const BraType& bra,
const KetType& ket,
const AuxIndexType& aux);
76 static SingletonManagerType singl_manager_;
79 bool this_precomputed()
const;
80 #if OVERLOAD_GENINTEGRALSET_LABEL 81 mutable std::string label_;
86 #if USE_INT_KEY_TO_HASH 91 # error "USE_INT_KEY_TO_HASH must be set" 99 throw std::runtime_error(
"R1dotR1G12_11_11<BFS>::R1dotR1G12_11_11(bra,ket) -- number of BFSs in bra for particle 0 must be 1");
101 throw std::runtime_error(
"R1dotR1G12_11_11<BFS>::R1dotR1G12_11_11(bra,ket) -- number of BFSs in bra for particle 1 must be 1");
103 throw std::runtime_error(
"R1dotR1G12_11_11<BFS>::R1dotR1G12_11_11(bra,ket) -- number of BFSs in ket for particle 0 must be 1");
105 throw std::runtime_error(
"R1dotR1G12_11_11<BFS>::R1dotR1G12_11_11(bra,ket) -- number of BFSs in ket for particle 1 must be 1");
107 std::cout <<
"R1dotR1G12_11_11: constructed " << this->
label() << std::endl;
115 std::cout <<
"R1dotR1G12_11_11: destructed " << this->
label() << std::endl;
120 const SafePtr< R1dotR1G12_11_11<BFS> >
123 typedef typename SingletonManagerType::value_type map_value_type;
125 const map_value_type& val = singl_manager_.
find(key);
129 const typename SingletonManagerType::value_type& val = singl_manager_.
find(this_int);
130 val.second->instid_ = val.first;
137 const SafePtr< R1dotR1G12_11_11<BFS> >
142 BFSRef bra0_ref(bra0);
143 BFSRef bra1_ref(bra1);
144 BFSRef ket0_ref(ket0);
145 BFSRef ket1_ref(ket1);
147 typedef SafePtr<BFS> BFSRef;
148 BFSRef bra0_ref(
new BFS(bra0));
149 BFSRef bra1_ref(
new BFS(bra1));
150 BFSRef ket0_ref(
new BFS(ket0));
151 BFSRef ket1_ref(
new BFS(ket1));
153 vector<BFSRef> vbra0; vbra0.push_back(bra0_ref);
154 vector<BFSRef> vbra1; vbra1.push_back(bra1_ref);
155 vector<BFSRef> vket0; vket0.push_back(ket0_ref);
156 vector<BFSRef> vket1; vket1.push_back(ket1_ref);
157 vector< vector<BFSRef> > vvbra; vvbra.push_back(vbra0); vvbra.push_back(vbra1);
158 vector< vector<BFSRef> > vvket; vvket.push_back(vket0); vvket.push_back(vket1);
162 return Instance(bra,ket,aux);
169 return parent_type::PtrComp::equiv(static_cast<const parent_type*>(
this),a);
172 #if OVERLOAD_GENINTEGRALSET_LABEL 177 if (label_.empty()) {
179 os <<
"(" << parent_type::bra_.member(0,0)->label() <<
" " 180 << parent_type::ket_.member(0,0)->label()
181 <<
" | r_1^2 * G12 | " 182 << parent_type::bra_.member(1,0)->label() <<
" " 183 << parent_type::ket_.member(1,0)->label() <<
")";
SingletonStack<T,KeyType> helps to implement Singleton-like objects of type T.
Definition: singl_stack.h:42
unsigned int num_members(unsigned int p) const
Returns the number of BFS for particle p.
Definition: braket.h:247
R1dotR1G12_11_11 – integral over R1dotR1_G12 operator with one bfs for each particle in bra and ket...
Definition: integral_decl.h:39
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:23
GenIntegralSet is a set of integrals over functions derived from BFS.
Definition: integral.h:89
PtrEquiv< this_type > PtrComp
This class provides comparison operations on pointers.
Definition: r1dotr1g12_11_11.h:50
Definition: stdarray.h:18
bool operator==(const this_type &) const
Comparison operator.
Definition: r1dotr1g12_11_11.h:167
const std::string & label() const
Specialization of GenIntegralSet::label()
Definition: r1dotr1g12_11_11.h:175
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
const value_type & find(const SafePtr< T > &obj)
Returns the pointer to the unique instance of object obj.
Definition: singl_stack.h:79
SingletonStack< R1dotR1G12_11_11, key_type > SingletonManagerType
This the type of the object that manages GenIntegralSet's as Singletons.
Definition: r1dotr1g12_11_11.h:54
PtrEquiv<T> provides a set of comparison functions named 'equiv' which take as arguments a mix of ref...
Definition: equiv.h:35
const SafePtr< EmptySet > aux() const
Obtain the auxiliary quanta.
GenIntegralSet< OperType, IncableBFSet, BraType, KetType, AuxIndexType > parent_type
This is the immediate parent.
Definition: r1dotr1g12_11_11.h:48
const KetType & ket() const
Obtain const ref to bra.
DGVertex::KeyReturnType key() const
Implements Hashable::key()
Definition: integral.h:171
R1dotR1G12_11_11< CGShell > R1dotR1G12_11_11_sq
the following typedefs are useful
Definition: r1dotr1g12_11_11.h:198
const BraType & bra() const
Obtain const ref to bra.
ArrayBraket is a lightweight implementation of Braket concept.
Definition: braket.h:214
static key_type compute_key(const R1dotR1_G12 &O, const BraType &bra, const KetType &ket, const EmptySet &aux)
computes a key. it's protected so that derived classes can use it to implement smart caching in const...
Definition: integral.h:183
R1dotR1G12_11_11< typename BFS::iter_type > iter_type
R1dotR1G12_11_11 is a set of these subobjects.
Definition: r1dotr1g12_11_11.h:46
DefaultQuantumNumbers< int, 0 >::Result EmptySet
EmptySet is the type that describes null set of auxiliary indices.
Definition: quanta.h:405