TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
Loading...
Searching...
No Matches

Detailed Description

Streaming binning accumulators that estimate mean, error and autocorrelation time on the fly.

An accumulator receives samples one at a time via operator<< and maintains running estimators without storing the full sample stream. Two flavours are provided:

  • triqs::stat::lin_binning groups consecutive samples into equally sized bins. The bin data is kept and can be accessed after the run, which makes it the natural input for downstream resampling (see Resampling techniques). It can run either with a fixed maximum number of bins (bins are compressed by a factor of two and the bin capacity is doubled whenever the maximum is reached) or with an unbounded number of bins of fixed capacity.
  • triqs::stat::log_binning is the canonical autocorrelation diagnostic: it maintains one bin per power-of-two bin size and reports the standard error \( s_n \) and integrated autocorrelation time \( \tau_n \) for each binning level. \( s_n \) and \( \tau_n \) are expected to grow with the bin size and saturate once the bin size exceeds the autocorrelation time of the underlying chain.

Both accumulators provide MPI-aware variants of their estimator methods and HDF5 serialisation for checkpointing long runs. The free function triqs::stat::compress_bins merges adjacent bins of a std::vector<T> by a given compression factor and is used by triqs::stat::lin_binning when aligning bin capacities across MPI ranks.

Classes

class  triqs::stat::lin_binning< T >
 Linear binning accumulator. More...
class  triqs::stat::log_binning< T >
 Logarithmic binning accumulator. More...

Functions

template<AccCompatible T>
auto triqs::stat::compress_bins (std::vector< T > const &bins, int fac)
 Compress a given number of adjacent bins.

Function Documentation

◆ compress_bins()

template<AccCompatible T>
auto triqs::stat::compress_bins ( std::vector< T > const & bins,
int fac )

#include <triqs/stat/lin_binning.hpp>

Compress a given number of adjacent bins.

It simply averages the data of adjacent bins and returns a vector containing those averages. The compression factor determines the number of adjacent bins that are merged together. Left over bins are discarded.

It returns a copy of the given bins if the compression factor is less than 2 and it returns an empty vector if the number of bins is smaller than the compression factor.

Template Parameters
Ttriqs::stat::AccCompatible type.
Parameters
binsstd::vector containing the bins to be compressed.
facCompression factor.
Returns
Compressed bins.

Definition at line 60 of file lin_binning.hpp.