22#include "./parameters.hpp"
24#include <itertools/itertools.hpp>
25using itertools::enumerate;
27namespace triqs_cthyb {
31 inline void h5_write(h5::group h5group, std::string name, std::pair<std::string, std::string>
const &pair) {
32 h5::group grp = name.empty() ? h5group : h5group.create_group(name);
33 h5_write(grp,
"0", std::string(pair.first));
34 h5_write(grp,
"1", std::string(pair.second));
37 inline void h5_read(h5::group h5group, std::string name, std::pair<std::string, std::string> &pair) {
38 h5::group grp = name.empty() ? h5group : h5group.open_group(name);
39 assert(grp.get_all_subgroup_names().size() == 2);
40 h5_read(grp,
"0", pair.first);
41 h5_read(grp,
"1", pair.second);
46 inline void h5_write(h5::group h5group, std::string name, std::set<std::pair<std::string, std::string>>
const &pair_set) {
47 h5::group grp = name.empty() ? h5group : h5group.create_group(name);
48 for(
auto [idx, pair] : enumerate(pair_set) ) {
49 h5_write(grp, std::to_string(idx), pair);
53 inline void h5_read(h5::group h5group, std::string name, std::set<std::pair<std::string, std::string>> &pair_set) {
54 h5::group grp = name.empty() ? h5group : h5group.open_group(name);
55 for(
auto sgrp_name : grp.get_all_subgroup_names() ) {
56 std::pair<std::string, std::string> pair;
57 h5_read(grp, sgrp_name, pair);
58 pair_set.insert(pair);
63 h5::group grp = name.empty() ? h5group : h5group.create_group(name);
73 h5::group grp = name.empty() ? h5group : h5group.open_group(name);
79 triqs::gfs::h5_read_gf_struct(grp,
"gf_struct", cp.
gf_struct);
83 h5::group grp = name.empty() ? h5group : h5group.create_group(name);
135 TRIQS_RUNTIME_ERROR <<
"Error serailizing: CTHYB solve_parameters, can not serialize the global moves data type.";
150 h5::group grp = name.empty() ? h5group : h5group.open_group(name);
201 if( grp.has_key(
"move_global") )
202 TRIQS_RUNTIME_ERROR <<
"Error reading: CTHYB solve_parameters, can not de-serialize the global moves data type.";
213 h5::try_read(grp,
"h_loc0", sp.
h_loc0);
Parameters used for constructing the solver class.
bool delta_interface
Use and as input instead of .
int n_iw
Number of Matsubara frequencies.
int n_l
Number of Legendre polynomials.
int n_tau
Number of imaginary-time points.
double beta
Inverse temperature .
friend void h5_read(h5::group h5group, std::string subgroup_name, constr_parameters_t &sp)
Read constr_parameters_t from hdf5.
friend void h5_write(h5::group h5group, std::string subgroup_name, constr_parameters_t const &sp)
Write constr_parameters_t to hdf5.
gf_struct_t gf_struct
Structure of the Green's function (names and sizes of blocks).
Parameters passed to the solve method of the solver class.
std::optional< std::pair< many_body_op_t, many_body_op_t > > measure_O_tau
Measure by insertion.
bool measure_G2_iw_pp_nfft
Measure in the particle-particle channel.
bool measure_G2_iw_ph
Measure in the particle-hole channel.
long length_cycle
Length of a single QMC cycle.
int loc_n_max
Restrict local Hilbert space to states with at most this number of particles.
bool measure_G2_iwll_ph
Measure in the particle-hole channel.
bool measure_G_tau
Measure ? Hermiticity is enforced.
bool measure_G2_iw_nfft
Measure with three fermionic frequencies.
int verbosity
Verbosity level.
long random_seed
Seed for random number generator.
std::string partition_method
Partition method.
block_order measure_G2_block_order
Order of block indices in the definition of .
bool measure_pert_order
Measure perturbation order?
bool use_trace_estimator
Calculate the full trace or use an estimate?
int measure_G2_n_bosonic
Number of bosonic Matsubara frequencies for the measurement.
std::string random_name
Name of random number generator.
std::optional< many_body_op_t > h_loc0
Quadratic part of the local Hamiltonian. Must be provided if the interface is used.
std::map< std::string, indices_map_t > move_global
List of global moves (with their names). Each move is specified with an index substitution dictionary...
std::set< std::pair< std::string, std::string > > measure_G2_blocks
List of block index pairs of to measure.
int measure_G2_n_l
Number of Legendre coefficients for the measurement.
bool use_norm_as_weight
Use the norm of the density matrix in the weight (instead of the trace)?
int measure_G2_iwll_nfft_buf_size
NFFT buffer size for the measurement.
long max_time
Maximum runtime in seconds, use -1 to set infinite.
double det_singular_threshold
Bound for the determinant matrix being singular (if , checks for subnormal numbers).
int measure_G2_n_tau
Number of imaginary-time slices for the measurement.
double det_precision_warning
Threshold for determinant precision warnings.
bool measure_G2_iw
Measure with three fermionic frequencies.
bool move_double
Add double insertions as a move?
std::vector< many_body_op_t > quantum_numbers
Quantum numbers.
int measure_G2_n_fermionic
Number of fermionic Matsubara frequencies for the measurement.
bool measure_G2_iw_ph_nfft
Measure in the particle-hole channel.
long n_cycles
Number of QMC cycles.
double imag_threshold
Threshold below which imaginary components of and are set to zero.
bool performance_analysis
Analyse performance of the trace computation with histograms (developers only)?
int loc_n_min
Restrict local Hilbert space to states with at least this number of particles.
std::map< std::string, double > proposal_prob
Operator insertion/removal probabilities for different blocks.
int det_n_operations_before_check
Maximum number of operations before testing the accuracy of and .
bool measure_G2_tau
Measure with three fermionic times.
long n_warmup_cycles
Number of cycles for thermalization.
bool measure_G2_iwll_pp
Measure in the particle-particle channel.
double det_precision_error
Threshold for determinant precision error.
std::map< std::string, long > nfft_buf_sizes
NFFT buffer sizes for different blocks.
bool measure_density_matrix
Measure the reduced impurity density matrix?
friend void h5_write(h5::group h5group, std::string subgroup_name, solve_parameters_t const &sp)
Write solve_parameters_t to hdf5.
bool measure_G2_iw_pp
Measure in the particle-particle channel.
many_body_op_t h_int
Interacting part of the atomic Hamiltonian.
int measure_O_tau_min_ins
Minimum number of operator insertions in the insertion measure.
bool measure_G_l
Measure (Legendre)? No hermiticity is enforced.
bool move_shift
Add shifting an operator as a move?
int det_init_size
The maximum size of the determinant matrix before a resize.
friend void h5_read(h5::group h5group, std::string subgroup_name, solve_parameters_t &sp)
Read solve_parameters_t from hdf5.
double off_diag_threshold
Threshold below which off-diagonal components of are set to zero.
double move_global_prob
Overall probability of the global moves.