LIBINT 2.9.0
comp_11_r12kr12lg12_11.h
1/*
2 * Copyright (C) 2004-2024 Edward F. Valeev
3 *
4 * This file is part of Libint compiler.
5 *
6 * Libint compiler 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 compiler 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 compiler. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21#ifndef _libint2_src_bin_libint_cr11r12kr12lg1211_h_
22#define _libint2_src_bin_libint_cr11r12kr12lg1211_h_
23
24#include <gaussoper.h>
25#include <generic_rr.h>
26#include <integral_11_11.h>
27
28namespace libint2 {
29
34template <class BFSet>
37 CR_11_R12kR12lG12_11<BFSet>, BFSet,
38 GenIntegralSet_11_11<BFSet, R12kR12lG12, EmptySet> > {
39 public:
45 static const unsigned int max_nchildren = 3;
46
48
50 static bool directional() { return false; }
51
52 private:
54 using ParentType::target_;
55 using ParentType::RecurrenceRelation::expr_;
56 using ParentType::RecurrenceRelation::nflops_;
57 template <class RR, class C>
58 friend class ChildFactory;
59
62 CR_11_R12kR12lG12_11(const std::shared_ptr<TargetType>&, unsigned int dir);
63 static std::string descr() { return "CR"; }
64};
65
66template <class F>
67CR_11_R12kR12lG12_11<F>::CR_11_R12kR12lG12_11(
68 const std::shared_ptr<TargetType>& Tint, unsigned int dir)
69 : ParentType(Tint, dir) {
70 using namespace libint2::algebra;
71 using namespace libint2::prefactor;
72 using namespace libint2::braket;
73
74 // std::cout << "CR_11_R12kR12lG12_11<F> -- applying to "
75 // << Tint->label() << std::endl;
76
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 const IntVec3& r12pbra = Tint->oper()->descr().K();
83 const IntVec3& r12pket = Tint->oper()->descr().L();
84 const int norm = r12pbra.norm1() + r12pket.norm1();
85
86 // Try reducing r12pbra
87 for (int xyz = 0; xyz < 3; ++xyz) {
88 const IntVec3& _1 = unit_intvec3(xyz);
89 const IntVec3 r12pbra_m1 = r12pbra - _1;
90
91 if (!ltzero(r12pbra_m1)) {
92 if (norm == 1) {
94 ChildType;
96 factory.wedge(R12v(_pbra(a, c), xyz), _pket(b, d), mType(0u),
98 } else {
100 ChildType;
102 R12k_R12l_G12_Descr odescr(r12pbra_m1, r12pket);
103 factory.wedge(R12v(_pbra(a, c), xyz), _pket(b, d), EmptySet(),
104 R12kR12lG12(odescr));
105 }
106 return;
107 }
108 }
109
110 // Try reducing r12pket
111 for (int xyz = 0; xyz < 3; ++xyz) {
112 const IntVec3& _1 = unit_intvec3(xyz);
113 const IntVec3 r12pket_m1 = r12pket - _1;
114
115 if (!ltzero(r12pket_m1)) {
116 if (norm == 1) {
118 ChildType;
120 factory.wedge(_pbra(a, c), R12v(_pket(b, d), xyz), mType(0u),
122 } else {
124 ChildType;
126 R12k_R12l_G12_Descr odescr(r12pbra, r12pket_m1);
127 factory.wedge(_pbra(a, c), R12v(_pket(b, d), xyz), EmptySet(),
128 R12kR12lG12(odescr));
129 }
130 return;
131 }
132 }
133}
134
135}; // namespace libint2
136
137#endif
Set of basis functions.
Definition bfset.h:43
Compute relation for integrals of operator R12k_R12l_G12.
Definition comp_11_r12kr12lg12_11.h:38
static bool directional()
This relation is not directional.
Definition comp_11_r12kr12lg12_11.h:50
Helps GenericRecurrenceRelation to work around the compiler problem with make_child.
Definition generic_rr.h:150
Generic integral over a two-body operator with one bfs for each particle in bra and ket.
Definition integral_11_11.h:36
GenOper is a single operator described by descriptor Descr.
Definition oper.h:164
RRImpl must inherit GenericRecurrenceRelation<RRImpl>
Definition generic_rr.h:47
bool is_simple() const override
Implementation of RecurrenceRelation::is_simple()
Definition generic_rr.h:81
static std::shared_ptr< RRImpl > Instance(const std::shared_ptr< TargetType > &Tint, unsigned int dir)
Return an instance if applicable, or a null pointer otherwise.
Definition generic_rr.h:55
R12_k_G12 is a two-body operator of form r_{12}^k * exp(-\gamma * r_{12}), where k is an integer and ...
Definition oper.h:418
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:445
T norm1() const
1-norm
Definition vectorn.h:50
these objects help to construct BraketPairs
Definition src/bin/libint/braket.h:275
BraketPair< F, PKet > _pket(const F &f1, const F &f2)
Physicists ket.
Definition src/bin/libint/braket.h:283
BraketPair< F, PBra > _pbra(const F &f1, const F &f2)
Physicists bra.
Definition src/bin/libint/braket.h:278
Defaults definitions for various parameters assumed by Libint.
Definition algebra.cc:24
DefaultQuantumNumbers< unsignedint, 1 >::Result mType
mType is the type that describes the auxiliary index of standard 2-body repulsion integrals
Definition quanta.h:395
bool ltzero(const IntVec3 &a)
return true if has elements < 0
Definition vectorn.h:94
LinearCombination< std::shared_ptr< DGVertex >, BraketPair< F, BKType > > R12v(const BraketPair< F, BKType > &bkt, unsigned int xyz)
Applies R12v to a physicists' braket.
Definition gaussoper.h:189
DefaultQuantumNumbers< int, 0 >::Result EmptySet
EmptySet is the type that describes null set of auxiliary indices.
Definition quanta.h:390