LIBINT  2.1.0-stable
comp_11_gtg_11_1d.h
1 /*
2  * This file is a part of Libint.
3  * Copyright (C) 2004-2014 Edward F. Valeev
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see http://www.gnu.org/licenses/.
17  *
18  */
19 
20 #ifndef _libint2_src_bin_libint_cr11gtg111d_h_
21 #define _libint2_src_bin_libint_cr11gtg111d_h_
22 
23 #include <generic_rr.h>
24 #include <util_types.h>
25 
26 using namespace std;
27 
28 namespace libint2 {
29 
32  template <CartesianAxis Axis>
33  class CR_11_GTG_11_1d : public GenericRecurrenceRelation< CR_11_GTG_11_1d<Axis>,
34  CGShell1d<Axis>,
35  GenIntegralSet_11_11<CGShell1d<Axis>,GTG_1d,EmptySet> >
36  {
37  public:
38  typedef CR_11_GTG_11_1d ThisType;
42  friend class GenericRecurrenceRelation<ThisType,BasisFunctionType,TargetType>;
43  static const unsigned int max_nchildren = 1;
44 
45  using ParentType::Instance;
46 
48  static bool directional() { return false; }
49 
50  private:
51  using ParentType::RecurrenceRelation::expr_;
52  using ParentType::RecurrenceRelation::nflops_;
53  using ParentType::target_;
54  using ParentType::is_simple;
55 
57  CR_11_GTG_11_1d(const SafePtr<TargetType>&, unsigned int dir);
58  static std::string descr() { return "CR"; }
59 
60 #if LIBINT_ENABLE_GENERIC_CODE
61  bool has_generic(const SafePtr<CompilationParameters>& cparams) const { return true; }
64  std::string generic_header() const { return "VRR_GTG_1d_xx_xx.h"; }
66  std::string generic_instance(const SafePtr<CodeContext>& context, const SafePtr<CodeSymbols>& args) const;
67 #endif
68  };
69 
70  template <CartesianAxis Axis>
71  CR_11_GTG_11_1d<Axis>::CR_11_GTG_11_1d(const SafePtr<TargetType>& Tint,
72  unsigned int dir) :
73  ParentType(Tint,dir)
74  {
75  if (dir != 0)
76  return;
77  const GTG_1d oper;
78 
79  BasisFunctionType _0(0);
80 
81  if (target_->oper()->descr().contracted())
82  return;
83 
85  auto _00_GTG_00 = factory.make_child(_0,_0,_0,_0,0u,oper);
86 
87  }
88 
89 #if LIBINT_ENABLE_GENERIC_CODE
90  template <CartesianAxis Axis>
91  std::string
92  CR_11_GTG_11_1d<Axis>::generic_instance(const SafePtr<CodeContext>& context, const SafePtr<CodeSymbols>& args) const {
93 
94  std::ostringstream oss;
95  auto a = target_->bra(0,0);
96  auto b = target_->ket(0,0);
97  auto c = target_->bra(1,0);
98  auto d = target_->kt(1,0);
99 
100  const bool vec = (context->cparams()->max_vector_length() != 1);
101 
102  oss << "VRR_GTG_1d_xx_xx::compute<"
103  << to_string<Axis> << ","
104  << a[0] << ","
105  << b[0] << ","
106  << c[0] << ","
107  << d[0] << ","
108  << (vec ? "true" : "false") << ">::compute(";
109 
110  const unsigned int nargs = args->n();
111  for(unsigned int a=0; a<nargs; a++) {
112  oss << args->symbol(a) << ",";
113  }
114 
115  oss << ",inteval->_00_GTG1d_00_" << to_string(Axis) << ");";
116 
117  // force some quantities on the list of task symbols
118  {
119  LibraryTaskManager& taskmgr = LibraryTaskManager::Instance();
120  std::list<std::string> forced_symbol;
121  forced_symbol.push_back(std::string("AB_") + to_string(Axis));
122  forced_symbol.push_back(std::string("CD_") + to_string(Axis));
123  forced_symbol.push_back(std::string("R12kG12_pfac0_0_") + to_string(Axis));
124  forced_symbol.push_back(std::string("R12kG12_pfac0_1_") + to_string(Axis));
125  forced_symbol.push_back(std::string("R12kG12_pfac1_0"));
126  forced_symbol.push_back(std::string("R12kG12_pfac1_1"));
127  forced_symbol.push_back(std::string("R12kG12_pfac2"));
128  taskmgr.current().symbols()->add(forced_symbol);
129  }
130 
131  return oss.str();
132  }
133 #endif
134 
135 };
136 
137 #endif
const SafePtr< DGVertex > & make_child(const F &A, const F &B, const F &C, const F &D, const AuxIndexType &aux=AuxIndexType(), const OperType &oper=OperType())
make_child
Definition: generic_rr.h:157
Manages tasks. This is a Singleton.
Definition: task.h:62
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:23
a "shell" of 1D CGFs with quantum number L is a set of 1D CGFs with quantum numbers 0 ...
Definition: bfset.h:614
Definition: stdarray.h:18
GenOper is a single operator described by descriptor Descr.
Definition: oper.h:152
Generic integral over a two-body operator with one bfs for each particle in bra and ket...
Definition: integral_11_11.h:32
void current(const std::string &task_label)
Makes this task current (must have been added already)
Definition: task.cc:64
RRImpl must inherit GenericRecurrenceRelation<RRImpl>
Definition: generic_rr.h:48
std::string to_string(const T &x)
Converts x to its string representation.
Definition: entity.h:71
Compute relation for 1-dimensional Gaussian-type geminal integrals.
Definition: comp_11_gtg_11_1d.h:33
static bool directional()
This relation is not directional.
Definition: comp_11_gtg_11_1d.h:48
Helps GenericRecurrenceRelation to work around the compiler problem with make_child.
Definition: generic_rr.h:148