MatsubaraQuadrature< NT > Class Template Reference#
|
DiFfRG
|
A quadrature rule for (bosonic) Matsubara frequencies, based on the method of Monien [1]. This class provides nodes and weights for the summation. More...
#include <matsubara.hh>
Public Member Functions | |
| int | predict_size (const NT T, const NT typical_E=1., const int step=2) |
| Calculate the number of nodes needed for a given temperature and typical energy scale. | |
| MatsubaraQuadrature (const NT T, const NT typical_E=1., const int step=2, const int min_size=0, const int max_size=256, const int vacuum_quad_size=48, const int precision_factor=1) | |
| Create a new quadrature rule for Matsubara frequencies. | |
| MatsubaraQuadrature () | |
| void | reinit (const NT T, const NT typical_E=1., const int step=2, const int min_size=0, const int max_size=256, const int vacuum_quad_size=48, const int precision_factor=1) |
| Update the quadrature rule with new parameters. | |
| size_t | size () const |
| Get the size of the quadrature rule. | |
| NT | get_T () const |
| Get the temperature of the quadrature rule. | |
| NT | get_typical_E () const |
| Get the typical energy scale of the quadrature rule. | |
| template<typename F > | |
| auto | sum (const F &f) const |
| Compute a matsubara sum of a given function. | |
| template<typename MemorySpace > | |
| Kokkos::View< const NT *, MemorySpace > | nodes () const |
| template<typename MemorySpace > | |
| Kokkos::View< const NT *, MemorySpace > | weights () const |
Private Member Functions | |
| void | write_data (const std::vector< NT > &x, const std::vector< NT > &w) |
| void | reinit_0 () |
| Construct a quadrature rule for T=0. | |
Private Attributes | |
| NT | T |
| NT | typical_E |
| Kokkos::View< NT *, GPU_memory > | device_nodes |
| Kokkos::View< NT *, GPU_memory > | device_weights |
| Kokkos::View< NT *, CPU_memory > | host_nodes |
| Kokkos::View< NT *, CPU_memory > | host_weights |
| int | m_size |
| The number of nodes in the quadrature rule. | |
| int | vacuum_quad_size |
| int | precision_factor |
Detailed Description
class DiFfRG::MatsubaraQuadrature< NT >
A quadrature rule for (bosonic) Matsubara frequencies, based on the method of Monien [1]. This class provides nodes and weights for the summation.
\[ T \sum_{n=\in \mathbb{Z}} f(2\pi n T) \approx \sum_{n=1}^{N} w_i (f(x_i) + f(-x_i)) + T f(0) \]
[1] H. Monien, "Gaussian quadrature for sums: a rapidly convergent summation scheme", Math. Comp. 79, 857 (2010). doi:10.1090/S0025-5718-09-02289-3
- Template Parameters
-
NT numeric type to be used for all calculations
Constructor & Destructor Documentation
◆ MatsubaraQuadrature() [1/2]
| DiFfRG::MatsubaraQuadrature< NT >::MatsubaraQuadrature | ( | const NT | T, |
| const NT | typical_E = 1., | ||
| const int | step = 2, | ||
| const int | min_size = 0, | ||
| const int | max_size = 256, | ||
| const int | vacuum_quad_size = 48, | ||
| const int | precision_factor = 1 ) |
Create a new quadrature rule for Matsubara frequencies.
- Parameters
-
T The temperature. typical_E A typical energy scale, which determines the number of nodes in the quadrature rule. step The step size of considered node sizes (e.g. step=2 implies only even numbers of nodes). min_size Minimum number of nodes. max_size Maximum number of nodes.
◆ MatsubaraQuadrature() [2/2]
| DiFfRG::MatsubaraQuadrature< NT >::MatsubaraQuadrature | ( | ) |
Member Function Documentation
◆ get_T()
| NT DiFfRG::MatsubaraQuadrature< NT >::get_T | ( | ) | const |
Get the temperature of the quadrature rule.
◆ get_typical_E()
| NT DiFfRG::MatsubaraQuadrature< NT >::get_typical_E | ( | ) | const |
Get the typical energy scale of the quadrature rule.
◆ nodes()
|
inline |
◆ predict_size()
| int DiFfRG::MatsubaraQuadrature< NT >::predict_size | ( | const NT | T, |
| const NT | typical_E = 1., | ||
| const int | step = 2 ) |
Calculate the number of nodes needed for a given temperature and typical energy scale.
- Parameters
-
T The temperature. typical_E A typical energy scale. step The step size of considered node sizes (e.g. step=2 implies only even numbers of nodes).
- Returns
- int The number of nodes needed. If the number is negative, the T=0-limit has been reached (usually if typical_E / T > 4.4e+2, which is 64 nodes).
◆ reinit()
| void DiFfRG::MatsubaraQuadrature< NT >::reinit | ( | const NT | T, |
| const NT | typical_E = 1., | ||
| const int | step = 2, | ||
| const int | min_size = 0, | ||
| const int | max_size = 256, | ||
| const int | vacuum_quad_size = 48, | ||
| const int | precision_factor = 1 ) |
Update the quadrature rule with new parameters.
- Parameters
-
T The temperature. typical_E A typical energy scale, which determines the number of nodes in the quadrature rule. step The step size of considered node sizes (e.g. step=2 implies only even numbers of nodes). min_size Minimum number of nodes. max_size Maximum number of nodes.
◆ reinit_0()
|
private |
Construct a quadrature rule for T=0.
◆ size()
| size_t DiFfRG::MatsubaraQuadrature< NT >::size | ( | ) | const |
Get the size of the quadrature rule.
◆ sum()
|
inline |
Compute a matsubara sum of a given function.
- Template Parameters
-
F The function type.
- Parameters
-
f The function to be summed. Must have signature NT f(NT x).
- Returns
- NT The Matsubara sum of the function.
◆ weights()
|
inline |
◆ write_data()
|
private |
Member Data Documentation
◆ device_nodes
|
private |
◆ device_weights
|
private |
◆ host_nodes
|
private |
◆ host_weights
|
private |
◆ m_size
|
private |
The number of nodes in the quadrature rule.
◆ precision_factor
|
private |
◆ T
|
private |
◆ typical_E
|
private |
◆ vacuum_quad_size
|
private |
The documentation for this class was generated from the following file:
- /home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/common/quadrature/matsubara.hh
Generated by