FocusedLogCoordinates1D< NT > Class Template Reference#
|
DiFfRG
Discretization Framework for functional Renormalization Group flows
|
Logarithmic coordinates which cluster grid points around an interior scale. More...
#include <coordinates.hh>
Public Types | |
| using | ctype = NT |
Public Member Functions | |
| FocusedLogCoordinates1D (size_t grid_extent, NT start, NT stop, NT center, NT focus) | |
| Construct a new FocusedLogCoordinates1D object. | |
| template<typename NT2 > | |
| FocusedLogCoordinates1D (const FocusedLogCoordinates1D< NT2 > &other) | |
| device::array< size_t, 1 > KOKKOS_FORCEINLINE_FUNCTION | from_linear_index (size_t i) const |
| template<typename IT > | |
| NT KOKKOS_FORCEINLINE_FUNCTION | forward (const IT &x) const |
| Transform from the grid to the physical space. | |
| template<typename IT > | |
| device::array< NT, 1 > KOKKOS_FORCEINLINE_FUNCTION | forward (const device::array< IT, 1 > &x) const |
| NT KOKKOS_FORCEINLINE_FUNCTION | backward (const NT &y) const |
| Transform from the physical space to the grid. | |
| NT KOKKOS_FORCEINLINE_FUNCTION | backward_derivative (const NT &y) const |
| size_t KOKKOS_FORCEINLINE_FUNCTION | size () const |
| device::array< size_t, 1 > KOKKOS_FORCEINLINE_FUNCTION | sizes () const |
| std::string | to_string () const |
Public Attributes | |
| const NT | start |
| const NT | stop |
| const NT | center |
| const NT | focus |
Static Public Attributes | |
| static constexpr size_t | dim = 1 |
Private Member Functions | |
| NT KOKKOS_FORCEINLINE_FUNCTION | s_of_u (const NT u) const |
| asinh(c * (u - u0)), written out to pick the cancellation-free branch. | |
Static Private Member Functions | |
| static std::string | round_trip (const NT value) |
| Format a parameter with the fewest digits that still identify it uniquely. | |
Private Attributes | |
| const size_t | grid_extent |
| NT | u0 |
| NT | s_min |
| NT | a |
| NT | a_inv |
| NT | c |
| NT | c_inv |
| NT | g_min |
| bool | pure_log |
Friends | |
| template<typename NT2 > | |
| bool | operator== (const FocusedLogCoordinates1D< NT > &lhs, const FocusedLogCoordinates1D< NT2 > &rhs) |
Detailed Description
requires std::is_floating_point_v<NT>
class DiFfRG::FocusedLogCoordinates1D< NT >
Logarithmic coordinates which cluster grid points around an interior scale.
In contrast to LogarithmicCoordinates1D, whose single bias knob can only pack points towards start, this coordinate spends its resolution around a freely chosen center and lets it fall off smoothly to both sides. That is what is needed when the interesting structure sits at an intermediate scale – e.g. the ~1 GeV peak of a gluon dressing on a grid spanning 0.005 to 250 GeV – while the deep IR and the deep UV are flat.
The construction works in u = log(p) and stretches it with a sinh, the standard interior-point clustering map. With u0 = log(center) and c = focus,
forward: u(s) = u0 + sinh(s) / c, s = s_min + a * i uniform in the index backward: s(u) = asinh(c * (u - u0))
where s_min = s(log(start)) and a = (s(log(stop)) - s_min) / (grid_extent - 1). forward(0) returns start exactly and forward(grid_extent - 1) returns stop to a few ulp, which matters for the common idiom of pairing grid element 0 with start directly rather than going through forward(). The node density is dindex/du ~ 1 / sqrt(1 + c^2 (u - u0)^2), i.e. peaked at center and decaying like 1/(c |u - u0|), so resolution is redistributed smoothly rather than cut off at the edge of a window.
focus == 0 reproduces a pure logarithmic (geometric) grid; larger values cluster harder. As a calibration point, 64 points on [0.005, 250] with center = 1 and focus = 2 give a cell width of 0.021 decades at the center and 32 points in [0.3, 3], against 0.076 decades and 13 points for LogarithmicCoordinates1D with bias = 11 on the same interval.
center outside [start, stop] is allowed and degenerates to a one-sided stretch.
Member Typedef Documentation
◆ ctype
| using DiFfRG::FocusedLogCoordinates1D< NT >::ctype = NT |
Constructor & Destructor Documentation
◆ FocusedLogCoordinates1D() [1/2]
|
inline |
Construct a new FocusedLogCoordinates1D object.
- Parameters
-
grid_extent number of grid points, must be at least 2 start first grid point, must be positive stop last grid point, must be larger than start center the scale to cluster around, in the same units as start and stop focus clustering strength; 0 gives a pure logarithmic grid
◆ FocusedLogCoordinates1D() [2/2]
|
inline |
Member Function Documentation
◆ backward()
|
inline |
Transform from the physical space to the grid.
- Parameters
-
y physical coordinate
- Returns
- double grid coordinate
◆ backward_derivative()
|
inline |
◆ forward() [1/2]
|
inline |
◆ forward() [2/2]
|
inline |
Transform from the grid to the physical space.
- Parameters
-
x grid coordinate
- Returns
- NumberType physical coordinate
◆ from_linear_index()
|
inline |
◆ round_trip()
|
inlinestaticprivate |
Format a parameter with the fewest digits that still identify it uniquely.
to_string() is the identity key of a coordinate dataset in HDF5 output, and the key that HDF5Input::load_map compares against, so two grids that differ must render differently. std::to_string would not do: it emits six decimals, under which every start below 1e-6 – a perfectly ordinary IR cutoff here – renders as "0.000000" and distinct grids would silently share one dataset. Widening the precision until the text parses back to the original value keeps the common cases readable ("0.005", not "0.0050000000000000001") while still separating values that genuinely differ.
◆ s_of_u()
|
inlineprivate |
asinh(c * (u - u0)), written out to pick the cancellation-free branch.
Naively log(v + sqrt(v^2 + 1)) cancels catastrophically for v << 0 – these grids reach v ~ -40, where it loses several digits. Using (v + D)(D - v) = 1 to rewrite the negative branch as -log(D - v) makes both sides exact to round-off. Note this is called from the constructor, so it may only use members assigned before it.
◆ size()
|
inline |
◆ sizes()
|
inline |
◆ to_string()
|
inline |
Friends And Related Symbol Documentation
◆ operator==
|
friend |
Member Data Documentation
◆ a
|
private |
◆ a_inv
|
private |
◆ c
|
private |
◆ c_inv
|
private |
◆ center
| const NT DiFfRG::FocusedLogCoordinates1D< NT >::center |
◆ dim
|
staticconstexpr |
◆ focus
| const NT DiFfRG::FocusedLogCoordinates1D< NT >::focus |
◆ g_min
|
private |
◆ grid_extent
|
private |
◆ pure_log
|
private |
◆ s_min
|
private |
◆ start
| const NT DiFfRG::FocusedLogCoordinates1D< NT >::start |
◆ stop
| const NT DiFfRG::FocusedLogCoordinates1D< NT >::stop |
◆ u0
|
private |
The documentation for this class was generated from the following file:
- /home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/discretization/coordinates/coordinates.hh
Generated by