21 #ifndef _libint2_src_bin_libint_integral11_h_ 22 #define _libint2_src_bin_libint_integral11_h_ 34 public GenIntegralSet< Oper, IncableBFSet, typename DefaultOnePBraket<BFS>::Result, typename DefaultOnePBraket<BFS>::Result, AuxQuanta >
37 typedef BFS BasisFunctionType;
41 typedef AuxQuanta AuxIndexType;
47 typedef typename parent_type::key_type key_type;
58 static const SafePtr<this_type> Instance(
const BFS& bra0,
const BFS& ket0,
const AuxIndexType& aux = AuxIndexType(),
const OperType& oper =
OperType());
63 static const SafePtr<this_type>
65 const AuxIndexType& aux = AuxIndexType(),
const OperType& oper =
OperType()) {
66 return Instance(braket_wedge.left[0],
67 braket_wedge.right[0],
73 static const SafePtr<this_type>
75 const AuxIndexType& aux = AuxIndexType(),
const OperType& oper =
OperType()) {
76 return Instance(braket_wedge.left[0],
78 braket_wedge.right[0],
79 braket_wedge.right[1],
89 static const SafePtr<this_type> Instance(
const BraType& bra,
const KetType& ket,
const AuxIndexType& aux = AuxIndexType(),
const OperType& oper = OperType());
93 bool operator==(
const this_type&)
const;
96 void unregister()
const;
99 bool auto_unroll()
const;
103 GenIntegralSet_1_1(
const OperType& oper,
const BraType& bra,
const KetType& ket,
const AuxIndexType& aux);
106 static SingletonManagerType singl_manager_;
109 bool this_precomputed()
const;
113 #if USE_INT_KEY_TO_HASH 114 template <
class BFS,
class Oper,
class AuxQuanta>
115 typename GenIntegralSet_1_1<BFS,Oper,AuxQuanta>::SingletonManagerType
116 GenIntegralSet_1_1<BFS,Oper,AuxQuanta>::singl_manager_(&this_type::key);
118 # error "USE_INT_KEY_TO_HASH must be set" 121 template <
class BFS,
class Oper,
class AuxQuanta>
122 GenIntegralSet_1_1<BFS,Oper,AuxQuanta>::GenIntegralSet_1_1(
const OperType& oper,
const BraType& bra,
const KetType& ket,
const AuxIndexType& aux) :
123 parent_type(oper, bra, ket, aux)
126 throw std::runtime_error(
"GenIntegralSet_1_1::GenIntegralSet_1_1(bra,ket) -- number of BFSs in bra for particle 0 must be 1");
128 throw std::runtime_error(
"GenIntegralSet_1_1::GenIntegralSet_1_1(bra,ket) -- number of BFSs in ket for particle 0 must be 1");
130 std::cout <<
"GenIntegralSet_1_1: constructed " << this->
label() << std::endl;
134 template <
class BFS,
class Oper,
class AuxQuanta>
135 GenIntegralSet_1_1<BFS,Oper,AuxQuanta>::~GenIntegralSet_1_1()
138 std::cout <<
"GenIntegralSet_1_1: destructed " << this->label() << std::endl;
142 template <
class BFS,
class Oper,
class AuxQuanta>
143 const SafePtr< GenIntegralSet_1_1<BFS,Oper,AuxQuanta> >
145 const AuxIndexType& aux,
const OperType& oper)
147 typedef typename SingletonManagerType::value_type map_value_type;
148 key_type key = parent_type::compute_key(oper,bra,ket,aux);
149 const map_value_type& val = singl_manager_.find(key);
151 SafePtr<this_type> this_int(
new this_type(oper,bra,ket,aux));
153 const typename SingletonManagerType::value_type& val = singl_manager_.find(this_int);
154 val.second->instid_ = val.first;
160 template <
class BFS,
class Oper,
class AuxQuanta>
161 const SafePtr< GenIntegralSet_1_1<BFS,Oper,AuxQuanta> >
163 const AuxIndexType& aux,
const OperType& oper)
167 BFSRef bra0_ref(bra0);
168 BFSRef ket0_ref(ket0);
170 typedef SafePtr<BFS> BFSRef;
171 BFSRef bra0_ref(
new BFS(bra0));
172 BFSRef ket0_ref(
new BFS(ket0));
174 vector<BFSRef> vbra0; vbra0.push_back(bra0_ref);
175 vector<BFSRef> vket0; vket0.push_back(ket0_ref);
176 vector< vector<BFSRef> > vvbra; vvbra.push_back(vbra0);
177 vector< vector<BFSRef> > vvket; vvket.push_back(vket0);
180 return Instance(bra,ket,aux,oper);
183 template <
class BFS,
class Oper,
class AuxQuanta>
187 return parent_type::PtrComp::equiv(static_cast<const parent_type*>(
this),a);
190 template <
class BFS,
class Oper,
class AuxQuanta>
194 SafePtr<parent_type> this_parent_ptr = const_pointer_cast<parent_type,const parent_type>(EnableSafePtrFromThis<parent_type>::SafePtr_from_this());
195 SafePtr<this_type> this_ptr = static_pointer_cast<this_type>(this_parent_ptr);
196 singl_manager_.remove(this_ptr);
const BraType & bra() const
Obtain const ref to bra.
Definition: integral.h:346
SingletonStack<T,KeyType> helps to implement Singleton-like objects of type T.
Definition: singl_stack.h:43
unsigned int num_members(unsigned int p) const
Returns the number of BFS for particle p.
Definition: braket.h:75
virtual const std::string & label() const
Specialization of DGVertex::label()
Definition: integral.h:458
void unregister() const
Reimplements DGVertex::unregister()
Definition: integral_1_1.h:192
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:24
GenIntegralSet is a set of integrals over functions derived from BFS.
Definition: integral.h:91
static const SafePtr< this_type > Instance(const BFS &bra0, const BFS &ket0, const AuxIndexType &aux=AuxIndexType(), const OperType &oper=OperType())
This "constructor" takes basis function sets.
Definition: integral_1_1.h:162
Wedge is a typeholder for the result of a wedge product.
Definition: algebra.h:246
const KetType & ket() const
Obtain const ref to bra.
Definition: integral.h:353
PtrEquiv<T> provides a set of comparison functions named 'equiv' which take as arguments a mix of ref...
Definition: equiv.h:36
Oper is OperSet characterized by properties Props.
Definition: oper.h:90
bool operator==(const this_type &) const
Comparison operator.
Definition: integral_1_1.h:185
Generic integral over a one-body operator with one bfs for each particle in bra and ket.
Definition: integral_1_1.h:33
static const SafePtr< this_type > Instance(const algebra::Wedge< BraketPair< BFS, PBra >, BraketPair< BFS, PKet > > &braket_wedge, const AuxIndexType &aux=AuxIndexType(), const OperType &oper=OperType())
This "constructor" uses a wedge of 2 physicists brakets.
Definition: integral_1_1.h:64
PtrEquiv< this_type > PtrComp
This class provides comparison operations on pointers.
Definition: integral_1_1.h:51
static const SafePtr< this_type > Instance(const algebra::Wedge< BraketPair< BFS, CBra >, BraketPair< BFS, CKet > > &braket_wedge, const AuxIndexType &aux=AuxIndexType(), const OperType &oper=OperType())
This "constructor" uses a wedge of 2 chemists brakets.
Definition: integral_1_1.h:74
BraketPair is a trimmed down version of ArrayBraket specialized for same-particle or different-partic...
Definition: braket.h:244
ArrayBraket is a lightweight implementation of Braket concept.
Definition: braket.h:38
GenIntegralSet_1_1< typename BFS::iter_type, typename Oper::iter_type, typename AuxQuanta::iter_type > iter_type
this is a set of these subobjects
Definition: integral_1_1.h:46
SingletonStack< this_type, key_type > SingletonManagerType
This the type of the object that manages objects of this type as Singletons.
Definition: integral_1_1.h:49