LIBINT 2.9.0
comp_11_gtg_11_1d.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_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
31template <CartesianAxis Axis>
34 CR_11_GTG_11_1d<Axis>, CGShell1d<Axis>,
35 GenIntegralSet_11_11<CGShell1d<Axis>, GTG_1d, EmptySet> > {
36 public:
44 static const unsigned int max_nchildren = 1;
45
47
49 static bool directional() { return false; }
50
51 private:
53 using ParentType::target_;
54 using ParentType::RecurrenceRelation::expr_;
55 using ParentType::RecurrenceRelation::nflops_;
56
59 CR_11_GTG_11_1d(const std::shared_ptr<TargetType>&, unsigned int dir);
60 static std::string descr() { return "CR"; }
61
62#if LIBINT_ENABLE_GENERIC_CODE
64 bool has_generic(
65 const std::shared_ptr<CompilationParameters>& cparams) const override {
66 return true;
67 }
69 std::string generic_header() const override { return "VRR_GTG_1d_xx_xx.h"; }
71 std::string generic_instance(
72 const std::shared_ptr<CodeContext>& context,
73 const std::shared_ptr<CodeSymbols>& args) const override;
74#endif
75};
76
77template <CartesianAxis Axis>
78CR_11_GTG_11_1d<Axis>::CR_11_GTG_11_1d(const std::shared_ptr<TargetType>& Tint,
79 unsigned int dir)
80 : ParentType(Tint, dir) {
81 if (dir != 0) return;
82 const GTG_1d oper;
83
84 BasisFunctionType _0(0);
85
86 if (target_->oper()->descr().contracted()) return;
87
88 ChildFactory<ThisType, TargetType> factory(this);
89 auto _00_GTG_00 = factory.make_child(_0, _0, _0, _0, 0u, oper);
90}
91
92#if LIBINT_ENABLE_GENERIC_CODE
93template <CartesianAxis Axis>
94std::string CR_11_GTG_11_1d<Axis>::generic_instance(
95 const std::shared_ptr<CodeContext>& context,
96 const std::shared_ptr<CodeSymbols>& args) const {
97 std::ostringstream oss;
98 auto a = target_->bra(0, 0);
99 auto b = target_->ket(0, 0);
100 auto c = target_->bra(1, 0);
101 auto d = target_->kt(1, 0);
102
103 const bool vec = (context->cparams()->max_vector_length() != 1);
104
105 oss << "VRR_GTG_1d_xx_xx::compute<" << to_string<Axis> << "," << a[0] << ","
106 << b[0] << "," << c[0] << "," << d[0] << "," << (vec ? "true" : "false")
107 << ">::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}; // namespace libint2
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:647
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:49
Generic integral over a two-body operator with one bfs for each particle in bra and ket.
Definition integral_11_11.h:36
RRImpl must inherit GenericRecurrenceRelation<RRImpl>
Definition generic_rr.h:47
bool is_simple() const override
Implementation of RecurrenceRelation::is_simple()
Definition generic_rr.h:81
static std::shared_ptr< RRImpl > Instance(const std::shared_ptr< 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:32
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:121