21#ifndef _libint2_src_bin_libint_integral11_h_
22#define _libint2_src_bin_libint_integral11_h_
32template <
class BFS,
class Oper,
class AuxQuanta = EmptySet>
35 Oper, IncableBFSet, typename DefaultOnePBraket<BFS>::Result,
36 typename DefaultOnePBraket<BFS>::Result, AuxQuanta> {
38 typedef BFS BasisFunctionType;
42 typedef AuxQuanta AuxIndexType;
49 typename AuxQuanta::iter_type>
51 typedef typename parent_type::key_type key_type;
64 static const std::shared_ptr<this_type>
Instance(
65 const BFS& bra0,
const BFS& ket0,
66 const AuxIndexType&
aux = AuxIndexType(),
72 static const std::shared_ptr<this_type>
75 return Instance(braket_wedge.left[0],
76 braket_wedge.right[0],
82 static const std::shared_ptr<this_type>
85 return Instance(braket_wedge.left[0],
87 braket_wedge.right[0],
88 braket_wedge.right[1],
99 static const std::shared_ptr<this_type>
Instance(
100 const BraType&
bra,
const KetType&
ket,
101 const AuxIndexType&
aux = AuxIndexType(),
102 const OperType&
oper = OperType());
118 const KetType&
ket,
const AuxIndexType&
aux);
124 bool this_precomputed()
const;
127#if USE_INT_KEY_TO_HASH
128template <
class BFS,
class Oper,
class AuxQuanta>
130 GenIntegralSet_1_1<BFS, Oper, AuxQuanta>::singl_manager_(&this_type::key);
132#error "USE_INT_KEY_TO_HASH must be set"
135template <
class BFS,
class Oper,
class AuxQuanta>
136GenIntegralSet_1_1<BFS, Oper, AuxQuanta>::GenIntegralSet_1_1(
137 const OperType& oper,
const BraType& bra,
const KetType& ket,
138 const AuxIndexType& aux)
139 : parent_type(oper, bra, ket, aux) {
141 throw std::runtime_error(
142 "GenIntegralSet_1_1::GenIntegralSet_1_1(bra,ket) -- number of BFSs in "
143 "bra for particle 0 must be 1");
145 throw std::runtime_error(
146 "GenIntegralSet_1_1::GenIntegralSet_1_1(bra,ket) -- number of BFSs in "
147 "ket for particle 0 must be 1");
149 std::cout <<
"GenIntegralSet_1_1: constructed " << this->
label() << std::endl;
153template <
class BFS,
class Oper,
class AuxQuanta>
154GenIntegralSet_1_1<BFS, Oper, AuxQuanta>::~GenIntegralSet_1_1() {
156 std::cout <<
"GenIntegralSet_1_1: destructed " << this->label() << std::endl;
160template <
class BFS,
class Oper,
class AuxQuanta>
161const std::shared_ptr<GenIntegralSet_1_1<BFS, Oper, AuxQuanta> >
164 const AuxIndexType& aux,
166 typedef typename SingletonManagerType::value_type map_value_type;
167 key_type key = parent_type::compute_key(oper, bra, ket, aux);
168 const map_value_type& val = singl_manager_.find(key);
170 std::shared_ptr<this_type> this_int(
new this_type(oper, bra, ket, aux));
172 const typename SingletonManagerType::value_type& val =
173 singl_manager_.find(this_int);
174 val.second->instid_ = val.first;
180template <
class BFS,
class Oper,
class AuxQuanta>
181const std::shared_ptr<GenIntegralSet_1_1<BFS, Oper, AuxQuanta> >
184 const AuxIndexType& aux,
188 BFSRef bra0_ref(bra0);
189 BFSRef ket0_ref(ket0);
191 typedef std::shared_ptr<BFS> BFSRef;
192 BFSRef bra0_ref(
new BFS(bra0));
193 BFSRef ket0_ref(
new BFS(ket0));
195 std::vector<BFSRef> vbra0;
196 vbra0.push_back(bra0_ref);
197 std::vector<BFSRef> vket0;
198 vket0.push_back(ket0_ref);
199 std::vector<std::vector<BFSRef> > vvbra;
200 vvbra.push_back(vbra0);
201 std::vector<std::vector<BFSRef> > vvket;
202 vvket.push_back(vket0);
205 return Instance(bra, ket, aux, oper);
208template <
class BFS,
class Oper,
class AuxQuanta>
211 return parent_type::PtrComp::equiv(
static_cast<const parent_type*
>(
this), a);
214template <
class BFS,
class Oper,
class AuxQuanta>
216 std::shared_ptr<parent_type> this_parent_ptr =
217 std::const_pointer_cast<parent_type, const parent_type>(
218 std::enable_shared_from_this<parent_type>::shared_from_this());
219 std::shared_ptr<this_type> this_ptr =
220 std::static_pointer_cast<this_type>(this_parent_ptr);
221 singl_manager_.remove(this_ptr);
ArrayBraket is a lightweight implementation of Braket concept.
Definition src/bin/libint/braket.h:39
unsigned int num_members(unsigned int p) const
Returns the number of BFS for particle p.
Definition src/bin/libint/braket.h:79
BraketPair is a trimmed down version of ArrayBraket specialized for same-particle or different-partic...
Definition src/bin/libint/braket.h:247
Generic integral over a one-body operator with one bfs for each particle in bra and ket.
Definition integral_1_1.h:36
static const std::shared_ptr< 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:73
static const std::shared_ptr< 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:182
PtrEquiv< this_type > PtrComp
This class provides comparison operations on pointers.
Definition integral_1_1.h:56
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:50
bool auto_unroll() const
Implements GenIntegralSet::auto_unroll()
Definition integral_1_1.impl.h:32
void unregister() const
Reimplements DGVertex::unregister()
Definition integral_1_1.h:215
static const std::shared_ptr< 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:83
bool operator==(const this_type &) const
Comparison operator.
Definition integral_1_1.h:209
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:54
GenIntegralSet is a set of integrals over functions derived from BFS.
Definition integral.h:99
const std::string & label() const override
Specialization of DGVertex::label()
Definition integral.h:525
const BraType & bra() const
Obtain const ref to bra.
Definition integral.h:406
const KetType & ket() const
Obtain const ref to bra.
Definition integral.h:414
const std::shared_ptr< Oper > oper() const
Obtain the operator.
Definition integral.h:421
const std::shared_ptr< AuxQuanta > aux() const
Obtain the auxiliary quanta.
Definition integral.h:428
Oper is OperSet characterized by properties Props.
Definition oper.h:91
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:45
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:248