Integrator_fT_p2< dim, NT, KERNEL, ExecutionSpace > Class Template Reference#

DiFfRG: Integrator_fT_p2< dim, NT, KERNEL, ExecutionSpace > Class Template Reference
DiFfRG
Discretization Framework for functional Renormalization Group flows
Integrator_fT_p2< dim, NT, KERNEL, ExecutionSpace > Class Template Reference

Integrates a kernel at temperature \(T\) when it depends on the frequency and on \(|q|\) of the spatial momentum. More...

#include <integrator_fT_p2.hh>

Inheritance diagram for Integrator_fT_p2< dim, NT, KERNEL, ExecutionSpace >:

Public Types

using ctype = typename get_type::ctype<NT>
 Numerical type to be used for integration tasks e.g. the argument or possible jacobians.
 
using execution_space = ExecutionSpace
 Execution space to be used for the integration, e.g. GPU_exec, TBB_exec.
 
- Public Types inherited from QuadratureIntegrator_fT< 2, NT, internal::Transform_fT_p2< dim, NT, KERNEL >, ExecutionSpace >
using ctype
 Type of the integration variables: NT with complex and autodiff parts stripped, e.g. double.
 
using execution_space
 The execution space the integrand is evaluated in.
 

Public Member Functions

void apply_matsubara_overrides (const ConfigTree &config)
 Apply the optional Matsubara settings from the parameter file.
 
 Integrator_fT_p2 (QuadratureProvider &quadrature_provider, const ConfigTree &config)
 Construct from the parameter file.
 
 Integrator_fT_p2 (QuadratureProvider &quadrature_provider, const std::array< size_t, 1 > grid_size, ctype x_extent=2., ctype T=1, ctype k=1)
 
void set_x_extent (ctype x_extent)
 Set \(x_\text{extent}\), so that \(q_\text{max} = \sqrt{x_\text{extent}}\, k\).
 
void set_k (ctype k)
 Set the RG scale \(k\): moves \(q_\text{max}\) and sets the default energy scale of the Matsubara rule.
 
void set_typical_E (ctype typical_E)
 Set the energy scale the Matsubara rule is built around, replacing \(k\). Zero means: use \(k\).
 
- Public Member Functions inherited from QuadratureIntegrator_fT< 2, NT, internal::Transform_fT_p2< dim, NT, KERNEL >, ExecutionSpace >
 QuadratureIntegrator_fT (QuadratureProvider &quadrature_provider, const std::array< size_t, sdim > _grid_size, std::array< ctype, sdim > grid_min, std::array< ctype, sdim > grid_max, const std::array< QuadratureType, sdim > quadrature_type, const ctype T=1, const ctype k=1)
 
void set_grid_extents (const std::array< ctype, sdim > grid_min, const std::array< ctype, sdim > grid_max)
 Change the box, keeping the quadrature rules; see QuadratureIntegrator::set_grid_extents.
 
void set_T (const ctype T)
 Set the temperature and rebuild the frequency rule.
 
void set_k (const ctype k)
 Set the RG scale \(k\), the scale the frequency rule is sized for unless set_typical_E() was given one.
 
void set_typical_E (const ctype typical_E)
 Set the energy scale the frequency rule is sized for, replacing \(k\). Zero (default) means \(k\).
 
void set_frequency_cutoff (const ctype freq_cutoff)
 Set the frequency \(\Lambda_0\) above which the summand vanishes, enabling the exact sum.
 
void set_allow_exact_matsubara_sum (const bool allow)
 Allow (or forbid) the exact sum regardless of the kernel's traits.
 
void set_matsubara_extent_margin (const ctype margin)
 Sum exactly up to margin times the frequency cutoff, plus one mode \(2\pi T\). Default 1.
 
size_t get_matsubara_size () const
 Nodes on the frequency axis, INCLUDING the zero mode.
 
bool uses_exact_matsubara_sum () const
 True if the frequency axis is currently the exact sum rather than a Gaussian quadrature rule.
 
void set_pre_table_reuse (const bool reuse)
 Turn reuse of the pre() table across calls on or off (default on); see kernel_has_pre.
 
void fill_pre_table (ExecutionSpace &space, PT *table, const PosArr &pos, const ArgTuple &args) const
 
void fill_pre_table_points (PT *table, const DeviceArgs &device_args)
 fill_pre_table() for map_points(). Public for the same reason.
 
void get (NT &dest, const T &...t) const
 Compute the integral for the extra kernel arguments t and write it to dest.
 
void get (OT &dest, const T &...t) const
 Single-precision integration handing back a double result.
 
void get (OT &dest, const T &...t) const
 Compute the integral into a Kokkos reduction target dest (e.g. a rank-0 View) without waiting.
 
void get (ExecutionSpace &space, OT &dest, const Args &...t) const
 Launch the integral on space into a Kokkos reduction target dest without waiting.
 
void map (ExecutionSpace &space, const view_type integral_view, const Coordinates &coordinates, const Args &...args)
 
auto map (OT *dest, const Coordinates &coordinates, const Args &...args)
 Compute the integral at every point of a grid of external values; see QuadratureIntegrator::map.
 
auto map (const std::array< OT *, N > &dest, const Coordinates &coordinates, const Args &...args)
 map() for a kernel returning MultiValue<T, N>: component j of every integral lands in dest[j].
 
auto map (OT *const(&dest)[N], const Coordinates &coordinates, const Args &...args)
 map() into MultiValue destinations given as a braced list: map({&a[0], &b[0]}, coordinates, args...).
 
size_t quadrature_volume () const
 Number of quadrature points, i.e. kernel evaluations per integral (frequency nodes included).
 
void map_points (const PointSpan< OT > dest, const A &...args)
 Evaluate the integral at dest.size() points in a single launch; see QuadratureIntegrator::map_points. The frequency rule (Matsubara sum, exact sum or vacuum integral) is the one get() uses, i.e. the one chosen for the current T, k and typical_E: it is shared by all points.
 
void map_points (const std::array< PointSpan< OT >, N > &dest, const A &...args)
 map_points() for a kernel returning MultiValue<T, N>: component j of every integral lands in dest[j].
 
void set_map_points_policy (const MapPointsPolicy policy)
 How a device map_points() distributes its work; see MapPointsPolicy.
 
void launch_map_points_hoisted (const ResultView &result, const size_t n, const DeviceArgs &device_args, const PT *table)
 
void launch_map_points (const ResultView &result, const size_t n, const DeviceArgs &device_args)
 
auto map_dist (OT *dest, const Coordinates &coordinates, const Args &...args)
 map() without the MapScheduler: computes the whole of coordinates on this rank.
 
auto map_dist (const std::array< OT *, N > &dest, const Coordinates &coordinates, const Args &...args)
 map_dist() for MultiValue destinations.
 
- Public Member Functions inherited from AbstractIntegrator
 AbstractIntegrator ()
 
KOKKOS_FORCEINLINE_FUNCTION size_t integrator_id () const
 Stable, rank-independent identity of this integrator.
 

Additional Inherited Members

- Static Public Member Functions inherited from QuadratureIntegrator_fT< 2, NT, internal::Transform_fT_p2< dim, NT, KERNEL >, ExecutionSpace >
static KOKKOS_INLINE_FUNCTION NT node_value (const XArr &x, const PosArr &pos, const ArgTuple &args, const ctype xt, const ctype wt, const bool is_tail)
 One Matsubara node's contribution at one spatial point, weight excluded.
 
static KOKKOS_INLINE_FUNCTION auto pre_value (const XArr &x, const ctype q0, const PosArr &pos, const ArgTuple &args)
 pre() at box point x and frequency q0; pos and args as in node_value().
 
static KOKKOS_INLINE_FUNCTION auto pre_value_points (const XArr &x, const ctype q0, const DeviceArgs &device_args)
 pre_value() with the arguments of map_points() point 0, whose per-point values pre() does not read.
 
static KOKKOS_INLINE_FUNCTION NT hoisted_node_value (const PT *entry, const XArr &x, const PosArr &pos, const ArgTuple &args, const ctype xt, const ctype wt)
 As node_value(), from the pre() table entries entry[0] (at +xt) and entry[1] (at -xt).
 
static KOKKOS_INLINE_FUNCTION device::array< ctype, sdim > first_box_point (const size_t i0, const NodeArr &n, const StartArr &start, const StartArr &scale)
 Box point with the first variable at node i0 and all others zero (pre() reads only the first).
 
- Static Public Attributes inherited from QuadratureIntegrator_fT< 2, NT, internal::Transform_fT_p2< dim, NT, KERNEL >, ExecutionSpace >
static constexpr int sdim
 Number of integration variables besides the frequency (not necessarily the physical spatial dimension).
 
static constexpr bool can_hoist
 Whether this kernel can be hoisted at all: pre() reads no box variable but the first.
 
- Protected Member Functions inherited from QuadratureIntegrator_fT< 2, NT, internal::Transform_fT_p2< dim, NT, KERNEL >, ExecutionSpace >
size_t pre_table_entries () const
 Number of pre() table rows: first box nodes times frequency nodes.
 
PT * pre_table_storage () const
 Storage for the pre() table with entries of type PT.
 
std::string pre_table_key (const size_t first, const A &...rest) const
 
const PT * prepare_pre_table (ExecutionSpace &space, const PosArr &pos, const ArgTuple &args, const size_t first, const A &...rest) const
 The pre() table for kernel() parameters rest (see pre_table_key()), rebuilt on space if stale.
 
- Protected Attributes inherited from QuadratureIntegrator_fT< 2, NT, internal::Transform_fT_p2< dim, NT, KERNEL >, ExecutionSpace >
ExecutionSpace space
 
QuadratureProvider & quadrature_provider
 
device::array< device::array< ctype, sdim >, 2 > grid_extents
 
device::array< ctype, sdim > grid_start
 
device::array< ctype, sdim > grid_scale
 
device::array< size_t, dim > grid_size
 
device::array< Kokkos::View< const ctype *, typename ExecutionSpace::memory_space >, sdim > nodes
 
device::array< Kokkos::View< const ctype *, typename ExecutionSpace::memory_space >, sdim > weights
 
ctype T
 
ctype m_k
 The RG scale, which is the frequency scale unless the model set one; see set_k().
 
ctype m_typical_E_user
 The model's heaviest scale, or zero if it never said; see set_typical_E().
 
ctype m_freq_cutoff
 Support boundary in frequency; zero means "unknown", which disables the exact sum.
 
size_t m_n_tail
 Nodes before the boundary of the concatenated axis of a split kernel; 0 when not split.
 
Kokkos::View< ctype *, typename ExecutionSpace::memory_space > m_split_nodes
 
Kokkos::View< ctype *, typename ExecutionSpace::memory_space > m_split_weights
 
bool m_allow_exact
 
bool m_using_exact
 
ctype m_extent_margin
 
Kokkos::View< const ctype *, typename ExecutionSpace::memory_space > matsubara_nodes
 
Kokkos::View< const ctype *, typename ExecutionSpace::memory_space > matsubara_weights
 
KokkosNDView< 1+dim, NT, ExecutionSpace > m_cache
 
device::array< size_t, 1+dim > m_cache_extents
 
Kokkos::View< ctype *, typename ExecutionSpace::memory_space > m_positions
 
std::string m_positions_key
 
internal::MapStagingSet< NT, ExecutionSpace > m_staging
 
internal::MapPointsBuffers< NT, ExecutionSpace > m_map_points
 
MapPointsPolicy m_map_points_policy
 
Kokkos::View< NT, typename ExecutionSpace::memory_space > m_result_view
 
Kokkos::View< NT, typenameExecutionSpace::memory_space >::host_mirror_type m_result_host
 
bool m_result_views_initialized
 
internal::PreTable< ExecutionSpace > m_pre_table
 
- Protected Attributes inherited from AbstractIntegrator
size_t m_integrator_id
 

Detailed Description

template<int dim, typename NT, typename KERNEL, typename ExecutionSpace>
requires (dim >= 2)
class DiFfRG::Integrator_fT_p2< dim, NT, KERNEL, ExecutionSpace >

Integrates a kernel at temperature \(T\) when it depends on the frequency and on \(|q|\) of the spatial momentum.

In \(d\) spacetime dimensions (so \(d-1\) spatial ones),

\[ I = \texttt{constant}(\ldots) + T \sum_{n\in\mathbb{Z}} \frac{S_{d-1}}{(2\pi)^{d-1}} \int_0^{q_\text{max}} dq\, q^{d-2}\, K(q, \omega_n, \ldots)\,, \]

where \(\omega_n = 2\pi n T\) are the bosonic Matsubara frequencies; a fermionic kernel shifts its frequency argument itself. At \(T = 0\), or when the sum would need too many modes, the sum is replaced by the integral \(\int \frac{dq_0}{2\pi}\). \(S_{d-1} = 2\pi^{(d-1)/2}/\Gamma((d-1)/2)\) is the surface of the unit sphere in \(d-1\) dimensions. Here \(q_\text{max} = \sqrt{x_\text{extent}}\, k\), with \(x_\text{extent}\) in units of \(k^2\) and the RG scale \(k\) set by set_k() (initially the constructor argument k, default 1).

If the kernel declares static constexpr bool matsubara_finite_extent = true (its summand vanishes for \(|\omega_n| > q_\text{max}\)), the finitely many contributing modes are summed exactly whenever that is cheaper than the approximate rule.

The _p2 in the name is historical: the kernel receives \(|q|\), not \(q^2\).

Kernel interface:

  • get(): KERNEL::kernel(q, q0, args...) and KERNEL::constant(args...)
  • map(): KERNEL::kernel(q, q0, pos..., args...) and KERNEL::constant(pos..., args...)
See also
QuadratureIntegrator for the kernel interface, QuadratureIntegrator_fT for the frequency rule.

Example:

struct MyKernel {
using Regulator = DiFfRG::LitimRegulator<>; // needed by the ConfigTree constructor
static KOKKOS_FORCEINLINE_FUNCTION double kernel(const double q, const double q0, const double k,
const double m2)
{
const double q2 = q * q, k2 = k * k;
return Regulator::RBdot(k2, q2) / DiFfRG::powr<2>(q0 * q0 + q2 + Regulator::RB(k2, q2) + m2);
}
static KOKKOS_FORCEINLINE_FUNCTION double constant(const double, const double) { return 0.; }
};
integrator.set_T(T);
integrator.set_k(k); // on every RG step
double result;
integrator.get(result, k, m2);
Integrates a kernel at temperature when it depends on the frequency and on of the spatial momentum.
Definition integrator_fT_p2.hh:148
QuadratureProvider & quadrature_provider
Definition quadrature_integrator_fT.hh:1236
@ config
/discretization/threads, or an explicit set_thread_limit(unsigned int).
constexpr KOKKOS_INLINE_FUNCTION NumberType powr(const NumberType x)
for an integer exponent known at compile time, by repeated squaring.
Definition math.hh:58
The Litim (flat) regulator.
Definition regulators.hh:52
Template Parameters
dimspacetime dimension \(d \geq 2\)
NTnumerical type of the result
KERNELkernel to be integrated, providing static kernel and constant
ExecutionSpaceGPU_exec, TBB_exec or KokkosHost_exec

Member Typedef Documentation

◆ ctype

template<int dim, typename NT , typename KERNEL , typename ExecutionSpace >
using ctype = typename get_type::ctype<NT>

Numerical type to be used for integration tasks e.g. the argument or possible jacobians.

◆ execution_space

template<int dim, typename NT , typename KERNEL , typename ExecutionSpace >
using execution_space = ExecutionSpace

Execution space to be used for the integration, e.g. GPU_exec, TBB_exec.

Constructor & Destructor Documentation

◆ Integrator_fT_p2() [1/2]

template<int dim, typename NT , typename KERNEL , typename ExecutionSpace >
Integrator_fT_p2 ( QuadratureProvider & quadrature_provider,
const ConfigTree & config )
inline

Construct from the parameter file.

Reads the quadrature order /integration/x_order, the temperature /physical/T (default 1) and the settings of apply_matsubara_overrides(), and finds \(x_\text{extent}\) with optimize_x_extent() for KERNEL::Regulator.

◆ Integrator_fT_p2() [2/2]

template<int dim, typename NT , typename KERNEL , typename ExecutionSpace >
Integrator_fT_p2 ( QuadratureProvider & quadrature_provider,
const std::array< size_t, 1 > grid_size,
ctype x_extent = 2.,
ctype T = 1,
ctype k = 1 )
inline
Parameters
quadrature_providersource of the quadrature rules
grid_sizenumber of quadrature points per spatial axis, in the order of the kernel arguments
x_extentupper limit of the radial integral, \(q_\text{max}^2 / k^2\)
Ttemperature
kinitial RG scale

Member Function Documentation

◆ apply_matsubara_overrides()

template<int dim, typename NT , typename KERNEL , typename ExecutionSpace >
void apply_matsubara_overrides ( const ConfigTree & config)
inline

Apply the optional Matsubara settings from the parameter file.

  • /integration/force_exact_matsubara_sum (bool): allow (true) or forbid (false) the exact frequency sum, overriding the kernel's traits; see set_allow_exact_matsubara_sum(). Allowing it for a summand that does not vanish above \(q_\text{max}\) truncates the sum.
  • /integration/matsubara_extent_margin (double): factor on the frequency cutoff \(q_\text{max}\) of the exact sum.

◆ set_k()

template<int dim, typename NT , typename KERNEL , typename ExecutionSpace >
void set_k ( ctype k)
inline

Set the RG scale \(k\): moves \(q_\text{max}\) and sets the default energy scale of the Matsubara rule.

◆ set_typical_E()

template<int dim, typename NT , typename KERNEL , typename ExecutionSpace >
void set_typical_E ( ctype typical_E)
inline

Set the energy scale the Matsubara rule is built around, replacing \(k\). Zero means: use \(k\).

◆ set_x_extent()

template<int dim, typename NT , typename KERNEL , typename ExecutionSpace >
void set_x_extent ( ctype x_extent)
inline

Set \(x_\text{extent}\), so that \(q_\text{max} = \sqrt{x_\text{extent}}\, k\).


The documentation for this class was generated from the following file:
  • /home/runner/work/DiFfRG/DiFfRG/DiFfRG/include/DiFfRG/physics/integration/finiteT/integrator_fT_p2.hh