21#ifndef _libint2_src_bin_libint_integral11_h_
22#define _libint2_src_bin_libint_integral11_h_
32 public GenIntegralSet< Oper, IncableBFSet, typename DefaultOnePBraket<BFS>::Result, typename DefaultOnePBraket<BFS>::Result, AuxQuanta >
35 typedef BFS BasisFunctionType;
39 typedef AuxQuanta AuxIndexType;
45 typedef typename parent_type::key_type key_type;
56 static const SafePtr<this_type>
Instance(
const BFS& bra0,
const BFS& ket0,
const AuxIndexType&
aux = AuxIndexType(),
const OperType&
oper =
OperType());
61 static const SafePtr<this_type>
64 return Instance(braket_wedge.left[0],
65 braket_wedge.right[0],
71 static const SafePtr<this_type>
74 return Instance(braket_wedge.left[0],
76 braket_wedge.right[0],
77 braket_wedge.right[1],
87 static const SafePtr<this_type>
Instance(
const BraType&
bra,
const KetType&
ket,
const AuxIndexType&
aux = AuxIndexType(),
const OperType&
oper = OperType());
107 bool this_precomputed()
const;
111#if USE_INT_KEY_TO_HASH
112 template <
class BFS,
class Oper,
class AuxQuanta>
114 GenIntegralSet_1_1<BFS,Oper,AuxQuanta>::singl_manager_(&this_type::key);
116# error "USE_INT_KEY_TO_HASH must be set"
119 template <
class BFS,
class Oper,
class AuxQuanta>
120 GenIntegralSet_1_1<BFS,Oper,AuxQuanta>::GenIntegralSet_1_1(
const OperType& oper,
const BraType& bra,
const KetType& ket,
const AuxIndexType& aux) :
121 parent_type(oper, bra, ket, aux)
124 throw std::runtime_error(
"GenIntegralSet_1_1::GenIntegralSet_1_1(bra,ket) -- number of BFSs in bra for particle 0 must be 1");
126 throw std::runtime_error(
"GenIntegralSet_1_1::GenIntegralSet_1_1(bra,ket) -- number of BFSs in ket for particle 0 must be 1");
128 std::cout <<
"GenIntegralSet_1_1: constructed " << this->
label() << std::endl;
132 template <
class BFS,
class Oper,
class AuxQuanta>
133 GenIntegralSet_1_1<BFS,Oper,AuxQuanta>::~GenIntegralSet_1_1()
136 std::cout <<
"GenIntegralSet_1_1: destructed " << this->label() << std::endl;
140 template <
class BFS,
class Oper,
class AuxQuanta>
141 const SafePtr< GenIntegralSet_1_1<BFS,Oper,AuxQuanta> >
143 const AuxIndexType& aux,
const OperType& oper)
145 typedef typename SingletonManagerType::value_type map_value_type;
146 key_type key = parent_type::compute_key(oper,bra,ket,aux);
147 const map_value_type& val = singl_manager_.find(key);
149 SafePtr<this_type> this_int(
new this_type(oper,bra,ket,aux));
151 const typename SingletonManagerType::value_type& val = singl_manager_.find(this_int);
152 val.second->instid_ = val.first;
158 template <
class BFS,
class Oper,
class AuxQuanta>
159 const SafePtr< GenIntegralSet_1_1<BFS,Oper,AuxQuanta> >
161 const AuxIndexType& aux,
const OperType& oper)
165 BFSRef bra0_ref(bra0);
166 BFSRef ket0_ref(ket0);
168 typedef SafePtr<BFS> BFSRef;
169 BFSRef bra0_ref(
new BFS(bra0));
170 BFSRef ket0_ref(
new BFS(ket0));
172 std::vector<BFSRef> vbra0; vbra0.push_back(bra0_ref);
173 std::vector<BFSRef> vket0; vket0.push_back(ket0_ref);
174 std::vector< std::vector<BFSRef> > vvbra; vvbra.push_back(vbra0);
175 std::vector< std::vector<BFSRef> > vvket; vvket.push_back(vket0);
178 return Instance(bra,ket,aux,oper);
181 template <
class BFS,
class Oper,
class AuxQuanta>
185 return parent_type::PtrComp::equiv(
static_cast<const parent_type*
>(
this),a);
188 template <
class BFS,
class Oper,
class AuxQuanta>
192 SafePtr<parent_type> this_parent_ptr = const_pointer_cast<parent_type,const parent_type>(EnableSafePtrFromThis<parent_type>::SafePtr_from_this());
193 SafePtr<this_type> this_ptr = static_pointer_cast<this_type>(this_parent_ptr);
194 singl_manager_.remove(this_ptr);
ArrayBraket is a lightweight implementation of Braket concept.
Definition: src/bin/libint/braket.h:38
unsigned int num_members(unsigned int p) const
Returns the number of BFS for particle p.
Definition: src/bin/libint/braket.h:75
BraketPair is a trimmed down version of ArrayBraket specialized for same-particle or different-partic...
Definition: src/bin/libint/braket.h:244
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, 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:72
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:62
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:47
PtrEquiv< this_type > PtrComp
This class provides comparison operations on pointers.
Definition: integral_1_1.h:49
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:44
bool auto_unroll() const
Implements GenIntegralSet::auto_unroll()
Definition: integral_1_1.impl.h:35
void unregister() const
Reimplements DGVertex::unregister()
Definition: integral_1_1.h:190
bool operator==(const this_type &) const
Comparison operator.
Definition: integral_1_1.h:183
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:160
GenIntegralSet is a set of integrals over functions derived from BFS.
Definition: integral.h:92
const std::string & label() const override
Specialization of DGVertex::label()
Definition: integral.h:456
const BraType & bra() const
Obtain const ref to bra.
Definition: integral.h:344
const KetType & ket() const
Obtain const ref to bra.
Definition: integral.h:351
const SafePtr< EmptySet > aux() const
Obtain the auxiliary quanta.
Definition: integral.h:365
const SafePtr< Oper > oper() const
Obtain the operator.
Definition: integral.h:358
Oper is OperSet characterized by properties Props.
Definition: oper.h:90
PtrEquiv<T> provides a set of comparison functions named 'equiv' which take as arguments a mix of ref...
Definition: equiv.h:36
SingletonStack<T,KeyType> helps to implement Singleton-like objects of type T.
Definition: singl_stack.h:44
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:24
Wedge is a typeholder for the result of a wedge product.
Definition: algebra.h:245