6#include "./auto_corr_time.hpp"
8namespace triqs_ctint::measures {
10 auto_corr_time::auto_corr_time(params_t
const ¶ms, qmc_config_t
const &qmc_config, container_set *results)
11 : params(params), qmc_config(qmc_config), auto_corr_time_(results->
auto_corr_time) {
15 for (
auto const &[bl, bl_size] : params.gf_struct) n_orbitals += bl_size;
18 log_accs.reserve(1 + n_orbitals);
19 for (
int i = 0; i < 1 + n_orbitals; ++i) log_accs.emplace_back(dcomplex{0.0}, -1);
23 log_accs[0] << dcomplex(qmc_config.perturbation_order());
27 for (
int bl = 0; bl < params.n_blocks(); ++bl) {
28 auto const &det = qmc_config.dets[bl];
29 int bl_size = params.gf_struct[bl].second;
31 nda::array<c_t, 1> cs(bl_size);
32 nda::array<cdag_t, 1> cdags(bl_size);
33 for (
int a = 0; a < bl_size; ++a) {
38 auto ratios = det.insert_ratios(0, 0, cs, cdags);
39 for (
int a = 0; a < bl_size; ++a) log_accs[idx++] << sign * ratios(a);
44 using triqs::stat::log_binning;
46 auto_corr_time_ = 0.0;
48 for (
auto &log_acc : log_accs) {
49 auto [mean, errs, taus, effs] = log_acc.mean_errors_and_taus(comm);
50 if (!taus.empty()) { auto_corr_time_ = std::max(auto_corr_time_, std::real(taus.back())); }
53 log_acc = log_binning<dcomplex>{dcomplex{0.0}, -1};
55 mpi::broadcast(auto_corr_time_, comm, 0);
Measurement of the auto-correlation time based on perturbation order and diagonal densities.
void accumulate(mc_weight_t sign)
Accumulate observables for autocorrelation analysis.
void collect_results(mpi::communicator const &comm)
Reduce and normalize.
static constexpr tau_t get_zero()
Return \tau = 0.
static constexpr tau_t get_zero_plus()
Return \tau = 0^{+} = 0 + \delta.