GQCP
Loading...
Searching...
No Matches
PrimitiveLinearMomentumIntegralEngine.hpp
Go to the documentation of this file.
1// This file is part of GQCG-GQCP.
2//
3// Copyright (C) 2017-2020 the GQCG developers
4//
5// GQCG-GQCP is free software: you can redistribute it and/or modify
6// it under the terms of the GNU Lesser General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// GQCG-GQCP 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 Lesser General Public License for more details.
14//
15// You should have received a copy of the GNU Lesser General Public License
16// along with GQCG-GQCP. If not, see <http://www.gnu.org/licenses/>.
17
18#pragma once
19
25#include "Utilities/complex.hpp"
26
27
28namespace GQCP {
29
30
36template <typename _Shell>
39public:
40 // The type of shell that this integral engine is related to.
41 using Shell = _Shell;
42
43 // The type of primitive that underlies the type of shell.
44 using Primitive = typename Shell::Primitive;
45
46 // The scalar representation of a linear momentum integral.
48
49
50public:
51 /*
52 * MARK: Constructors
53 */
54
55 // Inherit `BaseVectorPrimitiveIntegralEngine`'s constructors.
57
58
59 /*
60 * MARK: CartesianGTO integrals
61 */
62
71 template <typename Z = Shell>
73
74 // Prepare some variables.
75 const auto i = static_cast<int>(left.cartesianExponents().value(CartesianDirection::x));
76 const auto k = static_cast<int>(left.cartesianExponents().value(CartesianDirection::y));
77 const auto m = static_cast<int>(left.cartesianExponents().value(CartesianDirection::z));
78
79 const auto j = static_cast<int>(right.cartesianExponents().value(CartesianDirection::x));
80 const auto l = static_cast<int>(right.cartesianExponents().value(CartesianDirection::y));
81 const auto n = static_cast<int>(right.cartesianExponents().value(CartesianDirection::z));
82
83 const auto a = left.gaussianExponent();
84 const auto b = right.gaussianExponent();
85
86 const auto K_x = left.center()(CartesianDirection::x);
87 const auto K_y = left.center()(CartesianDirection::y);
88 const auto K_z = left.center()(CartesianDirection::z);
89
90 const auto L_x = right.center()(CartesianDirection::x);
91 const auto L_y = right.center()(CartesianDirection::y);
92 const auto L_z = right.center()(CartesianDirection::z);
93
95
96
97 // For the current component, the integral can be calculated as a product of three contributions.
98 switch (this->component) {
100 return this->calculate1D(a, K_x, i, b, L_x, j) * S.calculate1D(a, K_y, k, b, L_y, l) * S.calculate1D(a, K_z, m, b, L_z, n);
101 break;
102 }
103
105 return S.calculate1D(a, K_x, i, b, L_x, j) * this->calculate1D(a, K_y, k, b, L_y, l) * S.calculate1D(a, K_z, m, b, L_z, n);
106 break;
107 }
108
110 return S.calculate1D(a, K_x, i, b, L_x, j) * S.calculate1D(a, K_y, k, b, L_y, l) * this->calculate1D(a, K_z, m, b, L_z, n);
111 break;
112 }
113 }
114 }
115
116
129 template <typename Z = Shell>
130 enable_if_t<std::is_same<Z, GTOShell>::value, IntegralScalar> calculate1D(const double a, const double K, const int i, const double b, const double L, const int j) {
131
132 // The linear momentum integral is expressed entirely using overlap integrals.
134
135 using namespace GQCP::literals;
136 return 2.0 * 1.0_ii * b * S.calculate1D(a, K, i, b, L, j + 1) -
137 1.0_ii * static_cast<double>(j) * S.calculate1D(a, K, i, b, L, j - 1);
138 }
139
140
141 /*
142 * MARK: London CartesianGTO integrals
143 */
144
153 template <typename Z = Shell>
155
156 // Prepare some variables.
157 const auto i = static_cast<int>(left.cartesianGTO().cartesianExponents().value(CartesianDirection::x));
158 const auto k = static_cast<int>(left.cartesianGTO().cartesianExponents().value(CartesianDirection::y));
159 const auto m = static_cast<int>(left.cartesianGTO().cartesianExponents().value(CartesianDirection::z));
160
161 const auto j = static_cast<int>(right.cartesianGTO().cartesianExponents().value(CartesianDirection::x));
162 const auto l = static_cast<int>(right.cartesianGTO().cartesianExponents().value(CartesianDirection::y));
163 const auto n = static_cast<int>(right.cartesianGTO().cartesianExponents().value(CartesianDirection::z));
164
165 const auto a = left.cartesianGTO().gaussianExponent();
166 const auto b = right.cartesianGTO().gaussianExponent();
167
168 const auto K_x = left.cartesianGTO().center()(CartesianDirection::x);
169 const auto K_y = left.cartesianGTO().center()(CartesianDirection::y);
170 const auto K_z = left.cartesianGTO().center()(CartesianDirection::z);
171
172 const auto L_x = right.cartesianGTO().center()(CartesianDirection::x);
173 const auto L_y = right.cartesianGTO().center()(CartesianDirection::y);
174 const auto L_z = right.cartesianGTO().center()(CartesianDirection::z);
175
176 const auto k_K = left.kVector();
177 const auto k_L = right.kVector();
178 const Vector<double, 3> k1 = right.kVector() - left.kVector(); // The k-vector of the London overlap distribution.
179
180 const auto k_K_x = k_K(CartesianDirection::x);
181 const auto k_K_y = k_K(CartesianDirection::y);
182 const auto k_K_z = k_K(CartesianDirection::z);
183
184 const auto k_L_x = k_L(CartesianDirection::x);
185 const auto k_L_y = k_L(CartesianDirection::y);
186 const auto k_L_z = k_L(CartesianDirection::z);
187
188 const auto k1_x = k1(CartesianDirection::x);
189 const auto k1_y = k1(CartesianDirection::y);
190 const auto k1_z = k1(CartesianDirection::z);
191
192
193 // For the current component, the integral can be calculated as a product of three contributions.
195
196 switch (this->component) {
198 return this->calculate1D(k_K_x, a, K_x, i, k_L_x, b, L_x, j) * S.calculate1D(k1_y, a, K_y, k, b, L_y, l) * S.calculate1D(k1_z, a, K_z, m, b, L_z, n);
199 break;
200 }
201
203 return S.calculate1D(k1_x, a, K_x, i, b, L_x, j) * this->calculate1D(k_K_y, a, K_y, k, k_L_y, b, L_y, l) * S.calculate1D(k1_z, a, K_z, m, b, L_z, n);
204 break;
205 }
206
208 return S.calculate1D(k1_x, a, K_x, i, b, L_x, j) * S.calculate1D(k1_y, a, K_y, k, b, L_y, l) * this->calculate1D(k_K_z, a, K_z, m, k_L_z, b, L_z, n);
209 break;
210 }
211 }
212 }
213
214
229 template <typename Z = Shell>
230 enable_if_t<std::is_same<Z, LondonGTOShell>::value, IntegralScalar> calculate1D(const complex k_K, const double a, const double K, const int i, const complex k_L, const double b, const double L, const int j) {
231
232 using namespace GQCP::literals;
233
234 // The linear momentum integral is a sum of three 1-D overlap integrals. We'll order them from highest to lowest angular momentum.
235 const auto k1 = k_L - k_K; // The (directional component of the) k-vector of the London overlap distribution.
237
238 return 2.0 * 1.0_ii * b * S.calculate1D(k1, a, K, i, b, L, j + 1) -
239 k_L * S.calculate1D(k1, a, K, i, b, L, j) -
240 1.0_ii * static_cast<double>(j) * S.calculate1D(k1, a, K, i, b, L, j - 1);
241 }
242};
243
244
245} // namespace GQCP
Definition: BaseVectorPrimitiveIntegralEngine.hpp:32
CartesianDirection component
Definition: BaseVectorPrimitiveIntegralEngine.hpp:36
BaseVectorPrimitiveIntegralEngine(const CartesianDirection component=CartesianDirection::x)
Definition: BaseVectorPrimitiveIntegralEngine.cpp:35
Definition: CartesianGTO.hpp:38
const Vector< double, 3 > & center() const
Definition: CartesianGTO.hpp:129
double gaussianExponent() const
Definition: CartesianGTO.hpp:139
const CartesianExponents & cartesianExponents() const
Definition: CartesianGTO.hpp:112
Definition: LondonCartesianGTO.hpp:38
Vector< double, 3 > kVector() const
Definition: LondonCartesianGTO.cpp:45
const CartesianGTO & cartesianGTO() const
Definition: LondonCartesianGTO.hpp:89
Definition: Matrix.hpp:47
Definition: PrimitiveLinearMomentumIntegralEngine.hpp:38
enable_if_t< std::is_same< Z, GTOShell >::value, IntegralScalar > calculate1D(const double a, const double K, const int i, const double b, const double L, const int j)
Definition: PrimitiveLinearMomentumIntegralEngine.hpp:130
_Shell Shell
Definition: PrimitiveLinearMomentumIntegralEngine.hpp:41
enable_if_t< std::is_same< Z, LondonGTOShell >::value, IntegralScalar > calculate(const LondonCartesianGTO &left, const LondonCartesianGTO &right)
Definition: PrimitiveLinearMomentumIntegralEngine.hpp:154
typename Shell::Primitive Primitive
Definition: PrimitiveLinearMomentumIntegralEngine.hpp:44
enable_if_t< std::is_same< Z, LondonGTOShell >::value, IntegralScalar > calculate1D(const complex k_K, const double a, const double K, const int i, const complex k_L, const double b, const double L, const int j)
Definition: PrimitiveLinearMomentumIntegralEngine.hpp:230
enable_if_t< std::is_same< Z, GTOShell >::value, IntegralScalar > calculate(const CartesianGTO &left, const CartesianGTO &right)
Definition: PrimitiveLinearMomentumIntegralEngine.hpp:72
product_t< LinearMomentumOperator::Scalar, typename Primitive::OutputType > IntegralScalar
Definition: PrimitiveLinearMomentumIntegralEngine.hpp:47
Definition: PrimitiveOverlapIntegralEngine.hpp:43
enable_if_t< std::is_same< Z, GTOShell >::value, IntegralScalar > calculate1D(const double a, const double K, const int i, const double b, const double L, const int j)
Definition: PrimitiveOverlapIntegralEngine.hpp:97
Definition: complex.hpp:57
Definition: BaseOneElectronIntegralBuffer.hpp:25
typename std::enable_if< B, T >::type enable_if_t
Definition: type_traits.hpp:37
decltype(std::declval< T >() *std::declval< U >()) product_t
Definition: aliases.hpp:35
std::complex< double > complex
Definition: complex.hpp:31
@ z
Definition: CartesianDirection.hpp:30
@ x
Definition: CartesianDirection.hpp:28
@ y
Definition: CartesianDirection.hpp:29
size_t value(const CartesianDirection direction) const
Definition: CartesianExponents.hpp:116