LIBINT 2.7.2
comp_11_gtg_11_1d.h
1/*
2 * Copyright (C) 2004-2021 Edward F. Valeev
3 *
4 * This file is part of Libint.
5 *
6 * Libint 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 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. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21#ifndef _libint2_src_bin_libint_cr11gtg111d_h_
22#define _libint2_src_bin_libint_cr11gtg111d_h_
23
24#include <generic_rr.h>
25#include <util_types.h>
26
27namespace libint2 {
28
31 template <CartesianAxis Axis>
32 class CR_11_GTG_11_1d : public GenericRecurrenceRelation< CR_11_GTG_11_1d<Axis>,
33 CGShell1d<Axis>,
34 GenIntegralSet_11_11<CGShell1d<Axis>,GTG_1d,EmptySet> >
35 {
36 public:
42 static const unsigned int max_nchildren = 1;
43
45
47 static bool directional() { return false; }
48
49 private:
50 using ParentType::RecurrenceRelation::expr_;
51 using ParentType::RecurrenceRelation::nflops_;
52 using ParentType::target_;
54
56 CR_11_GTG_11_1d(const SafePtr<TargetType>&, unsigned int dir);
57 static std::string descr() { return "CR"; }
58
59#if LIBINT_ENABLE_GENERIC_CODE
61 bool has_generic(const SafePtr<CompilationParameters>& cparams) const override { return true; }
63 std::string generic_header() const override { return "VRR_GTG_1d_xx_xx.h"; }
65 std::string generic_instance(const SafePtr<CodeContext>& context, const SafePtr<CodeSymbols>& args) const override;
66#endif
67 };
68
69 template <CartesianAxis Axis>
70 CR_11_GTG_11_1d<Axis>::CR_11_GTG_11_1d(const SafePtr<TargetType>& Tint,
71 unsigned int dir) :
72 ParentType(Tint,dir)
73 {
74 if (dir != 0)
75 return;
76 const GTG_1d oper;
77
78 BasisFunctionType _0(0);
79
80 if (target_->oper()->descr().contracted())
81 return;
82
83 ChildFactory<ThisType,TargetType> factory(this);
84 auto _00_GTG_00 = factory.make_child(_0,_0,_0,_0,0u,oper);
85
86 }
87
88#if LIBINT_ENABLE_GENERIC_CODE
89 template <CartesianAxis Axis>
90 std::string
91 CR_11_GTG_11_1d<Axis>::generic_instance(const SafePtr<CodeContext>& context, const SafePtr<CodeSymbols>& args) const {
92
93 std::ostringstream oss;
94 auto a = target_->bra(0,0);
95 auto b = target_->ket(0,0);
96 auto c = target_->bra(1,0);
97 auto d = target_->kt(1,0);
98
99 const bool vec = (context->cparams()->max_vector_length() != 1);
100
101 oss << "VRR_GTG_1d_xx_xx::compute<"
102 << to_string<Axis> << ","
103 << a[0] << ","
104 << b[0] << ","
105 << c[0] << ","
106 << d[0] << ","
107 << (vec ? "true" : "false") << ">::compute(";
108
109 const unsigned int nargs = args->n();
110 for(unsigned int a=0; a<nargs; a++) {
111 oss << args->symbol(a) << ",";
112 }
113
114 oss << ",inteval->_00_GTG1d_00_" << to_string(Axis) << ");";
115
116 // force some quantities on the list of task symbols
117 {
118 LibraryTaskManager& taskmgr = LibraryTaskManager::Instance();
119 std::list<std::string> forced_symbol;
120 forced_symbol.push_back(std::string("AB_") + to_string(Axis));
121 forced_symbol.push_back(std::string("CD_") + to_string(Axis));
122 forced_symbol.push_back(std::string("R12kG12_pfac0_0_") + to_string(Axis));
123 forced_symbol.push_back(std::string("R12kG12_pfac0_1_") + to_string(Axis));
124 forced_symbol.push_back(std::string("R12kG12_pfac1_0"));
125 forced_symbol.push_back(std::string("R12kG12_pfac1_1"));
126 forced_symbol.push_back(std::string("R12kG12_pfac2"));
127 taskmgr.current().symbols()->add(forced_symbol);
128 }
129
130 return oss.str();
131 }
132#endif
133
134};
135
136#endif
a "shell" of 1D CGFs with quantum number L is a set of 1D CGFs with quantum numbers 0 .
Definition: bfset.h:628
Compute relation for 1-dimensional Gaussian-type geminal integrals.
Definition: comp_11_gtg_11_1d.h:35
static bool directional()
This relation is not directional.
Definition: comp_11_gtg_11_1d.h:47
Generic integral over a two-body operator with one bfs for each particle in bra and ket.
Definition: integral_11_11.h:33
RRImpl must inherit GenericRecurrenceRelation<RRImpl>
Definition: generic_rr.h:47
bool is_simple() const override
Implementation of RecurrenceRelation::is_simple()
Definition: generic_rr.h:79
static SafePtr< RRImpl > Instance(const SafePtr< TargetType > &Tint, unsigned int dir)
Return an instance if applicable, or a null pointer otherwise.
Definition: generic_rr.h:55
static LibraryTaskManager & Instance()
LibraryTaskManager is a Singleton.
Definition: task.cc:34
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:24
std::string to_string(const T &x)
Converts x to its string representation.
Definition: entity.h:74