LIBINT  2.6.0
comp_11_DivG12prime_xTx_11.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_cr11divg12primextx11_h_
22 #define _libint2_src_bin_libint_cr11divg12primextx11_h_
23 
24 #include <generic_rr.h>
25 #include <integral_11_11.h>
26 #include <gaussoper.h>
27 
28 #define USE_R12kR12lG12 1
29 
30 using namespace std;
31 
32 namespace libint2 {
33 
36  template <class BFSet>
37  class CR_11_DivG12prime_xTx_11 : public GenericRecurrenceRelation< CR_11_DivG12prime_xTx_11<BFSet>,
38  BFSet,
39  GenIntegralSet_11_11<BFSet,DivG12prime_xTx,mType> >
40  {
41  public:
43  typedef BFSet BasisFunctionType;
47  static const unsigned int max_nchildren = 36;
48 
49  using ParentType::Instance;
50 
52  static bool directional() { return false; }
53 
54  private:
55  using ParentType::RecurrenceRelation::expr_;
56  using ParentType::RecurrenceRelation::nflops_;
57  using ParentType::target_;
58  using ParentType::is_simple;
59 
61  CR_11_DivG12prime_xTx_11(const SafePtr<TargetType>&, unsigned int dir);
62  static std::string descr() { return "CR"; }
63 
64  template<class RR, class C> friend class ChildFactory;
65  };
66 
67  template <class F>
68  CR_11_DivG12prime_xTx_11<F>::CR_11_DivG12prime_xTx_11(const SafePtr<TargetType>& Tint,
69  unsigned int dir) :
70  ParentType(Tint,dir)
71  {
72  using namespace libint2::algebra;
73  using namespace libint2::prefactor;
74  using namespace libint2::braket;
75 
76  // kinetic energy of which electron?
77  const int i = target_->oper()->descr().I();
78  F a(Tint->bra(0,0));
79  F b(Tint->ket(0,0));
80  F c(Tint->bra(1,0));
81  F d(Tint->ket(1,0));
82 
83  if (a.contracted() ||
84  b.contracted() ||
85  c.contracted() ||
86  d.contracted() ||
87  target_->oper()->descr().contracted())
88  return;
89 
90 #if USE_R12kR12lG12
91  if (i == 0)
92  {
93  typedef GenIntegralSet_11_11<BasisFunctionType,R12kR12lG12,EmptySet> ChildType;
94  ChildFactory<ThisType,ChildType> factory(this);
95  for(int bxyz=0; bxyz<3; ++bxyz) {
96  for(int kxyz=0; kxyz<3; ++kxyz) {
97  R12k_R12l_G12_Descr descr(unit_intvec3(bxyz),unit_intvec3(kxyz));
98  factory.wedge( Nabla1(_pbra(a,c),bxyz) , Nabla1(_pket(b,d),kxyz), EmptySet(), R12kR12lG12(descr));
99  }
100  }
101  }
102  if (i == 1)
103  {
104  typedef GenIntegralSet_11_11<BasisFunctionType,R12kR12lG12,EmptySet> ChildType;
105  ChildFactory<ThisType,ChildType> factory(this);
106  for(int bxyz=0; bxyz<3; ++bxyz) {
107  for(int kxyz=0; kxyz<3; ++kxyz) {
108  R12k_R12l_G12_Descr descr(unit_intvec3(bxyz),unit_intvec3(kxyz));
109  factory.wedge( Nabla2(_pbra(a,c),bxyz) , Nabla2(_pket(b,d),kxyz), EmptySet(), R12kR12lG12(descr));
110  }
111  }
112  }
113 #else
114  // |Nabla1.G12' ac ) ^ |Nabla1.G12' bd )
115  if (i == 0)
116  {
117  typedef GenIntegralSet_11_11<BasisFunctionType,R12kG12,mType> ChildType;
118  ChildFactory<ThisType,ChildType> factory(this);
119  factory.wedge( R12vec_dot_Nabla1(_pbra(a,c)) , R12vec_dot_Nabla1(_pket(b,d)), mType(0u), R12kG12(0));
120  }
121  // |Nabla2.G12' ac ) ^ |Nabla2.G12' bd )
122  if (i == 1)
123  {
124  typedef GenIntegralSet_11_11<BasisFunctionType,R12kG12,mType> ChildType;
125  ChildFactory<ThisType,ChildType> factory(this);
126  factory.wedge( R12vec_dot_Nabla2(_pbra(a,c)) , R12vec_dot_Nabla2(_pket(b,d)), mType(0u), R12kG12(0));
127  }
128 #endif
129  if (is_simple()) expr_ *= Scalar(-4.0) * Scalar("gamma_bra") * Scalar("gamma_ket");
130 
131  }
132 
133 };
134 
135 
136 #endif
LinearCombination< SafePtr< DGVertex >, BraketPair< F, BKType > > R12vec_dot_Nabla1(const BraketPair< F, BKType > &bkt)
Applies R12vec_dot_Nabla1 to a physicists' braket.
Definition: gaussoper.h:36
static bool directional()
This relation is not directional.
Definition: comp_11_DivG12prime_xTx_11.h:52
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:24
BraketPair< F, PKet > _pket(const F &f1, const F &f2)
Physicists ket.
Definition: braket.h:276
bool is_simple() const
Implementation of RecurrenceRelation::is_simple()
Definition: generic_rr.h:81
LinearCombination< SafePtr< DGVertex >, BraketPair< F, BKType > > Nabla1(const BraketPair< F, BKType > &bkt, int xyz)
Applies Nabla1 to a physicists' braket.
Definition: gaussoper.h:132
Generic integral over a two-body operator with one bfs for each particle in bra and ket.
Definition: integral_11_11.h:33
DefaultQuantumNumbers< unsigned int, 1 >::Result mType
mType is the type that describes the auxiliary index of standard 2-body repulsion integrals
Definition: quanta.h:411
RRImpl must inherit GenericRecurrenceRelation<RRImpl>
Definition: generic_rr.h:49
LinearCombination< SafePtr< DGVertex >, BraketPair< F, BKType > > R12vec_dot_Nabla2(const BraketPair< F, BKType > &bkt)
Applies R12vec_dot_Nabla2 to a physicists' braket.
Definition: gaussoper.h:84
these objects help to construct BraketPairs
Definition: braket.h:270
Set of basis functions.
Definition: bfset.h:42
LinearCombination< SafePtr< DGVertex >, BraketPair< F, BKType > > Nabla2(const BraketPair< F, BKType > &bkt, int xyz)
Applies Nabla2 to a physicists' braket.
Definition: gaussoper.h:165
BraketPair< F, PBra > _pbra(const F &f1, const F &f2)
Physicists bra.
Definition: braket.h:272
Compute relation for 2-e integrals of the DivG12prime_xTx operators.
Definition: comp_11_DivG12prime_xTx_11.h:37
DefaultQuantumNumbers< int, 0 >::Result EmptySet
EmptySet is the type that describes null set of auxiliary indices.
Definition: quanta.h:407