LIBINT 2.9.0
hrr.h
1/*
2 * Copyright (C) 2004-2024 Edward F. Valeev
3 *
4 * This file is part of Libint compiler.
5 *
6 * Libint compiler is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * Libint compiler is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with Libint compiler. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21#ifndef _libint2_src_bin_libint_hrr_h_
22#define _libint2_src_bin_libint_hrr_h_
23
24#include <algebra.h>
25#include <context.h>
26#include <default_params.h>
27#include <dgvertex.h>
28#include <dims.h>
29#include <integral.h>
30#include <prefactors.h>
31#include <rr.h>
32#include <task.h>
33
34#include <cassert>
35#include <iostream>
36#include <sstream>
37#include <stdexcept>
38#include <string>
39#include <vector>
40
41namespace libint2 {
42
55template <class IntType, class BFSet, int part, FunctionPosition loc_a,
56 unsigned int pos_a, FunctionPosition loc_b, unsigned int pos_b>
57class HRR : public RecurrenceRelation {
58 public:
62 typedef IntType TargetType;
63 typedef IntType ChildType;
66
75 static std::shared_ptr<ThisType> Instance(const std::shared_ptr<TargetType>&,
76 unsigned int dir = 0);
77 virtual ~HRR();
78
80 BraketDirection braket_direction() const override {
81 if (loc_b == InBra && loc_a == InKet)
82 return BraketDirection::BraToKet;
83 else if (loc_b == InKet && loc_a == InBra)
84 return BraketDirection::KetToBra;
85 else
86 return BraketDirection::None;
87 }
88
92 static bool directional() {
93 if (boost::is_same<BasisFunctionType, CGShell>::value) return false;
94 return true;
95 }
96
98 unsigned int num_children() const override { return nchildren_; }
100 std::shared_ptr<TargetType> target() const { return target_; };
102 std::shared_ptr<ChildType> child(unsigned int i) const;
104 std::shared_ptr<DGVertex> rr_target() const override {
105 return std::static_pointer_cast<DGVertex, TargetType>(target());
106 }
108 std::shared_ptr<DGVertex> rr_child(unsigned int i) const override {
109 return std::static_pointer_cast<DGVertex, ChildType>(child(i));
110 }
112 bool is_simple() const override { return TrivialBFSet<BFSet>::result; }
114 std::string spfunction_call(
115 const std::shared_ptr<CodeContext>& context,
116 const std::shared_ptr<ImplicitDimensions>& dims) const override;
117
118 private:
124 HRR(const std::shared_ptr<TargetType>&, unsigned int dir);
125
126 unsigned int dir_;
127 std::shared_ptr<TargetType> target_;
128 static const unsigned int max_nchildren_ = 8;
129 std::shared_ptr<ChildType> children_[max_nchildren_];
130 unsigned int nchildren_;
131
132 void oper_checks() const;
133
135 std::string generate_label() const override;
137 std::shared_ptr<ImplicitDimensions> adapt_dims_(
138 const std::shared_ptr<ImplicitDimensions>& dims) const override;
140 bool register_with_rrstack() const;
146 bool expl_high_dim() const;
147 bool expl_low_dim() const;
148};
149
150template <class IntType, class F, int part, FunctionPosition loc_a,
151 unsigned int pos_a, FunctionPosition loc_b, unsigned int pos_b>
152std::shared_ptr<HRR<IntType, F, part, loc_a, pos_a, loc_b, pos_b> >
154 const std::shared_ptr<TargetType>& Tint, unsigned int dir) {
155 std::shared_ptr<ThisType> this_ptr(new ThisType(Tint, dir));
156 // Do post-construction duties
157 if (this_ptr->num_children() != 0) {
158 this_ptr->register_with_rrstack();
159 return this_ptr;
160 }
161 return std::shared_ptr<ThisType>();
162}
163
164template <class IntType, class F, int part, FunctionPosition loc_a,
165 unsigned int pos_a, FunctionPosition loc_b, unsigned int pos_b>
167 const std::shared_ptr<TargetType>& Tint, unsigned int dir)
168 : dir_(dir), target_(Tint), nchildren_(0) {
169 using namespace libint2::algebra;
170 using namespace libint2::prefactor;
171
172 // assume that always transfering from Bra to Ket and vice versa
173 assert(loc_a != loc_b);
174
175 target_ = Tint;
176 const typename IntType::AuxQuantaType& aux = Tint->aux();
177 const typename IntType::OperType& oper = Tint->oper();
178
179 // can move across operator only if it's multiplicative
180 if (loc_a != loc_b && oper.hermitian(part) != +1) {
181 return;
182 }
183
184 typedef typename IntType::BraType IBraType;
185 typedef typename IntType::KetType IKetType;
186 IBraType* bra = new IBraType(Tint->bra());
187 IKetType* ket = new IKetType(Tint->ket());
188
189 //
190 // InBra and InKet cases have to be treated explicitly since BraType and
191 // KetType don't have to match
192 //
193 if (loc_a == InKet && loc_b == InBra) {
194 F a(ket->member(part, pos_a));
195 F b(bra->member(part, pos_b));
196
197 // See if b-1 exists
198 F bm1(b);
199 bm1.dec(dir_);
200 if (!exists(bm1)) {
201 delete bra;
202 delete ket;
203 return;
204 }
205 bra->set_member(bm1, part, pos_b); // set b permanently to b-1_i
206
207 {
208 F ap1(a);
209 ap1.inc(dir_);
210 ket->set_member(ap1, part, pos_a);
211 children_[nchildren_++] = IntType::Instance(*bra, *ket, aux, oper);
212 ket->set_member(a, part, pos_a);
213 }
214
215 children_[nchildren_++] = IntType::Instance(*bra, *ket, aux, oper);
216
217 if (!is_simple()) { // treatment of derivative terms differs for shell sets
218 // and integrals since in computing shell sets
219 // transfer/build will occur in all 3 directions change
220 // in up to all three derivative indices will occur
221
222 for (unsigned int xyz = 0; xyz < 3; ++xyz) {
223 // is a differentiated in this direction? add another term
224 if (a.deriv().d(xyz) > 0) {
225 F a_der_m1(a);
226 a_der_m1.deriv().dec(xyz);
227 ket->set_member(a_der_m1, part, pos_a);
228 children_[nchildren_++] = IntType::Instance(*bra, *ket, aux, oper);
229 ket->set_member(a, part, pos_a);
230 }
231 // is b differentiated in this direction? add another term
232 if (bm1.deriv().d(xyz) > 0) {
233 F bm1_der_m1(bm1);
234 bm1_der_m1.deriv().dec(xyz);
235 bra->set_member(bm1_der_m1, part, pos_b);
236 children_[nchildren_++] = IntType::Instance(*bra, *ket, aux, oper);
237 bra->set_member(bm1, part, pos_b);
238 }
239 }
240 }
241
242 if (is_simple()) {
243 // ( b | a ) = ( b-1_i | a+1_i ) - AB_i ( b-1_i | a ) = ( b-1_i | a+1_i )
244 // + BA_i ( b-1_i | a ) the latter is amenable to generate fmadd
245 // instruction
246 expr_ = children_[0] + prefactors.Y_X[part][dir] * children_[1];
247
248 // is a differentiated in this direction? add another term
249 const bool aderiv = a.deriv().d(dir_) > 0;
250 if (aderiv) {
251 F a_der_m1(a);
252 a_der_m1.deriv().dec(dir_);
253 ket->set_member(a_der_m1, part, pos_a);
254 children_[nchildren_++] = IntType::Instance(*bra, *ket, aux, oper);
255 ket->set_member(a, part, pos_a);
256 }
257
258 // is b differentiated in this direction? add another term
259 const bool bderiv = bm1.deriv().d(dir_) > 0;
260 if (bderiv) {
261 F bm1_der_m1(bm1);
262 bm1_der_m1.deriv().dec(dir_);
263 bra->set_member(bm1_der_m1, part, pos_b);
264 children_[nchildren_++] = IntType::Instance(*bra, *ket, aux, oper);
265 bra->set_member(bm1, part, pos_b);
266 }
267
268 if (aderiv) expr_ += Vector(a.deriv())[dir_] * children_[2];
269 if (bderiv) expr_ -= Vector(b.deriv())[dir_] * children_[aderiv ? 3 : 2];
270 }
271 } // a in ket, b in bra
272
273 if (loc_a == InBra && loc_b == InKet) {
274 F a(bra->member(part, pos_a));
275 F b(ket->member(part, pos_b));
276
277 // See if b-1 exists
278 F bm1(b);
279 bm1.dec(dir_);
280 if (!exists(bm1)) {
281 delete bra;
282 delete ket;
283 return;
284 }
285 ket->set_member(bm1, part, pos_b); // set b permanently to b-1_i
286
287 {
288 F ap1(a);
289 ap1.inc(dir_);
290 bra->set_member(ap1, part, pos_a);
291 children_[nchildren_++] = IntType::Instance(*bra, *ket, aux, oper);
292 bra->set_member(a, part, pos_a);
293 }
294
295 children_[nchildren_++] = IntType::Instance(*bra, *ket, aux, oper);
296
297 if (!is_simple()) { // treatment of derivative terms differs for shell sets
298 // and integrals since in computing shell sets
299 // transfer/build will occur in all 3 directions change
300 // in up to all three derivative indices will occur
301
302 for (unsigned int xyz = 0; xyz < 3; ++xyz) {
303 // is a differentiated in this direction? add another term
304 if (a.deriv().d(xyz) > 0) {
305 F a_der_m1(a);
306 a_der_m1.deriv().dec(xyz);
307 bra->set_member(a_der_m1, part, pos_a);
308 children_[nchildren_++] = IntType::Instance(*bra, *ket, aux, oper);
309 bra->set_member(a, part, pos_a);
310 }
311 // is b differentiated in this direction? add another term
312 if (bm1.deriv().d(xyz) > 0) {
313 F bm1_der_m1(bm1);
314 bm1_der_m1.deriv().dec(xyz);
315 ket->set_member(bm1_der_m1, part, pos_b);
316 children_[nchildren_++] = IntType::Instance(*bra, *ket, aux, oper);
317 ket->set_member(bm1, part, pos_b);
318 }
319 }
320 }
321
322 if (is_simple()) {
323 // ( a | b) = ( a+1_i | b-1_i ) + AB_i ( a | b-1_i )
324 expr_ = children_[0] + prefactors.X_Y[part][dir] * children_[1];
325
326 // is a differentiated in this direction? add another term
327 const bool aderiv = a.deriv().d(dir_) > 0;
328 if (aderiv) {
329 F a_der_m1(a);
330 a_der_m1.deriv().dec(dir_);
331 bra->set_member(a_der_m1, part, pos_a);
332 children_[nchildren_++] = IntType::Instance(*bra, *ket, aux, oper);
333 bra->set_member(a, part, pos_a);
334 }
335
336 // is b differentiated in this direction? add another term
337 const bool bderiv = bm1.deriv().d(dir_) > 0;
338 if (bderiv) {
339 F bm1_der_m1(bm1);
340 bm1_der_m1.deriv().dec(dir_);
341 ket->set_member(bm1_der_m1, part, pos_b);
342 children_[nchildren_++] = IntType::Instance(*bra, *ket, aux, oper);
343 ket->set_member(bm1, part, pos_b);
344 }
345
346 if (aderiv) expr_ += Vector(a.deriv())[dir_] * children_[2];
347 if (bderiv) expr_ -= Vector(b.deriv())[dir_] * children_[aderiv ? 3 : 2];
348 }
349
350 } // a in bra, b in ket
351
352 delete bra;
353 delete ket;
354}
355
356template <class IntType, class F, int part, FunctionPosition loc_a,
357 unsigned int pos_a, FunctionPosition loc_b, unsigned int pos_b>
359 const {
360 // This is an ugly hack -- add HRR's to the RRStack preemptively for targets
361 // in which all functions not involved in transfer have zero quanta. The
362 // reason is that for the HRR quartet level code to work correctly I must use
363 // these particular instances of HRR to generate the source.
364
365 using std::swap;
366
367 // only register RRs with for shell sets
368 if (TrivialBFSet<F>::result) return false;
369 typedef typename IntType::BraType IBraType;
370 typedef typename IntType::KetType IKetType;
371 const IBraType& bra = target_->bra();
372 const IKetType& ket = target_->ket();
373
374 // check for nonzero quanta for all particles other than part
375 bool nonzero_quanta = false;
376 unsigned const int npart = IntType::OperatorType::Properties::np;
377 for (unsigned int p = 0; p < npart; p++) {
378 if (p == part) continue;
379 int nfbra = bra.num_members(p);
380 assert(nfbra == 1);
381 for (int f = 0; f < nfbra; f++)
382 if (!bra.member(p, f).zero() || !bra.member(p, f).deriv().zero())
383 nonzero_quanta = true;
384 int nfket = ket.num_members(p);
385 assert(nfket == 1);
386 for (int f = 0; f < nfket; f++)
387 if (!ket.member(p, f).zero() || !ket.member(p, f).deriv().zero())
388 nonzero_quanta = true;
389 }
390 // if all bfsets not involved in transfer have zero quanta then this instance
391 // needs to be added to the stack
392 if (!nonzero_quanta) {
393 std::shared_ptr<RRStack> rrstack = RRStack::Instance();
394 std::shared_ptr<ThisType> this_ptr =
395 std::const_pointer_cast<ThisType, const ThisType>(
396 std::static_pointer_cast<const ThisType, const ParentType>(
397 std::enable_shared_from_this<ParentType>::shared_from_this()));
398 rrstack->find(this_ptr);
399 return true;
400 }
401
402 //
403 // else create the needed instance of HRR
404 //
405
406 // zero out unneeded bfs'
407 IBraType bra_zero(bra);
408 IKetType ket_zero(ket);
409 for (unsigned int p = 0; p < npart; p++) {
410 if (p == part) continue;
411 int nfbra = bra_zero.num_members(p);
412 for (int f = 0; f < nfbra; f++) {
413 typedef typename IBraType::bfs_type bfs_type;
414 typedef typename IBraType::bfs_ref bfs_ref;
415 bfs_ref bfs = bra_zero.member(p, f);
416 if (!bfs.zero() || !bfs.deriv().zero()) {
417 bfs_type null_bfs;
418 swap(bfs, null_bfs);
419 }
420 }
421 int nfket = ket_zero.num_members(p);
422 for (int f = 0; f < nfket; f++) {
423 typedef typename IKetType::bfs_type bfs_type;
424 typedef typename IKetType::bfs_ref bfs_ref;
425 bfs_ref bfs = ket_zero.member(p, f);
426 if (!bfs.zero() || !bfs.deriv().zero()) {
427 bfs_type null_bfs;
428 swap(bfs, null_bfs);
429 }
430 }
431 }
432
433 // create a generic GenIntegralSet over a multiplicative operator
435 DummyOper;
436 typedef EmptySet DummyQuanta;
437 typedef GenIntegralSet<DummyOper, IncableBFSet, IBraType, IKetType,
438 DummyQuanta>
439 DummyIntegral;
440 DummyOper dummy_oper;
441 DummyQuanta dummy_quanta(std::vector<int>(0, 0));
442 std::shared_ptr<DummyIntegral> dummy_integral =
443 DummyIntegral::Instance(bra_zero, ket_zero, dummy_quanta, dummy_oper);
444
445 // Construct generic HRR and add it to the stack instead of this HRR
447 std::shared_ptr<DummyHRR> dummy_hrr =
448 DummyHRR::Instance(dummy_integral, dir_);
449 std::shared_ptr<RRStack> rrstack = RRStack::Instance();
450 rrstack->find(dummy_hrr);
451 return true;
452}
453
454template <class IntType, class F, int part, FunctionPosition loc_a,
455 unsigned int pos_a, FunctionPosition loc_b, unsigned int pos_b>
457 oper_checks();
458}
459
460template <class IntType, class F, int part, FunctionPosition loc_a,
461 unsigned int pos_a, FunctionPosition loc_b, unsigned int pos_b>
463 //
464 // Here we check basic HRR applicability requirements on the integral class
465 //
466
467#if CHECK_SAFETY
468 // part is within the range
469 typedef typename IntType::OperatorType Oper;
470 if (part < 0 || part >= Oper::Properties::np) {
471 assert(false);
472 }
473
474 // Cannot apply when a and b are the same
475 if (loc_a == loc_b && pos_a == pos_b) {
476 assert(false);
477 }
478#endif
479}
480
481template <class IntType, class F, int part, FunctionPosition loc_a,
482 unsigned int pos_a, FunctionPosition loc_b, unsigned int pos_b>
483std::shared_ptr<
484 typename HRR<IntType, F, part, loc_a, pos_a, loc_b, pos_b>::ChildType>
486 assert(i >= 0 && i < nchildren_);
487
488 unsigned int nc = 0;
489 for (unsigned int c = 0; c < max_nchildren_; c++) {
490 if (children_[c]) {
491 if (nc == i) return children_[c];
492 nc++;
493 }
494 }
495 abort(); // unreachable
496}
497
498template <class IntType, class F, int part, FunctionPosition loc_a,
499 unsigned int pos_a, FunctionPosition loc_b, unsigned int pos_b>
501 const {
502 std::ostringstream os;
503
504 os << "HRR Part " << part << " " << (loc_a == InBra ? "bra" : "ket") << " "
505 << pos_a << " " << (loc_b == InBra ? "bra" : "ket") << " " << pos_b
506 << " ";
507
508 if (loc_a == InBra) {
509 F sh_a(target_->bra(part, pos_a));
510 // HRR works for contracted and uncontracted non-differentiated functions
511 // thus only need to create the uncontracted instances
512 sh_a.uncontract();
513 os << sh_a.label() << " ";
514
515 if (loc_b == InBra) {
516 F sh_b(target_->bra(part, pos_b));
517 sh_b.uncontract();
518 os << sh_b.label();
519 } else {
520 F sh_b(target_->ket(part, pos_b));
521 sh_b.uncontract();
522 os << sh_b.label();
523 }
524 } else {
525 F sh_a(target_->ket(part, pos_a));
526 sh_a.uncontract();
527 os << sh_a.label() << " ";
528
529 if (loc_b == InBra) {
530 F sh_b(target_->bra(part, pos_b));
531 sh_b.uncontract();
532 os << sh_b.label();
533 } else {
534 F sh_b(target_->ket(part, pos_b));
535 sh_b.uncontract();
536 os << sh_b.label();
537 }
538 }
539
540 return os.str();
541}
542
543template <class IntType, class F, int part, FunctionPosition loc_a,
544 unsigned int pos_a, FunctionPosition loc_b, unsigned int pos_b>
546 const std::shared_ptr<CodeContext>& context,
547 const std::shared_ptr<ImplicitDimensions>& dims) const {
548 std::ostringstream os;
549 os << context->label_to_name(
550 label_to_funcname(context->cparams()->api_prefix() + label()))
551 // First argument is the library object
552 << "(inteval, "
553 // Second is the target
554 << context->value_to_pointer(rr_target()->symbol());
555 // then come children
556 const unsigned int nchildren = num_children();
557 for (unsigned int c = 0; c < nchildren; c++) {
558 os << ", " << context->value_to_pointer(rr_child(c)->symbol());
559 }
560 // then dimensions of basis function sets not involved in the transfer
561 unsigned int hsr = 1;
562 // a cleaner way to count the number of function sets referring
563 // to some particles is to construct a dummy integral and
564 // use subiterator policy
565 // WARNING !!!
566 for (int p = 0; p < part; p++) {
567 unsigned int nbra = target_->bra().num_members(p);
568 for (unsigned int i = 0; i < nbra; i++) {
569 SubIterator* iter = target_->bra().member_subiter(p, i);
570 hsr *= iter->num_iter();
571 delete iter;
572 }
573 unsigned int nket = target_->ket().num_members(p);
574 for (unsigned int i = 0; i < nket; i++) {
575 SubIterator* iter = target_->ket().member_subiter(p, i);
576 hsr *= iter->num_iter();
577 delete iter;
578 }
579 }
580 // Use TaskParameters to keep track of maximum hsr
582 taskmgr.current().params()->max_hrr_hsrank(hsr);
583
584 // can only do a simple bra->ket or ket->bra transfer so far
585 // unsigned int isr = 1;
586 if (loc_a == loc_b && pos_a != 0 && pos_b != 0)
587 throw CodeDoesNotExist(
588 "HRR::spfunction_call -- has not been generalized yet");
589
591 unsigned int lsr = 1;
592 unsigned int np = IntType::OperType::Properties::np;
593 for (unsigned int p = part + 1; p < np; p++) {
594 unsigned int nbra = target_->bra().num_members(p);
595 for (unsigned int i = 0; i < nbra; i++) {
596 SubIterator* iter = target_->bra().member_subiter(p, i);
597 lsr *= iter->num_iter();
598 delete iter;
599 }
600 unsigned int nket = target_->ket().num_members(p);
601 for (unsigned int i = 0; i < nket; i++) {
602 SubIterator* iter = target_->ket().member_subiter(p, i);
603 lsr *= iter->num_iter();
604 delete iter;
605 }
606 }
607 // Use TaskParameters to keep track of maximum hsr
608 taskmgr.current().params()->max_hrr_hsrank(hsr);
609
610 if (expl_high_dim()) os << "," << hsr;
611 if (expl_low_dim()) os << "," << lsr;
612 os << ")" << context->end_of_stat() << std::endl;
613 return os.str();
614}
615
616template <class IntType, class F, int part, FunctionPosition loc_a,
617 unsigned int pos_a, FunctionPosition loc_b, unsigned int pos_b>
619 bool high = true;
620 if (part == 0) high = false;
621 return high;
622}
623
624template <class IntType, class F, int part, FunctionPosition loc_a,
625 unsigned int pos_a, FunctionPosition loc_b, unsigned int pos_b>
627 unsigned int np = IntType::OperType::Properties::np;
628 bool low = true;
629 if (part == np - 1) low = false;
630 // corner case: # of particles == 1
631 if (np == 1) { // to match the interface of np != 1 need to add insert dummy
632 // argument
633 low = true;
634 }
635 return low;
636}
637
638template <class IntType, class F, int part, FunctionPosition loc_a,
639 unsigned int pos_a, FunctionPosition loc_b, unsigned int pos_b>
640std::shared_ptr<ImplicitDimensions>
642 const std::shared_ptr<ImplicitDimensions>& dims) const {
643 bool high_rank = expl_high_dim();
644 bool low_rank = expl_low_dim();
645
646 std::shared_ptr<Entity> high_dim, low_dim;
647 if (high_rank) {
648 high_dim =
649 std::shared_ptr<Entity>(new RTimeEntity<EntityTypes::Int>("highdim"));
650 } else {
651 high_dim = dims->high();
652 }
653 if (low_rank) {
654 low_dim =
655 std::shared_ptr<Entity>(new RTimeEntity<EntityTypes::Int>("lowdim"));
656 } else {
657 low_dim = dims->low();
658 }
659
660 std::shared_ptr<ImplicitDimensions> localdims(
661 new ImplicitDimensions(high_dim, low_dim, dims->vecdim()));
662 return localdims;
663}
664
665}; // namespace libint2
666
667#endif
AlgebraicOperator is an algebraic operator that acts on objects of type T.
Definition algebra.h:47
Set of basis functions.
Definition bfset.h:43
This exception used to indicate that some code hasn't been developed or generalized yet.
Definition exception.h:79
GenIntegralSet is a set of integrals over functions derived from BFS.
Definition integral.h:99
GenOper is a single operator described by descriptor Descr.
Definition oper.h:164
A generic Horizontal Recurrence Relation:
Definition hrr.h:57
bool is_simple() const override
Implementation of RecurrenceRelation::is_simple()
Definition hrr.h:112
std::shared_ptr< TargetType > target() const
returns pointer to the target
Definition hrr.h:100
unsigned int num_children() const override
Implementation of RecurrenceRelation::num_children()
Definition hrr.h:98
std::shared_ptr< DGVertex > rr_child(unsigned int i) const override
Implementation of RecurrenceRelation::child()
Definition hrr.h:108
std::shared_ptr< DGVertex > rr_target() const override
Implementation of RecurrenceRelation::target()
Definition hrr.h:104
static bool directional()
is this recurrence relation parameterized by a direction.
Definition hrr.h:92
std::shared_ptr< ChildType > child(unsigned int i) const
child(i) returns pointer to i-th child
Definition hrr.h:485
std::string spfunction_call(const std::shared_ptr< CodeContext > &context, const std::shared_ptr< ImplicitDimensions > &dims) const override
Implementation of RecurrenceRelation::spfunction_call()
Definition hrr.h:545
RecurrenceRelation::ExprType ExprType
A short alias.
Definition hrr.h:65
BraketDirection braket_direction() const override
overrides RecurrenceRelation::braket_direction()
Definition hrr.h:80
static std::shared_ptr< ThisType > Instance(const std::shared_ptr< TargetType > &, unsigned int dir=0)
Use Instance() to obtain an instance of RR.
Definition hrr.h:153
ImplicitDimensions describes basis functions or other "degrees of freedom" not actively engaged in a ...
Definition dims.h:43
Set of basis functions with incrementable/decrementable quantum numbers.
Definition bfset.h:62
Manages tasks. This is a Singleton.
Definition task.h:65
void current(const std::string &task_label)
Makes this task current (must have been added already)
Definition task.cc:63
static LibraryTaskManager & Instance()
LibraryTaskManager is a Singleton.
Definition task.cc:32
Oper is OperSet characterized by properties Props.
Definition oper.h:91
std::shared_ptr< rdouble > X_Y[np][3]
Cartesian components of X-Y vectors.
Definition prefactors.h:59
std::shared_ptr< rdouble > Y_X[np][3]
Cartesian components of Y_X vectors.
Definition prefactors.h:67
QuantumNumbersA<T,N> is a set of N quantum numbers of type T implemented in terms of a C-style array.
Definition quanta.h:193
static std::shared_ptr< RRStackBase< RR > > & Instance()
Obtain the unique Instance of RRStack.
Definition rr.h:69
RecurrenceRelation describes all recurrence relations.
Definition rr.h:97
Iterator provides a base class for all object iterator classes.
Definition iter.h:43
virtual unsigned int num_iter() const =0
Returns a number of iterations (number of elements in a set over which to iterate).
Defaults definitions for various parameters assumed by Libint.
Definition algebra.cc:24
bool exists(const IncableBFSet &A)
Return true if A is valid.
Definition bfset.h:96
std::string label_to_funcname(const std::string &label)
Converts a label, e.g.
Definition default_params.cc:201
TrivialBFSet<T> defines static member result, which is true if T is a basis function set consisting o...
Definition bfset.h:906