flexiblesusy is hosted by Hepforge, IPPP Durham
FlexibleSUSY
vertices.hpp
Go to the documentation of this file.
1// ====================================================================
2// This file is part of FlexibleSUSY.
3//
4// FlexibleSUSY is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published
6// by the Free Software Foundation, either version 3 of the License,
7// or (at your option) any later version.
8//
9// FlexibleSUSY is distributed in the hope that it will be useful, but
10// WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12// General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with FlexibleSUSY. If not, see
16// <http://www.gnu.org/licenses/>.
17// ====================================================================
18
19
20#ifndef CXXQFT_VERTICES_H
21#define CXXQFT_VERTICES_H
22
23#include "multiindex.hpp"
24#include "numerics2.hpp"
25
26#include "fields.hpp"
27
28#include <array>
29#include <algorithm>
30
31#include <boost/mpl/erase.hpp>
32#include <boost/mpl/fold.hpp>
33#include <boost/mpl/joint_view.hpp>
34#include <boost/mpl/vector.hpp>
35
36namespace flexiblesusy {
37namespace cxx_diagrams {
38
39 struct context_base;
40
42 {
43 private:
44 std::complex<double> val;
45
46 public:
47 ScalarVertex(std::complex<double> v) : val(v) {}
48
49 std::complex<double> value() const { return val; }
50
51 bool isZero() const
52 {
53 return (is_zero(val.real()) && is_zero(val.imag()));
54 }
55 };
56
58 {
59 private:
60 std::pair<std::complex<double>, std::complex<double>> value;
61
62 public:
63 ChiralVertex(const std::complex<double>& left,
64 const std::complex<double>& right)
65 : value(left, right)
66 {
67 }
68
69 std::complex<double> left() const { return value.first; }
70 std::complex<double> right() const { return value.second; }
71
72 bool isZero() const
73 {
74 return (is_zero(value.first.real()) && is_zero(value.first.imag()) &&
75 is_zero(value.second.real()) && is_zero(value.second.imag()));
76 }
77 };
78
86 std::complex<double> val;
87 int ind;
88public:
92 MomentumVertex(const std::complex<double>& v, int i)
93 : val(v), ind(i)
94 {}
95
100 int index() const { return ind; }
101
107 std::complex<double> value(int i) const
108 {
109 if (i != ind)
110 throw std::invalid_argument(
111 "MomentumVertex: Wrong index specified");
112
113 return val;
114 }
115
116 bool isZero() const
117 {
118 return (is_zero(val.real()) && is_zero(val.imag()));
119 }
120};
121
139public:
142private:
143 std::complex<double> val;
144 bool even;
145public:
149 TripleVectorVertex(const std::complex<double>& v,
151 : val(v), even(true)
152 {}
153
157 TripleVectorVertex(const std::complex<double>& v,
159 : val(v), even(false)
160 {}
161
166 bool is_even() const { return even; }
167
171 std::complex<double> value(even_permutation) const
172 { return even ? val : - val; }
173
177 std::complex<double> value(odd_permutation) const
178 { return even ? - val : val; }
179
180 bool isZero() const
181 {
182 return (is_zero(val.real()) && is_zero(val.imag()));
183 }
184};
185
196 std::complex<double> part1, part2, part3;
197
198public:
203 QuadrupleVectorVertex(const std::complex<double>& p1,
204 const std::complex<double>& p2,
205 const std::complex<double>& p3)
206 : part1(p1), part2(p2), part3(p3)
207 {}
208
212 std::complex<double> value1() const { return part1; }
213
217 std::complex<double> value2() const { return part2; }
218
222 std::complex<double> value3() const { return part3; }
223
224 bool isZero() const
225 {
226 return (is_zero(part1.real()) && is_zero(part1.imag()) &&
227 is_zero(part2.real()) && is_zero(part2.imag()) &&
228 is_zero(part3.real()) && is_zero(part3.imag()));
229 }
230};
231
233 std::complex<double> val;
236public:
237 MomentumDifferenceVertex(std::complex<double> v, int mi, int si)
238 : val(v), minuendIndex(mi), subtrahendIndex(si) {}
239
240 std::complex<double> value(int mi, int si) const
241 {
242 if (mi == minuendIndex && si == subtrahendIndex)
243 return val;
244 if (mi == subtrahendIndex && si == minuendIndex)
245 return -val;
246
247 throw std::invalid_argument(
248 "MomentumDifferenceVertex: Wrong index combination");
249 return 0.0;
250 }
251
252 int incoming_index() const { return minuendIndex; }
253 int outgoing_index() const { return subtrahendIndex; }
254
255 bool isZero() const
256 {
257 return (is_zero(val.real()) && is_zero(val.imag()));
258 }
259};
260
262 std::complex<double> val;
263public:
264 InverseMetricVertex(std::complex<double> v) : val(v) {}
265
266 std::complex<double> value() const { return val; }
267
268 bool isZero() const
269 {
270 return (is_zero(val.real()) && is_zero(val.imag()));
271 }
272};
273
274} // namespace cxx_diagrams
275} // namespace flexiblesusy
276
277#endif
std::pair< std::complex< double >, std::complex< double > > value
Definition: vertices.hpp:60
std::complex< double > left() const
Definition: vertices.hpp:69
ChiralVertex(const std::complex< double > &left, const std::complex< double > &right)
Definition: vertices.hpp:63
std::complex< double > right() const
Definition: vertices.hpp:70
std::complex< double > value() const
Definition: vertices.hpp:266
InverseMetricVertex(std::complex< double > v)
Definition: vertices.hpp:264
MomentumDifferenceVertex(std::complex< double > v, int mi, int si)
Definition: vertices.hpp:237
std::complex< double > value(int mi, int si) const
Definition: vertices.hpp:240
A class representing a numerically evaluated tree-level vertex that is proportional to a momentum....
Definition: vertices.hpp:85
std::complex< double > value(int i) const
Retrieve the numerical value of the vertex.
Definition: vertices.hpp:107
MomentumVertex(const std::complex< double > &v, int i)
Contruct a MomentumVertex from a complex number representing and a field index.
Definition: vertices.hpp:92
int index() const
Retrieve the index of the field to whose momentum the vertex is proportional.
Definition: vertices.hpp:100
A class representing a numerically evaluated tree-level vertex with four vector bosons....
Definition: vertices.hpp:195
std::complex< double > value1() const
Retrieve the coefficient of .
Definition: vertices.hpp:212
std::complex< double > value2() const
Retrieve the coefficient of .
Definition: vertices.hpp:217
QuadrupleVectorVertex(const std::complex< double > &p1, const std::complex< double > &p2, const std::complex< double > &p3)
Contruct a QuadrupleVectorVertex from three complex numbers representing the coefficients in the basi...
Definition: vertices.hpp:203
std::complex< double > value3() const
Retrieve the coefficient of .
Definition: vertices.hpp:222
ScalarVertex(std::complex< double > v)
Definition: vertices.hpp:47
std::complex< double > value() const
Definition: vertices.hpp:49
A class representing a numerically evaluated tree-level vertex with three vector bosons....
Definition: vertices.hpp:138
TripleVectorVertex(const std::complex< double > &v, even_permutation)
Contruct a TripleVectorVertex from a complex number representing the even coefficient.
Definition: vertices.hpp:149
bool is_even() const
Check whether the value in the vertex is stored as proportional to the even permutation.
Definition: vertices.hpp:166
TripleVectorVertex(const std::complex< double > &v, odd_permutation)
Contruct a TripleVectorVertex from a complex number representing the odd coefficient.
Definition: vertices.hpp:157
std::complex< double > value(odd_permutation) const
Retrieve the coefficient of the odd permutation.
Definition: vertices.hpp:177
std::complex< double > value(even_permutation) const
Retrieve the coefficient of the even permutation.
Definition: vertices.hpp:171
std::enable_if_t< std::is_unsigned< T >::value, bool > is_zero(T a, T prec=std::numeric_limits< T >::epsilon()) noexcept
compares a number for being close to zero
Definition: numerics2.hpp:46