DiFfRG
Loading...
Searching...
No Matches
litim.hh
Go to the documentation of this file.
1#pragma once
2
3// DiFfRG
6
7namespace DiFfRG
8{
9 namespace fRG
10 {
15 namespace TFLitimSpatial
16 {
17 static constexpr auto Pi = M_PI;
18 static constexpr auto Pi2 = Pi * Pi;
19 using std::sqrt, std::pow;
20
21 template <int nb, typename NT> NT B(const NT &mb2, const double &k, const double &T)
22 {
23 if constexpr (nb == 1)
24 return (CothFiniteT(k * powr<1>(sqrt(1 + mb2)), T) * powr<-1>(sqrt(1 + mb2))) / 2.;
25 else if constexpr (nb == 2)
26 return (powr<-1>(T) * powr<2>(CschFiniteT((k * powr<1>(sqrt(1 + mb2))), T)) * powr<-3>(sqrt(1 + mb2)) *
27 (k * powr<1>(sqrt(1 + mb2)) + T * Sinh(k * powr<-1>(T) * powr<1>(sqrt(1 + mb2))))) /
28 8.;
29 else if constexpr (nb == 3)
30 return (powr<-3>(1 + mb2) * powr<-2>(T) * powr<2>(CschFiniteT((k * powr<1>(sqrt(1 + mb2))), T)) *
31 (3 * k * (1 + mb2) * T + CothFiniteT((k * powr<1>(sqrt(1 + mb2))), T) *
32 ((1 + mb2) * powr<2>(k) - 3 * powr<2>(T) +
33 3 * Cosh(k * powr<-1>(T) * powr<1>(sqrt(1 + mb2))) * powr<2>(T)) *
34 powr<1>(sqrt(1 + mb2)))) /
35 32.;
36 else if constexpr (nb == 4)
37 return (powr<-3>(T) * powr<4>(CschFiniteT((k * powr<1>(sqrt(1 + mb2))), T)) * powr<-7>(sqrt(1 + mb2)) *
38 (2 * k * (2 * (1 + mb2) * powr<2>(k) - 15 * powr<2>(T)) * powr<1>(sqrt(1 + mb2)) +
39 2 * k * Cosh(k * powr<-1>(T) * powr<1>(sqrt(1 + mb2))) * ((1 + mb2) * powr<2>(k) + 15 * powr<2>(T)) *
40 powr<1>(sqrt(1 + mb2)) +
41 6 * T *
42 (2 * (1 + mb2) * powr<2>(k) - 5 * powr<2>(T) +
43 5 * Cosh(k * powr<-1>(T) * powr<1>(sqrt(1 + mb2))) * powr<2>(T)) *
44 Sinh(k * powr<-1>(T) * powr<1>(sqrt(1 + mb2))))) /
45 768.;
46 else
47 throw std::runtime_error("Threshold Function B is not implemented for given indices");
48 }
49
50 template <int nf, typename NT> NT F(const NT &mf2, const double &k, const double &T, const double &mu)
51 {
52 if constexpr (nf == 1)
53 return (powr<-1>(sqrt(1 + mf2)) * (TanhFiniteT(-mu + k * powr<1>(sqrt(1 + mf2)), T) +
54 TanhFiniteT(mu + k * powr<1>(sqrt(1 + mf2)), T))) /
55 4.;
56 else if constexpr (nf == 2)
57 return -0.0625 * (k * powr<-1>(1 + mf2) * powr<-1>(T) *
58 (powr<2>(SechFiniteT(((-mu + k * powr<1>(sqrt(1 + mf2)))), T)) +
59 powr<2>(SechFiniteT(((mu + k * powr<1>(sqrt(1 + mf2)))), T)))) +
60 (powr<-3>(sqrt(1 + mf2)) * (TanhFiniteT(((-mu + k * powr<1>(sqrt(1 + mf2)))), T) +
61 TanhFiniteT(((mu + k * powr<1>(sqrt(1 + mf2)))), T))) /
62 8.;
63 else if constexpr (nf == 3)
64 return -0.0078125 *
65 (powr<-3>(1 + mf2) * powr<-2>(T) *
66 (-3 * powr<2>(T) * powr<3>(SechFiniteT(((-mu + k * powr<1>(sqrt(1 + mf2)))), T)) *
67 powr<1>(sqrt(1 + mf2)) * SinhFiniteT((3 * (-mu + k * powr<1>(sqrt(1 + mf2)))), T) +
68 powr<2>(SechFiniteT(((-mu + k * powr<1>(sqrt(1 + mf2)))), T)) *
69 (6 * k * (1. + mf2) * T + (2 * (1 + mf2) * powr<2>(k) - 3 * powr<2>(T)) *
70 powr<1>(sqrt(1 + mf2)) *
71 TanhFiniteT(((-mu + k * powr<1>(sqrt(1 + mf2)))), T)) +
72 2. * powr<2>(SechFiniteT(((mu + k * powr<1>(sqrt(1 + mf2)))), T)) *
73 (3. * k * (1. + mf2) * T +
74 ((1 + mf2) * powr<2>(k) - 3 * powr<2>(T) -
75 3. * CoshFiniteT((mu + k * powr<1>(sqrt(1. + mf2))), T) * powr<2>(T)) *
76 powr<1>(sqrt(1. + mf2)) * TanhFiniteT(((mu + k * powr<1>(sqrt(1. + mf2)))), T))));
77 else
78 throw std::runtime_error("Threshold Function F is not implemented for given indices");
79 }
80
81 template <int nb1, int nb2, typename NT, typename NT1, typename NT2>
82 NT BB(const NT1 &mb12, const NT2 &mb22, const double &k, const double &T)
83 {
84 if (is_close(double(mb12), double(mb22))) return B<nb1 + nb2, NT>(mb12, k, T);
85 if constexpr (nb1 == 2 && nb2 == 2)
86 return (powr<-1>(T) * (powr<-3>(mb12 - mb22) * powr<2>(CschFiniteT((k * powr<1>(sqrt(1 + mb12))), T)) *
87 powr<-3>(sqrt(1 + mb12)) *
88 (k * (mb12 - mb22) * powr<1>(sqrt(1 + mb12)) +
89 (4 + 5 * mb12 - mb22) * T * Sinh(k * powr<-1>(T) * powr<1>(sqrt(1 + mb12)))) +
90 powr<-3>(-mb12 + mb22) * powr<2>(CschFiniteT((k * powr<1>(sqrt(1 + mb22))), T)) *
91 powr<-3>(sqrt(1 + mb22)) *
92 (k * (-mb12 + mb22) * powr<1>(sqrt(1 + mb22)) -
93 (-4 + mb12 - 5 * mb22) * T * Sinh(k * powr<-1>(T) * powr<1>(sqrt(1 + mb22)))))) /
94 8.;
95 else
96 throw std::runtime_error("Threshold Function BB is not implemented for given indices");
97 }
98
99 template <int nf, int nb, typename NT, typename NTf, typename NTb>
100 NT FBFermiPiT(const NTf &mf2, const NTb &mb2, const double &k, const double &T, const double &mu)
101 {
102 if constexpr (nf == 1 && nb == 2)
103 return (powr<-1>(1 + mb2) * powr<-1>(T) * powr<2>(CschFiniteT((k * powr<1>(sqrt(1 + mb2))), T)) *
104 (-(powr<9>(k) * powr<3>(mb2 - mf2)) -
105 powr<7>(k) * (2 * mb2 * (2 + mf2) - mf2 * (4 + 3 * mf2) + powr<2>(mb2)) *
106 (-powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) +
107 powr<5>(k) * ((4 + mb2 + 3 * mf2) * powr<4>(mu) +
108 2 * (4 + 5 * mb2 - mf2) * powr<2>(mu) * powr<2>(Pi) * powr<2>(T) +
109 (4 + mb2 + 3 * mf2) * powr<4>(Pi) * powr<4>(T)) +
110 powr<3>(k) * (-powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) *
111 powr<2>(powr<2>(mu) + powr<2>(Pi) * powr<2>(T))) *
112 powr<-1>(powr<4>(k) * powr<2>(mb2 - mf2) +
113 2 * powr<2>(k) *
114 ((2 + 3 * mb2 - mf2) * powr<2>(mu) + (2 + mb2 + mf2) * powr<2>(Pi) * powr<2>(T)) +
115 powr<2>(powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) +
116 4 * (-mb2 + mf2) * mu * powr<3>(k) * powr<1>(sqrt(1 + mb2)) -
117 4 * k * mu * (powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) * powr<1>(sqrt(1 + mb2))) *
118 powr<-1>(powr<4>(k) * powr<2>(mb2 - mf2) +
119 2 * powr<2>(k) *
120 ((2 + 3 * mb2 - mf2) * powr<2>(mu) + (2 + mb2 + mf2) * powr<2>(Pi) * powr<2>(T)) +
121 powr<2>(powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) +
122 4 * (mb2 - mf2) * mu * powr<3>(k) * powr<1>(sqrt(1 + mb2)) +
123 4 * k * mu * (powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) * powr<1>(sqrt(1 + mb2)))) /
124 8. +
125 (CothFiniteT((k * powr<1>(sqrt(1 + mb2))), T) * powr<2>(k) *
126 (-((2 + 3 * mb2 - mf2) * powr<14>(k) * powr<6>(mb2 - mf2)) -
127 powr<12>(k) * powr<4>(mb2 - mf2) *
128 (8 - 8 * mf2 + 6 * mb2 * (4 + mf2) + 9 * powr<2>(mb2) - 7 * powr<2>(mf2)) *
129 (-powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) +
130 powr<10>(k) * powr<2>(mb2 - mf2) *
131 ((32 + 80 * mf2 + 3 * (2 + mf2) * powr<2>(mb2) + powr<3>(mb2) + 70 * powr<2>(mf2) +
132 mb2 * (16 + 20 * mf2 + 7 * powr<2>(mf2)) + 21 * powr<3>(mf2)) *
133 powr<4>(mu) +
134 2 *
135 (160 + 144 * mf2 + (206 + 71 * mf2) * powr<2>(mb2) + 45 * powr<3>(mb2) + 14 * powr<2>(mf2) +
136 mb2 * (336 + 260 * mf2 + 59 * powr<2>(mf2)) - 15 * powr<3>(mf2)) *
137 powr<2>(mu) * powr<2>(Pi) * powr<2>(T) +
138 (32 + 80 * mf2 + 3 * (2 + mf2) * powr<2>(mb2) + powr<3>(mb2) + 70 * powr<2>(mf2) +
139 mb2 * (16 + 20 * mf2 + 7 * powr<2>(mf2)) + 21 * powr<3>(mf2)) *
140 powr<4>(Pi) * powr<4>(T)) +
141 powr<8>(k) * (-powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) *
142 ((128 + 256 * mf2 + 20 * (8 + mf2) * powr<3>(mb2) + 35 * powr<4>(mb2) + 288 * powr<2>(mf2) +
143 6 * powr<2>(mb2) * (48 + 16 * mf2 + 3 * powr<2>(mf2)) + 160 * powr<3>(mf2) +
144 4 * mb2 * (64 + 48 * mf2 + 24 * powr<2>(mf2) + 5 * powr<3>(mf2)) + 35 * powr<4>(mf2)) *
145 powr<4>(mu) +
146 2 *
147 (128 + 256 * mf2 + (416 - 76 * mf2) * powr<3>(mb2) + 123 * powr<4>(mb2) +
148 powr<2>(mb2) * (416 - 416 * mf2 - 94 * powr<2>(mf2)) + 416 * powr<2>(mf2) +
149 160 * powr<3>(mf2) + 4 * mb2 * (64 - 16 * mf2 + 88 * powr<2>(mf2) + 45 * powr<3>(mf2)) -
150 5 * powr<4>(mf2)) *
151 powr<2>(mu) * powr<2>(Pi) * powr<2>(T) +
152 (128 + 256 * mf2 + 20 * (8 + mf2) * powr<3>(mb2) + 35 * powr<4>(mb2) + 288 * powr<2>(mf2) +
153 6 * powr<2>(mb2) * (48 + 16 * mf2 + 3 * powr<2>(mf2)) + 160 * powr<3>(mf2) +
154 4 * mb2 * (64 + 48 * mf2 + 24 * powr<2>(mf2) + 5 * powr<3>(mf2)) + 35 * powr<4>(mf2)) *
155 powr<4>(Pi) * powr<4>(T)) +
156 powr<6>(k) *
157 ((224 + 304 * mf2 + 3 * (78 + 23 * mf2) * powr<2>(mb2) + 55 * powr<3>(mb2) + 170 * powr<2>(mf2) +
158 mb2 * (368 + 268 * mf2 + 65 * powr<2>(mf2)) + 35 * powr<3>(mf2)) *
159 powr<8>(mu) +
160 4 *
161 (96 + 112 * mf2 + (122 - 19 * mf2) * powr<2>(mb2) + 47 * powr<3>(mb2) + 58 * powr<2>(mf2) +
162 mb2 * (176 + 108 * mf2 + 73 * powr<2>(mf2)) - 5 * powr<3>(mf2)) *
163 powr<6>(mu) * powr<2>(Pi) * powr<2>(T) +
164 2 *
165 (160 + 144 * mf2 + 3 * (42 + 101 * mf2) * powr<2>(mb2) - 59 * powr<3>(mb2) +
166 mb2 * (336 + 420 * mf2 - 93 * powr<2>(mf2)) - 66 * powr<2>(mf2) + 9 * powr<3>(mf2)) *
167 powr<4>(mu) * powr<4>(Pi) * powr<4>(T) +
168 4 *
169 (96 + 112 * mf2 + (122 - 19 * mf2) * powr<2>(mb2) + 47 * powr<3>(mb2) + 58 * powr<2>(mf2) +
170 mb2 * (176 + 108 * mf2 + 73 * powr<2>(mf2)) - 5 * powr<3>(mf2)) *
171 powr<2>(mu) * powr<6>(Pi) * powr<6>(T) +
172 (224 + 304 * mf2 + 3 * (78 + 23 * mf2) * powr<2>(mb2) + 55 * powr<3>(mb2) + 170 * powr<2>(mf2) +
173 mb2 * (368 + 268 * mf2 + 65 * powr<2>(mf2)) + 35 * powr<3>(mf2)) *
174 powr<8>(Pi) * powr<8>(T)) +
175 powr<4>(k) * (-powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) *
176 ((104 + 88 * mf2 + 2 * mb2 * (60 + 23 * mf2) + 37 * powr<2>(mb2) + 21 * powr<2>(mf2)) *
177 powr<4>(mu) +
178 2 * (40 + 24 * mf2 + mb2 * (56 + 30 * mf2) + 13 * powr<2>(mb2) - 3 * powr<2>(mf2)) *
179 powr<2>(mu) * powr<2>(Pi) * powr<2>(T) +
180 (104 + 88 * mf2 + 2 * mb2 * (60 + 23 * mf2) + 37 * powr<2>(mb2) + 21 * powr<2>(mf2)) *
181 powr<4>(Pi) * powr<4>(T)) *
182 powr<2>(powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) +
183 powr<2>(k) *
184 ((18 + 11 * mb2 + 7 * mf2) * powr<4>(mu) -
185 2 * (22 + 17 * mb2 + 5 * mf2) * powr<2>(mu) * powr<2>(Pi) * powr<2>(T) +
186 (18 + 11 * mb2 + 7 * mf2) * powr<4>(Pi) * powr<4>(T)) *
187 powr<4>(powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) +
188 (-powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) * powr<6>(powr<2>(mu) + powr<2>(Pi) * powr<2>(T))) *
189 powr<-2>(powr<4>(k) * powr<2>(mb2 - mf2) +
190 2 * powr<2>(k) *
191 ((2 + 3 * mb2 - mf2) * powr<2>(mu) + (2 + mb2 + mf2) * powr<2>(Pi) * powr<2>(T)) +
192 powr<2>(powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) +
193 4 * (-mb2 + mf2) * mu * powr<3>(k) * powr<1>(sqrt(1 + mb2)) -
194 4 * k * mu * (powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) * powr<1>(sqrt(1 + mb2))) *
195 powr<-2>(powr<4>(k) * powr<2>(mb2 - mf2) +
196 2 * powr<2>(k) *
197 ((2 + 3 * mb2 - mf2) * powr<2>(mu) + (2 + mb2 + mf2) * powr<2>(Pi) * powr<2>(T)) +
198 powr<2>(powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) +
199 4 * (mb2 - mf2) * mu * powr<3>(k) * powr<1>(sqrt(1 + mb2)) +
200 4 * k * mu * (powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) * powr<1>(sqrt(1 + mb2))) *
201 powr<-3>(sqrt(1 + mb2))) /
202 4. +
203 (powr<4>(k) *
204 powr<-2>(powr<4>(k) * powr<2>(mb2 - mf2) +
205 2 * powr<2>(k) *
206 ((2 - mb2 + 3 * mf2) * powr<2>(mu) + (2 + mb2 + mf2) * powr<2>(Pi) * powr<2>(T)) +
207 powr<2>(powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) +
208 4 * (mb2 - mf2) * mu * powr<3>(k) * powr<1>(sqrt(1 + mf2)) -
209 4 * k * mu * (powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) * powr<1>(sqrt(1 + mf2))) *
210 powr<-1>(sqrt(1 + mf2)) *
211 (powr<4>(k) * powr<2>(mb2 - mf2) + powr<4>(mu) - 6 * powr<2>(mu) * powr<2>(Pi) * powr<2>(T) +
212 2 * (-2 + mb2 - 3 * mf2) * powr<2>(k) * (-powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) +
213 powr<4>(Pi) * powr<4>(T) + 4 * (mb2 - mf2) * mu * powr<3>(k) * powr<1>(sqrt(1 + mf2)) -
214 4 * k * mu * (powr<2>(mu) - 3 * powr<2>(Pi) * powr<2>(T)) * powr<1>(sqrt(1 + mf2))) *
215 Tanh((powr<-1>(T) * (-mu + k * powr<1>(sqrt(1 + mf2)))) / 2.)) /
216 4. +
217 (powr<4>(k) *
218 powr<-2>(powr<4>(k) * powr<2>(mb2 - mf2) +
219 2 * powr<2>(k) *
220 ((2 - mb2 + 3 * mf2) * powr<2>(mu) + (2 + mb2 + mf2) * powr<2>(Pi) * powr<2>(T)) +
221 powr<2>(powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) +
222 4 * (-mb2 + mf2) * mu * powr<3>(k) * powr<1>(sqrt(1 + mf2)) +
223 4 * k * mu * (powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) * powr<1>(sqrt(1 + mf2))) *
224 powr<-1>(sqrt(1 + mf2)) *
225 (powr<4>(k) * powr<2>(mb2 - mf2) + powr<4>(mu) - 6 * powr<2>(mu) * powr<2>(Pi) * powr<2>(T) +
226 2 * (-2 + mb2 - 3 * mf2) * powr<2>(k) * (-powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) +
227 powr<4>(Pi) * powr<4>(T) + 4 * (-mb2 + mf2) * mu * powr<3>(k) * powr<1>(sqrt(1 + mf2)) +
228 4 * k * mu * (powr<2>(mu) - 3 * powr<2>(Pi) * powr<2>(T)) * powr<1>(sqrt(1 + mf2))) *
229 Tanh((powr<-1>(T) * (mu + k * powr<1>(sqrt(1 + mf2)))) / 2.)) /
230 4.;
231 else if constexpr (nf == 2 && nb == 1)
232 return (CothFiniteT((k * powr<1>(sqrt(1 + mb2))), T) * powr<4>(k) *
233 (powr<12>(k) * powr<6>(mb2 - mf2) -
234 2 * (-2 + mb2 - 3 * mf2) * powr<10>(k) * powr<4>(mb2 - mf2) *
235 (-powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) -
236 powr<8>(k) * powr<2>(mb2 - mf2) *
237 ((16 - 16 * mf2 + 2 * mb2 * (24 + 7 * mf2) + 17 * powr<2>(mb2) - 15 * powr<2>(mf2)) *
238 powr<4>(mu) +
239 2 * (80 + 48 * mf2 + 2 * mb2 * (56 + 11 * mf2) + 45 * powr<2>(mb2) + 13 * powr<2>(mf2)) *
240 powr<2>(mu) * powr<2>(Pi) * powr<2>(T) +
241 (16 - 16 * mf2 + 2 * mb2 * (24 + 7 * mf2) + 17 * powr<2>(mb2) - 15 * powr<2>(mf2)) *
242 powr<4>(Pi) * powr<4>(T)) -
243 4 * powr<6>(k) * (-powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) *
244 ((16 + 8 * mf2 + (26 + 5 * mf2) * powr<2>(mb2) + 7 * powr<3>(mb2) - 6 * powr<2>(mf2) +
245 mb2 * (40 + 28 * mf2 + 9 * powr<2>(mf2)) - 5 * powr<3>(mf2)) *
246 powr<4>(mu) +
247 2 *
248 (16 + 8 * mf2 - 3 * (-14 + mf2) * powr<2>(mb2) + 15 * powr<3>(mb2) + 10 * powr<2>(mf2) +
249 mb2 * (40 - 4 * mf2 + powr<2>(mf2)) + 3 * powr<3>(mf2)) *
250 powr<2>(mu) * powr<2>(Pi) * powr<2>(T) +
251 (16 + 8 * mf2 + (26 + 5 * mf2) * powr<2>(mb2) + 7 * powr<3>(mb2) - 6 * powr<2>(mf2) +
252 mb2 * (40 + 28 * mf2 + 9 * powr<2>(mf2)) - 5 * powr<3>(mf2)) *
253 powr<4>(Pi) * powr<4>(T)) +
254 powr<4>(k) *
255 (-((16 - 16 * mf2 + 2 * mb2 * (24 + 7 * mf2) + 17 * powr<2>(mb2) - 15 * powr<2>(mf2)) *
256 powr<8>(mu)) +
257 4 * (48 + 16 * mf2 + mb2 * (80 + 34 * mf2) + 23 * powr<2>(mb2) - 9 * powr<2>(mf2)) *
258 powr<6>(mu) * powr<2>(Pi) * powr<2>(T) +
259 2 * (208 + 48 * mf2 + mb2 * (368 + 22 * mf2) + 173 * powr<2>(mb2) + 13 * powr<2>(mf2)) *
260 powr<4>(mu) * powr<4>(Pi) * powr<4>(T) +
261 4 * (48 + 16 * mf2 + mb2 * (80 + 34 * mf2) + 23 * powr<2>(mb2) - 9 * powr<2>(mf2)) *
262 powr<2>(mu) * powr<6>(Pi) * powr<6>(T) -
263 (16 - 16 * mf2 + 2 * mb2 * (24 + 7 * mf2) + 17 * powr<2>(mb2) - 15 * powr<2>(mf2)) *
264 powr<8>(Pi) * powr<8>(T)) -
265 2 * powr<2>(k) * (-powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) *
266 ((-2 + mb2 - 3 * mf2) * powr<4>(mu) -
267 2 * (18 + 23 * mb2 - 5 * mf2) * powr<2>(mu) * powr<2>(Pi) * powr<2>(T) +
268 (-2 + mb2 - 3 * mf2) * powr<4>(Pi) * powr<4>(T)) *
269 powr<2>(powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) +
270 (powr<4>(mu) - 6 * powr<2>(mu) * powr<2>(Pi) * powr<2>(T) + powr<4>(Pi) * powr<4>(T)) *
271 powr<4>(powr<2>(mu) + powr<2>(Pi) * powr<2>(T))) *
272 powr<-2>(powr<4>(k) * powr<2>(mb2 - mf2) +
273 2 * powr<2>(k) *
274 ((2 + 3 * mb2 - mf2) * powr<2>(mu) + (2 + mb2 + mf2) * powr<2>(Pi) * powr<2>(T)) +
275 powr<2>(powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) +
276 4 * (-mb2 + mf2) * mu * powr<3>(k) * powr<1>(sqrt(1 + mb2)) -
277 4 * k * mu * (powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) * powr<1>(sqrt(1 + mb2))) *
278 powr<-2>(powr<4>(k) * powr<2>(mb2 - mf2) +
279 2 * powr<2>(k) *
280 ((2 + 3 * mb2 - mf2) * powr<2>(mu) + (2 + mb2 + mf2) * powr<2>(Pi) * powr<2>(T)) +
281 powr<2>(powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) +
282 4 * (mb2 - mf2) * mu * powr<3>(k) * powr<1>(sqrt(1 + mb2)) +
283 4 * k * mu * (powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) * powr<1>(sqrt(1 + mb2))) *
284 powr<-1>(sqrt(1 + mb2))) /
285 2. +
286 (powr<3>(k) * powr<-1>(1 + mf2) * powr<-1>(T) *
287 powr<-1>(powr<4>(k) * powr<2>(mb2 - mf2) +
288 2 * powr<2>(k) *
289 ((2 - mb2 + 3 * mf2) * powr<2>(mu) + (2 + mb2 + mf2) * powr<2>(Pi) * powr<2>(T)) +
290 powr<2>(powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) +
291 4 * (mb2 - mf2) * mu * powr<3>(k) * powr<1>(sqrt(1 + mf2)) -
292 4 * k * mu * (powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) * powr<1>(sqrt(1 + mf2))) *
293 powr<2>(Sech((powr<-1>(T) * (-mu + k * powr<1>(sqrt(1 + mf2)))) / 2.)) *
294 ((-mb2 + mf2) * powr<2>(k) + powr<2>(mu) - powr<2>(Pi) * powr<2>(T) -
295 2 * k * mu * powr<1>(sqrt(1 + mf2)))) /
296 16. +
297 (powr<3>(k) * powr<-1>(1 + mf2) * powr<-1>(T) *
298 powr<-1>(powr<4>(k) * powr<2>(mb2 - mf2) +
299 2 * powr<2>(k) *
300 ((2 - mb2 + 3 * mf2) * powr<2>(mu) + (2 + mb2 + mf2) * powr<2>(Pi) * powr<2>(T)) +
301 powr<2>(powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) +
302 4 * (-mb2 + mf2) * mu * powr<3>(k) * powr<1>(sqrt(1 + mf2)) +
303 4 * k * mu * (powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) * powr<1>(sqrt(1 + mf2))) *
304 powr<2>(Sech((powr<-1>(T) * (mu + k * powr<1>(sqrt(1 + mf2)))) / 2.)) *
305 ((-mb2 + mf2) * powr<2>(k) + powr<2>(mu) - powr<2>(Pi) * powr<2>(T) +
306 2 * k * mu * powr<1>(sqrt(1 + mf2)))) /
307 16. +
308 (powr<2>(k) *
309 powr<-2>(powr<4>(k) * powr<2>(mb2 - mf2) +
310 2 * powr<2>(k) *
311 ((2 - mb2 + 3 * mf2) * powr<2>(mu) + (2 + mb2 + mf2) * powr<2>(Pi) * powr<2>(T)) +
312 powr<2>(powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) +
313 4 * (mb2 - mf2) * mu * powr<3>(k) * powr<1>(sqrt(1 + mf2)) -
314 4 * k * mu * (powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) * powr<1>(sqrt(1 + mf2))) *
315 powr<-3>(sqrt(1 + mf2)) *
316 ((-2 + mb2 - 3 * mf2) * powr<6>(k) * powr<2>(mb2 - mf2) +
317 powr<4>(k) * (-((8 + 40 * mf2 - 6 * mb2 * (4 + 5 * mf2) + 3 * powr<2>(mb2) + 35 * powr<2>(mf2)) *
318 powr<2>(mu)) +
319 (8 + 8 * mf2 + 2 * mb2 * (4 + mf2) + 3 * powr<2>(mb2) + 3 * powr<2>(mf2)) *
320 powr<2>(Pi) * powr<2>(T)) +
321 powr<2>(k) * ((-22 + 3 * mb2 - 25 * mf2) * powr<4>(mu) -
322 2 * (-2 + mb2 - 3 * mf2) * powr<2>(mu) * powr<2>(Pi) * powr<2>(T) +
323 (10 + 3 * mb2 + 7 * mf2) * powr<4>(Pi) * powr<4>(T)) +
324 (-powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) * powr<2>(powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) +
325 8 * mu * powr<5>(k) * (-mb2 + mf2 - 3 * mb2 * mf2 + powr<2>(mb2) + 2 * powr<2>(mf2)) *
326 powr<1>(sqrt(1 + mf2)) -
327 8 * mu * powr<3>(k) *
328 ((-3 + 2 * mb2 - 5 * mf2) * powr<2>(mu) + (1 + mf2) * powr<2>(Pi) * powr<2>(T)) *
329 powr<1>(sqrt(1 + mf2)) +
330 8 * k * mu * (powr<4>(mu) - powr<4>(Pi) * powr<4>(T)) * powr<1>(sqrt(1 + mf2))) *
331 Tanh((powr<-1>(T) * (-mu + k * powr<1>(sqrt(1 + mf2)))) / 2.)) /
332 8. +
333 (powr<2>(k) *
334 powr<-2>(powr<4>(k) * powr<2>(mb2 - mf2) +
335 2 * powr<2>(k) *
336 ((2 - mb2 + 3 * mf2) * powr<2>(mu) + (2 + mb2 + mf2) * powr<2>(Pi) * powr<2>(T)) +
337 powr<2>(powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) +
338 4 * (-mb2 + mf2) * mu * powr<3>(k) * powr<1>(sqrt(1 + mf2)) +
339 4 * k * mu * (powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) * powr<1>(sqrt(1 + mf2))) *
340 powr<-3>(sqrt(1 + mf2)) *
341 ((-2 + mb2 - 3 * mf2) * powr<6>(k) * powr<2>(mb2 - mf2) +
342 powr<4>(k) * (-((8 + 40 * mf2 - 6 * mb2 * (4 + 5 * mf2) + 3 * powr<2>(mb2) + 35 * powr<2>(mf2)) *
343 powr<2>(mu)) +
344 (8 + 8 * mf2 + 2 * mb2 * (4 + mf2) + 3 * powr<2>(mb2) + 3 * powr<2>(mf2)) *
345 powr<2>(Pi) * powr<2>(T)) +
346 powr<2>(k) * ((-22 + 3 * mb2 - 25 * mf2) * powr<4>(mu) -
347 2 * (-2 + mb2 - 3 * mf2) * powr<2>(mu) * powr<2>(Pi) * powr<2>(T) +
348 (10 + 3 * mb2 + 7 * mf2) * powr<4>(Pi) * powr<4>(T)) +
349 (-powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) * powr<2>(powr<2>(mu) + powr<2>(Pi) * powr<2>(T)) -
350 8 * mu * powr<5>(k) * (-mb2 + mf2 - 3 * mb2 * mf2 + powr<2>(mb2) + 2 * powr<2>(mf2)) *
351 powr<1>(sqrt(1 + mf2)) +
352 8 * mu * powr<3>(k) *
353 ((-3 + 2 * mb2 - 5 * mf2) * powr<2>(mu) + (1 + mf2) * powr<2>(Pi) * powr<2>(T)) *
354 powr<1>(sqrt(1 + mf2)) -
355 8 * k * mu * (powr<4>(mu) - powr<4>(Pi) * powr<4>(T)) * powr<1>(sqrt(1 + mf2))) *
356 TanhFiniteT(mu + k * powr<1>(sqrt(1 + mf2))),
357 T) /
358 8.;
359 else
360 throw std::runtime_error("Threshold Function FBFermiPiT is not implemented for given indices");
361 }
362
369 template <unsigned lev, typename NT1, typename NT2>
370 auto lB(const NT1 &mb2, const NT2 &etab, const double &k, const double &T, const double &d)
371 {
372 const auto pref = 2. / (d - 1.) * (1. - etab / (d + 1.)) * double(lev + (lev == 0));
373 return pref * B<lev + 1>(mb2, k, T);
374 }
375
382 template <unsigned lev, typename NT> auto lB(const NT &mb2, const double &k, const double &T, const double &d)
383 {
384 return lB<lev>(mb2, 0., k, T, d);
385 }
386
393 template <unsigned lev, typename NT1, typename NT2>
394 auto lF(const NT1 &mf2, const NT2 &etaf, const double &k, const double &T, const double &mu, const double &d)
395 {
396 const auto pref = 2. / (d - 1.) * (1. - etaf / d) * double(lev + (lev == 0));
397 return pref * F<lev + 1>(mf2, k, T, mu);
398 }
399
406 template <unsigned lev, typename NT>
407 auto lF(const NT &mf2, const double &k, const double &T, const double &mu, const double &d)
408 {
409 return lF<lev>(mf2, 0., k, T, mu, d);
410 }
411
421 template <unsigned levf, unsigned levb, typename NT, typename NT1, typename NT2, typename NT3, typename NT4>
422 NT LFB(const NT1 &mf2, const NT2 &mb2, const NT3 &etaf, const NT4 &etab, const double &k, const double &T,
423 const double &mu, const double &d)
424 {
425 const auto pref = 2. / (d - 1.);
426 const auto preff = (1. - etaf / d);
427 const auto prefb = (1. - etab / (d + 1));
428 if constexpr (levb == 1 && levf == 1)
429 return pref *
430 (preff * FBFermiPiT<2, 1, NT>(mf2, mb2, k, T, mu) + prefb * FBFermiPiT<1, 2, NT>(mf2, mb2, k, T, mu));
431 else
432 throw std::runtime_error("Threshold function not implemented.");
433 }
434
443 template <unsigned levf, unsigned levb, typename NT, typename NT1, typename NT2>
444 auto LFB(const NT1 &mf2, const NT2 &mb2, const double &k, const double &T, const double &mu, const double &d)
445 {
446 return LFB<levf, levb, NT>(mf2, mb2, 0., 0., k, T, mu, d);
447 }
448 } // namespace TFLitimSpatial
449 } // namespace fRG
450} // namespace DiFfRG
NT F(const NT &mf2, const double &k, const double &T, const double &mu)
Definition litim.hh:50
NT B(const NT &mb2, const double &k, const double &T)
Definition litim.hh:21
auto lB(const NT1 &mb2, const NT2 &etab, const double &k, const double &T, const double &d)
Definition litim.hh:370
NT FBFermiPiT(const NTf &mf2, const NTb &mb2, const double &k, const double &T, const double &mu)
Definition litim.hh:100
NT BB(const NT1 &mb12, const NT2 &mb22, const double &k, const double &T)
Definition litim.hh:82
auto lF(const NT1 &mf2, const NT2 &etaf, const double &k, const double &T, const double &mu, const double &d)
Definition litim.hh:394
NT LFB(const NT1 &mf2, const NT2 &mb2, const NT3 &etaf, const NT4 &etab, const double &k, const double &T, const double &mu, const double &d)
Definition litim.hh:422
Definition complex_math.hh:14
constexpr __forceinline__ __host__ __device__ NumberType powr(const NumberType x)
A compile-time evaluatable power function for whole number exponents.
Definition math.hh:45
auto __forceinline__ __device__ __host__ CothFiniteT(const T1 x, const T2 T)
Definition thermodynamics.hh:30
auto __forceinline__ __device__ __host__ Cosh(const T x)
Definition thermodynamics.hh:17
auto __forceinline__ __device__ __host__ Sech(const T x)
Definition thermodynamics.hh:21
bool __forceinline__ __host__ __device__ is_close(T1 a, T2 b, T3 eps_)
Function to evaluate whether two floats are equal to numerical precision. Tests for both relative and...
Definition math.hh:160
auto __forceinline__ __device__ __host__ TanhFiniteT(const T1 x, const T2 T)
Definition thermodynamics.hh:37
auto __forceinline__ __device__ __host__ CschFiniteT(const T1 x, const T2 T)
Definition thermodynamics.hh:52
auto __forceinline__ __device__ __host__ SechFiniteT(const T1 x, const T2 T)
Definition thermodynamics.hh:44
auto __forceinline__ __device__ __host__ Sinh(const T x)
Definition thermodynamics.hh:18
auto __forceinline__ __device__ __host__ Tanh(const T x)
Definition thermodynamics.hh:19