/__w/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/physics/integration/vacuum/integrator_p2_1ang.hh Source File#

DiFfRG: /__w/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/physics/integration/vacuum/integrator_p2_1ang.hh Source File
DiFfRG
Discretization Framework for functional Renormalization Group flows
integrator_p2_1ang.hh
Go to the documentation of this file.
1#pragma once
2
3// DiFfRG
6
7// standard libraries
8#include <array>
9
10namespace DiFfRG
11{
12 namespace internal
13 {
14 template <int dim, typename NT, typename KERNEL> class Transform_p2_1ang
15 {
16 public:
17 using ctype = typename get_type::ctype<NT>;
18
19 // The polar angle (loop vs. external momentum) of a 2-point loop in d dims carries the zonal
20 // measure (1-c^2)^{(d-3)/2} dc, supplied by the Gauss-Jacobi(alpha=beta=(d-3)/2) angular
21 // quadrature (see the class below). The remaining (d-2)-sphere gives S_{d-2} = S_d_prec(dim-1).
22 static constexpr ctype int_prefactor = S_d_prec<ctype>(dim - 1) // remaining solid angle after the polar angle
23 / powr<dim>(2 * (ctype)M_PI); // fourier factor
24
25 template <typename... T>
26 static KOKKOS_FORCEINLINE_FUNCTION NT kernel(const ctype q, const ctype cos, const T &...t)
27 requires provides_kernel<NT, KERNEL, ctype, 2, T...>
28 {
29 using namespace DiFfRG::compute;
30
31 const ctype int_element = powr<dim - 1>(q); // from p integral
32 const NT result = KERNEL::kernel(q, cos, t...);
33
34 return int_prefactor * int_element * result;
35 }
36
37 template <typename... T>
38 static KOKKOS_FORCEINLINE_FUNCTION NT constant(const T &...t)
39 requires provides_constant<NT, KERNEL, T...>
40 {
41 return KERNEL::constant(t...);
42 }
43 };
44
45 } // namespace internal
46
62 template <int dim, typename NT, typename KERNEL, typename ExecutionSpace>
64 : public QuadratureIntegrator<2, NT, internal::Transform_p2_1ang<dim, NT, KERNEL>, ExecutionSpace>
65 {
67
68 // Gauss-Jacobi quadrature on [-1,1] with weight (1-c^2)^{(d-3)/2} for the polar angle.
69 // Dimension-agnostic: reduces to Chebyshev-1 (d=2), Legendre (d=3), Chebyshev-2 (d=4), ...
71 {
73 t.a = static_cast<double>(-1);
74 t.b = static_cast<double>(1);
75 t.alpha = (static_cast<double>(dim) - 3.) / 2.;
76 t.beta = t.alpha;
77 return t;
78 }
79
80 public:
84 using ctype = typename get_type::ctype<NT>;
88 using execution_space = ExecutionSpace;
89
92 : Integrator_p2_1ang(quadrature_provider, internal::make_int_grid<2, NT>(json, {"x_order", "cos1_order"}),
93 optimize_x_extent<typename KERNEL::Regulator>(json))
94 {
95 }
96
104
106 {
107 this->x_extent = x_extent;
108 Base::set_grid_extents({0, 0.}, {std::sqrt(x_extent) * k, 1.});
109 }
110
112 {
113 this->k = k;
114 Base::set_grid_extents({0, 0.}, {std::sqrt(x_extent) * k, 1.});
115 }
116
117 private:
120 };
121} // namespace DiFfRG
Integrator_p2_1ang integrates a kernel depending on the radial momentum and the cosine of the singl...
Definition integrator_p2_1ang.hh:65
void set_x_extent(ctype x_extent)
Definition integrator_p2_1ang.hh:105
Integrator_p2_1ang(QuadratureProvider &quadrature_provider, const JSONValue &json)
Definition integrator_p2_1ang.hh:90
typename get_type::ctype< NT > ctype
Numerical type to be used for integration tasks e.g. the argument or possible jacobians.
Definition integrator_p2_1ang.hh:84
ctype k
Definition integrator_p2_1ang.hh:119
ctype x_extent
Definition integrator_p2_1ang.hh:118
static QuadratureType polar_quadrature()
Definition integrator_p2_1ang.hh:70
Integrator_p2_1ang(QuadratureProvider &quadrature_provider, const std::array< size_t, 2 > grid_size, ctype x_extent=2.)
Definition integrator_p2_1ang.hh:97
ExecutionSpace execution_space
Execution space to be used for the integration, e.g. GPU_exec, TBB_exec.
Definition integrator_p2_1ang.hh:88
void set_k(ctype k)
Definition integrator_p2_1ang.hh:111
A wrapper around the boost json value class.
Definition json.hh:19
This class performs numerical integration over a d-dimensional hypercube using quadrature rules.
Definition quadrature_integrator.hh:27
void set_grid_extents(const std::array< ctype, dim > &grid_min, const std::array< ctype, dim > &grid_max)
Definition quadrature_integrator.hh:54
device::array< size_t, dim > grid_size
Definition quadrature_integrator.hh:294
A class that provides quadrature points and weights, in host and device memory. The quadrature points...
Definition quadrature_provider.hh:137
Definition integrator_p2_1ang.hh:15
static KOKKOS_FORCEINLINE_FUNCTION NT kernel(const ctype q, const ctype cos, const T &...t)
Definition integrator_p2_1ang.hh:26
static constexpr ctype int_prefactor
Definition integrator_p2_1ang.hh:22
typename get_type::ctype< NT > ctype
Definition integrator_p2_1ang.hh:17
static KOKKOS_FORCEINLINE_FUNCTION NT constant(const T &...t)
Definition integrator_p2_1ang.hh:38
Definition abstract_integrator.hh:46
Definition abstract_integrator.hh:42
Definition abstract_integrator.hh:28
Definition math.hh:220
typename internal::_ctype< CT >::value ctype
Definition types.hh:134
Definition complex_math.hh:10
constexpr KOKKOS_INLINE_FUNCTION NumberType powr(const NumberType x)
A compile-time evaluatable power function for whole number exponents.
Definition math.hh:41
Definition quadrature.hh:44
double a
Definition quadrature.hh:47
double beta
Definition quadrature.hh:48
@ jacobi
Definition quadrature.hh:45
@ legendre
Definition quadrature.hh:45
double alpha
Definition quadrature.hh:48
double b
Definition quadrature.hh:47