LIBINT  2.1.0-stable
comp_11_DivG12prime_xTx_11.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_cr11divg12primextx11_h_
21 #define _libint2_src_bin_libint_cr11divg12primextx11_h_
22 
23 #include <generic_rr.h>
24 #include <integral_11_11.h>
25 #include <gaussoper.h>
26 
27 #define USE_R12kR12lG12 1
28 
29 using namespace std;
30 
31 namespace libint2 {
32 
35  template <class BFSet>
36  class CR_11_DivG12prime_xTx_11 : public GenericRecurrenceRelation< CR_11_DivG12prime_xTx_11<BFSet>,
37  BFSet,
38  GenIntegralSet_11_11<BFSet,DivG12prime_xTx,mType> >
39  {
40  public:
42  typedef BFSet BasisFunctionType;
45  friend class GenericRecurrenceRelation<ThisType,BFSet,TargetType>;
46  static const unsigned int max_nchildren = 36;
47 
48  using ParentType::Instance;
49 
51  static bool directional() { return false; }
52 
53  private:
54  using ParentType::RecurrenceRelation::expr_;
55  using ParentType::RecurrenceRelation::nflops_;
56  using ParentType::target_;
57  using ParentType::is_simple;
58 
60  CR_11_DivG12prime_xTx_11(const SafePtr<TargetType>&, unsigned int dir);
61  static std::string descr() { return "CR"; }
62 
63  template<class RR, class C> friend class ChildFactory;
64  };
65 
66  template <class F>
67  CR_11_DivG12prime_xTx_11<F>::CR_11_DivG12prime_xTx_11(const SafePtr<TargetType>& Tint,
68  unsigned int dir) :
69  ParentType(Tint,dir)
70  {
71  using namespace libint2::algebra;
72  using namespace libint2::prefactor;
73  using namespace libint2::braket;
74 
75  // kinetic energy of which electron?
76  const int i = target_->oper()->descr().I();
77  F a(Tint->bra(0,0));
78  F b(Tint->ket(0,0));
79  F c(Tint->bra(1,0));
80  F d(Tint->ket(1,0));
81 
82  if (a.contracted() ||
83  b.contracted() ||
84  c.contracted() ||
85  d.contracted() ||
86  target_->oper()->descr().contracted())
87  return;
88 
89 #if USE_R12kR12lG12
90  if (i == 0)
91  {
94  for(int bxyz=0; bxyz<3; ++bxyz) {
95  for(int kxyz=0; kxyz<3; ++kxyz) {
96  R12k_R12l_G12_Descr descr(unit_intvec3(bxyz),unit_intvec3(kxyz));
97  factory.wedge( Nabla1(_pbra(a,c),bxyz) , Nabla1(_pket(b,d),kxyz), EmptySet(), R12kR12lG12(descr));
98  }
99  }
100  }
101  if (i == 1)
102  {
104  ChildFactory<ThisType,ChildType> factory(this);
105  for(int bxyz=0; bxyz<3; ++bxyz) {
106  for(int kxyz=0; kxyz<3; ++kxyz) {
107  R12k_R12l_G12_Descr descr(unit_intvec3(bxyz),unit_intvec3(kxyz));
108  factory.wedge( Nabla2(_pbra(a,c),bxyz) , Nabla2(_pket(b,d),kxyz), EmptySet(), R12kR12lG12(descr));
109  }
110  }
111  }
112 #else
113  // |Nabla1.G12' ac ) ^ |Nabla1.G12' bd )
114  if (i == 0)
115  {
117  ChildFactory<ThisType,ChildType> factory(this);
118  factory.wedge( R12vec_dot_Nabla1(_pbra(a,c)) , R12vec_dot_Nabla1(_pket(b,d)), mType(0u), R12kG12(0));
119  }
120  // |Nabla2.G12' ac ) ^ |Nabla2.G12' bd )
121  if (i == 1)
122  {
124  ChildFactory<ThisType,ChildType> factory(this);
125  factory.wedge( R12vec_dot_Nabla2(_pbra(a,c)) , R12vec_dot_Nabla2(_pket(b,d)), mType(0u), R12kG12(0));
126  }
127 #endif
128  if (is_simple()) expr_ *= Scalar(-4.0) * Scalar("gamma_bra") * Scalar("gamma_ket");
129 
130  }
131 
132 };
133 
134 
135 #endif
LinearCombination< SafePtr< DGVertex >, BraketPair< F, BKType > > R12vec_dot_Nabla1(const BraketPair< F, BKType > &bkt)
Applies R12vec_dot_Nabla1 to a physicists&#39; braket.
Definition: gaussoper.h:35
static bool directional()
This relation is not directional.
Definition: comp_11_DivG12prime_xTx_11.h:51
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:23
BraketPair< F, PKet > _pket(const F &f1, const F &f2)
Physicists ket.
Definition: braket.h:448
Definition: stdarray.h:18
Definition: prefactors.h:159
LinearCombination< SafePtr< DGVertex >, BraketPair< F, BKType > > Nabla1(const BraketPair< F, BKType > &bkt, int xyz)
Applies Nabla1 to a physicists&#39; braket.
Definition: gaussoper.h:131
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 wedge(const LinearCombination< SafePtr< DGVertex >, BraketPair< F, PBra > > &bra_lc, const LinearCombination< SafePtr< DGVertex >, BraketPair< F, PKet > > &ket_lc, const AuxIndexType &aux=AuxIndexType(), const OperType &oper=OperType())
take a wedge product of various (linear combinations of) brakets
Definition: generic_rr.h:191
RRImpl must inherit GenericRecurrenceRelation<RRImpl>
Definition: generic_rr.h:48
QuantumNumbersA<T,N> is a set of N quantum numbers of type T implemented in terms of a C-style array...
Definition: quanta.h:198
Definition: algebra.h:32
LinearCombination< SafePtr< DGVertex >, BraketPair< F, BKType > > R12vec_dot_Nabla2(const BraketPair< F, BKType > &bkt)
Applies R12vec_dot_Nabla2 to a physicists&#39; braket.
Definition: gaussoper.h:83
these objects help to construct BraketPairs
Definition: braket.h:442
R12k_R12l_G12 is a two-body operator of form ( r_{12x}^kx * r_{12y}^ky * r_{12z}^kz ) * (r_{12x}^lx *...
Definition: oper.h:322
Set of basis functions.
Definition: bfset.h:41
LinearCombination< SafePtr< DGVertex >, BraketPair< F, BKType > > Nabla2(const BraketPair< F, BKType > &bkt, int xyz)
Applies Nabla2 to a physicists&#39; braket.
Definition: gaussoper.h:164
BraketPair< F, PBra > _pbra(const F &f1, const F &f2)
Physicists bra.
Definition: braket.h:444
Compute relation for 2-e integrals of the DivG12prime_xTx operators.
Definition: comp_11_DivG12prime_xTx_11.h:36
Helps GenericRecurrenceRelation to work around the compiler problem with make_child.
Definition: generic_rr.h:148