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=powr< 10 >(2), 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=powr< 10 >(2), const int vacuum_quad_size=48, const int precision_factor=1) |
Update the quadrature rule with new parameters. | |
const std::vector< NT > & | nodes () const |
Get the nodes of the quadrature rule. | |
const std::vector< NT > & | weights () const |
Get the weights of the quadrature rule. | |
int | 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. | |
const NT * | device_nodes () |
Return the device-side nodes of the quadrature rule. | |
const NT * | device_weights () |
Return the device-side weights of the quadrature rule. | |
Private Member Functions | |
void | move_device_data () |
Move the nodes and weights to the device, if they are not already there. | |
void | reinit_0 () |
Construct a quadrature rule for T=0. | |
Private Attributes | |
NT | T |
NT | typical_E |
std::vector< NT > | x |
Nodes of the quadrature rule. | |
std::vector< NT > | w |
Weights of the quadrature rule. | |
int | m_size |
The number of nodes in the quadrature rule. | |
thrust::device_vector< NT > | device_x |
Device-side nodes of the quadrature rule. | |
thrust::device_vector< NT > | device_w |
Device-side weights of the quadrature rule. | |
int | vacuum_quad_size |
int | precision_factor |
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
NT | numeric type to be used for all calculations |
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 = powr< 10 >(2), | ||
const int | vacuum_quad_size = 48, | ||
const int | precision_factor = 1 ) |
Create a new quadrature rule for Matsubara frequencies.
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. |
DiFfRG::MatsubaraQuadrature< NT >::MatsubaraQuadrature | ( | ) |
const NT * DiFfRG::MatsubaraQuadrature< NT >::device_nodes | ( | ) |
Return the device-side nodes of the quadrature rule.
const NT * DiFfRG::MatsubaraQuadrature< NT >::device_weights | ( | ) |
Return the device-side weights of the quadrature rule.
NT DiFfRG::MatsubaraQuadrature< NT >::get_T | ( | ) | const |
Get the temperature of the quadrature rule.
NT DiFfRG::MatsubaraQuadrature< NT >::get_typical_E | ( | ) | const |
Get the typical energy scale of the quadrature rule.
|
private |
Move the nodes and weights to the device, if they are not already there.
const std::vector< NT > & DiFfRG::MatsubaraQuadrature< NT >::nodes | ( | ) | const |
Get the nodes of the quadrature rule.
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.
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). |
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 = powr< 10 >(2), | ||
const int | vacuum_quad_size = 48, | ||
const int | precision_factor = 1 ) |
Update the quadrature rule with new 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. |
|
private |
Construct a quadrature rule for T=0.
int DiFfRG::MatsubaraQuadrature< NT >::size | ( | ) | const |
Get the size of the quadrature rule.
|
inline |
Compute a matsubara sum of a given function.
F | The function type. |
f | The function to be summed. Must have signature NT f(NT x). |
const std::vector< NT > & DiFfRG::MatsubaraQuadrature< NT >::weights | ( | ) | const |
Get the weights of the quadrature rule.
|
private |
Device-side weights of the quadrature rule.
|
private |
Device-side nodes of the quadrature rule.
|
private |
The number of nodes in the quadrature rule.
|
private |
|
private |
|
private |
|
private |
|
private |
Weights of the quadrature rule.
|
private |
Nodes of the quadrature rule.