LIBINT 2.7.2
comp_xyz.h
1/*
2 * Copyright (C) 2004-2021 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_compxyz_h_
22#define _libint2_src_bin_libint_compxyz_h_
23
24#include <generic_rr.h>
25
26namespace libint2 {
27
32 template <typename F, typename Oper, typename AuxQuanta = EmptySet>
33 class CR_XYZ_1_1 : public GenericRecurrenceRelation< CR_XYZ_1_1<F,Oper,AuxQuanta>,
34 F,
35 GenIntegralSet_1_1<F,Oper,AuxQuanta> >
36 {
37 public:
39 typedef F BasisFunctionType;
40 typedef Oper OperType;
43 friend class GenericRecurrenceRelation<ThisType,BasisFunctionType,TargetType>;
44 static const unsigned int max_nchildren = 100;
45
47
48 static bool directional() { return false; }
49
50 private:
51 using ParentType::RecurrenceRelation::expr_;
52 using ParentType::RecurrenceRelation::nflops_;
53 using ParentType::target_;
55
57 CR_XYZ_1_1(const SafePtr<TargetType>&, unsigned int dir = 0);
58
59 static std::string descr() { return "CR"; }
60
62 void compute(const BasisFunctionType& bra, const BasisFunctionType& ket, const Oper& oper);
63 };
64
65 template <typename F, typename Oper, typename AuxQuanta>
66 CR_XYZ_1_1<F,Oper,AuxQuanta>::CR_XYZ_1_1(const SafePtr< TargetType >& Tint,
67 unsigned int dir) :
68 ParentType(Tint,dir)
69 {
70 // WARNING assuming one function per position
71 const auto& a = Tint->bra(0,0);
72 const auto& b = Tint->ket(0,0);
73 const auto& aux = Tint->aux();
74 const auto& oper = Tint->oper();
75
76 {
77 // can't apply to contracted basis functions
78 if (a.contracted() || b.contracted())
79 return;
80 // can't apply to differentiated CGF (derivatives will be expanded first)
82 (a.deriv().norm() != 0 ||
83 b.deriv().norm() != 0))
84 return;
85 }
86
87 compute(a,b,oper);
88 } // CR_XYZ_1_1<F,Oper,AuxQuanta>::CR_XYZ_1_1
89
90}; // namespace libint2
91
92#endif
this computes integral over Oper over CGShell/CGF as a product of 1-d integrals
Definition: comp_xyz.h:36
Generic integral over a one-body operator with one bfs for each particle in bra and ket.
Definition: integral_1_1.h:33
RRImpl must inherit GenericRecurrenceRelation<RRImpl>
Definition: generic_rr.h:47
bool is_simple() const override
Implementation of RecurrenceRelation::is_simple()
Definition: generic_rr.h:79
static SafePtr< RRImpl > Instance(const SafePtr< TargetType > &Tint, unsigned int dir)
Return an instance if applicable, or a null pointer otherwise.
Definition: generic_rr.h:55
Oper is OperSet characterized by properties Props.
Definition: oper.h:90
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:24
TrivialBFSet<T> defines static member result, which is true if T is a basis function set consisting o...
Definition: bfset.h:892