LIBINT  2.1.0-stable
comp_xyz.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_compxyz_h_
21 #define _libint2_src_bin_libint_compxyz_h_
22 
23 #include <generic_rr.h>
24 
25 using namespace std;
26 
27 namespace libint2 {
28 
33  template <typename F, typename Oper, typename AuxQuanta = EmptySet>
34  class CR_XYZ_1_1 : public GenericRecurrenceRelation< CR_XYZ_1_1<F,Oper,AuxQuanta>,
35  F,
36  GenIntegralSet_1_1<F,Oper,AuxQuanta> >
37  {
38  public:
40  typedef F BasisFunctionType;
41  typedef Oper OperType;
44  friend class GenericRecurrenceRelation<ThisType,BasisFunctionType,TargetType>;
45  static const unsigned int max_nchildren = 100;
46 
47  using ParentType::Instance;
48 
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_XYZ_1_1(const SafePtr<TargetType>&, unsigned int dir = 0);
59 
60  static std::string descr() { return "CR"; }
61 
63  void compute(const BasisFunctionType& bra, const BasisFunctionType& ket, const Oper& oper);
64  };
65 
66  template <typename F, typename Oper, typename AuxQuanta>
67  CR_XYZ_1_1<F,Oper,AuxQuanta>::CR_XYZ_1_1(const SafePtr< TargetType >& Tint,
68  unsigned int dir) :
69  ParentType(Tint,dir)
70  {
71  // WARNING assuming one function per position
72  const auto& a = Tint->bra(0,0);
73  const auto& b = Tint->ket(0,0);
74  const auto& aux = Tint->aux();
75  const auto& oper = Tint->oper();
76 
77  {
78  // can't apply to contracted basis functions
79  if (a.contracted() || b.contracted())
80  return;
81  // can't apply to differentiated CGF (derivatives will be expanded first)
83  (a.deriv().norm() != 0 ||
84  b.deriv().norm() != 0))
85  return;
86  }
87 
88  compute(a,b,oper);
89  } // CR_XYZ_1_1<F,Oper,AuxQuanta>::CR_XYZ_1_1
90 
91 }; // namespace libint2
92 
93 #endif
this computes integral over Oper over CGShell/CGF as a product of 1-d integrals
Definition: comp_xyz.h:34
TrivialBFSet<T> defines static member result, which is true if T is a basis function set consisting o...
Definition: bfset.h:879
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:23
Definition: stdarray.h:18
RRImpl must inherit GenericRecurrenceRelation<RRImpl>
Definition: generic_rr.h:48
Oper is OperSet characterized by properties Props.
Definition: oper.h:82
Generic integral over a one-body operator with one bfs for each particle in bra and ket...
Definition: integral_1_1.h:32