HILA
|
#include <spectraldensity.h>
Public Member Functions | |
k_binning & | bins (int n) |
Set number of bins in histogram. | |
k_binning & | k_max (double km) |
Max value of k. | |
k_binning & | power (double p) |
Bin quantity k^p. | |
k_binning & | exact_bins (int e) |
Bin exactly this many bins. | |
template<typename T > | |
std::vector< T > | bin_k_field (const Field< T > &f) |
Generic k-space field binner routine - returns field element type vector. | |
template<typename T > | |
std::vector< double > | bin_k_field_squarenorm (const Field< T > &f) |
sum up the square norm of all elements | |
template<typename T , std::enable_if_t< hila::contains_complex< T >::value, int > = 0> | |
std::vector< double > | spectraldensity (const Field< T > &f) |
template<typename T , std::enable_if_t<!hila::contains_complex< T >::value, int > = 0> | |
std::vector< double > | spectraldensity (const Field< T > &f) |
interface for real fields - an extra copy which could be avoided | |
void | sd_calculate_bin_info () |
double | k (int i) |
Get the average k-value of bin i. | |
long | count (int i) |
get the count of points within bin i | |
double | bin_min (int i) |
class hila::k_binning is used to bin "k-space" fields (typically fourier transformed from real space). Vector k is normalized so that -pi < k_i <= pi, i.e. coordinate. Bin is determined by formula b = (int) ( (k/k_max)^p * n_bins ), where p is the power in binning - usually 1
hila::k_binning kb; kb.bins(80).k_max(M_PI); auto sd = kb.spectraldensity(f); // get the spectral density of field f
methods: (use as kb.xxx) hila::k_binning & bins(int n) set number of bins (k_max const.) int bins() get number of bins hila::k_binning & k_max(double m) set max value of k in binning if bins have been modified it is kept constant, otherwise number of bins is changed so that binwidth is const. double k_max() get max value of k hila::k_binning & power(double p) set the "power" in binning double power() get power hila::k_binning & binwidth(double w) set binwidth (k_max const, so bins changes) double binwidth() get binwidth
std::vector<T> bin_k_field(const Field<T> &f) bin the k-space field f std::vector<double> bin_k_field_squarenorm(const Field<T & f) bin the square norm of k-space field f std::vector<double> spectraldensity(const Field<T> &f) FFT real-space field f and bin the result in squarenorm
double k(int b) return the average k within bin b long count(int b) return the number of points within bin b double bin_min(int b) return the minimum k of bin b double bin_max(int b) maximum k in bin b
Definition at line 72 of file spectraldensity.h.
|
inline |
Bin limits bin is b = floor((k / k_max)^p * n_bins) thus, k_min(b) = (b/n_bins)^(1/p) * k_max
Definition at line 337 of file spectraldensity.h.
|
inline |
Data structure to hold the binning info - two vectors, holding average k value in a bin and count of lattice points
Definition at line 278 of file spectraldensity.h.
|
inline |
Spectral density This version takes in complex field
Definition at line 232 of file spectraldensity.h.