LIBINT  2.6.0
comp_11_gtg_11_1d.h
1 /*
2  * Copyright (C) 2004-2019 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 
27 using namespace std;
28 
29 namespace libint2 {
30 
33  template <CartesianAxis Axis>
34  class CR_11_GTG_11_1d : public GenericRecurrenceRelation< CR_11_GTG_11_1d<Axis>,
35  CGShell1d<Axis>,
36  GenIntegralSet_11_11<CGShell1d<Axis>,GTG_1d,EmptySet> >
37  {
38  public:
39  typedef CR_11_GTG_11_1d ThisType;
44  static const unsigned int max_nchildren = 1;
45 
46  using ParentType::Instance;
47 
49  static bool directional() { return false; }
50 
51  private:
52  using ParentType::RecurrenceRelation::expr_;
53  using ParentType::RecurrenceRelation::nflops_;
54  using ParentType::target_;
55  using ParentType::is_simple;
56 
58  CR_11_GTG_11_1d(const SafePtr<TargetType>&, unsigned int dir);
59  static std::string descr() { return "CR"; }
60 
61 #if LIBINT_ENABLE_GENERIC_CODE
62  bool has_generic(const SafePtr<CompilationParameters>& cparams) const { return true; }
65  std::string generic_header() const { return "VRR_GTG_1d_xx_xx.h"; }
67  std::string generic_instance(const SafePtr<CodeContext>& context, const SafePtr<CodeSymbols>& args) const;
68 #endif
69  };
70 
71  template <CartesianAxis Axis>
72  CR_11_GTG_11_1d<Axis>::CR_11_GTG_11_1d(const SafePtr<TargetType>& Tint,
73  unsigned int dir) :
74  ParentType(Tint,dir)
75  {
76  if (dir != 0)
77  return;
78  const GTG_1d oper;
79 
80  BasisFunctionType _0(0);
81 
82  if (target_->oper()->descr().contracted())
83  return;
84 
85  ChildFactory<ThisType,TargetType> factory(this);
86  auto _00_GTG_00 = factory.make_child(_0,_0,_0,_0,0u,oper);
87 
88  }
89 
90 #if LIBINT_ENABLE_GENERIC_CODE
91  template <CartesianAxis Axis>
92  std::string
93  CR_11_GTG_11_1d<Axis>::generic_instance(const SafePtr<CodeContext>& context, const SafePtr<CodeSymbols>& args) const {
94 
95  std::ostringstream oss;
96  auto a = target_->bra(0,0);
97  auto b = target_->ket(0,0);
98  auto c = target_->bra(1,0);
99  auto d = target_->kt(1,0);
100 
101  const bool vec = (context->cparams()->max_vector_length() != 1);
102 
103  oss << "VRR_GTG_1d_xx_xx::compute<"
104  << to_string<Axis> << ","
105  << a[0] << ","
106  << b[0] << ","
107  << c[0] << ","
108  << d[0] << ","
109  << (vec ? "true" : "false") << ">::compute(";
110 
111  const unsigned int nargs = args->n();
112  for(unsigned int a=0; a<nargs; a++) {
113  oss << args->symbol(a) << ",";
114  }
115 
116  oss << ",inteval->_00_GTG1d_00_" << to_string(Axis) << ");";
117 
118  // force some quantities on the list of task symbols
119  {
120  LibraryTaskManager& taskmgr = LibraryTaskManager::Instance();
121  std::list<std::string> forced_symbol;
122  forced_symbol.push_back(std::string("AB_") + to_string(Axis));
123  forced_symbol.push_back(std::string("CD_") + to_string(Axis));
124  forced_symbol.push_back(std::string("R12kG12_pfac0_0_") + to_string(Axis));
125  forced_symbol.push_back(std::string("R12kG12_pfac0_1_") + to_string(Axis));
126  forced_symbol.push_back(std::string("R12kG12_pfac1_0"));
127  forced_symbol.push_back(std::string("R12kG12_pfac1_1"));
128  forced_symbol.push_back(std::string("R12kG12_pfac2"));
129  taskmgr.current().symbols()->add(forced_symbol);
130  }
131 
132  return oss.str();
133  }
134 #endif
135 
136 };
137 
138 #endif
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:24
a "shell" of 1D CGFs with quantum number L is a set of 1D CGFs with quantum numbers 0 .
Definition: bfset.h:627
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:49
std::string to_string(const T &x)
Converts x to its string representation.
Definition: entity.h:74
Compute relation for 1-dimensional Gaussian-type geminal integrals.
Definition: comp_11_gtg_11_1d.h:34
static LibraryTaskManager & Instance()
LibraryTaskManager is a Singleton.
Definition: task.cc:34
static bool directional()
This relation is not directional.
Definition: comp_11_gtg_11_1d.h:49