|
TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
|
#include <triqs/mc_tools/mc_measure_set.hpp>
Set of MC measures.
It combines multiple MC measures.
Since it models the triqs::mc_tools::MCMeasure concept, it can be used just like any other MC measure:
| MCSignType | Type of the sign/weight of a MC configuration (triqs::mc_tools::DoubleOrComplex). |
Definition at line 58 of file mc_measure_set.hpp.
Public Types | |
| using | measure_itr_t = measure_map_t::iterator |
| Iterator type for the measure set. | |
| using | measure_map_t = std::map<std::string, measure<MCSignType>> |
| Map type used for storing the measures. | |
Public Member Functions | |
| measure_set ()=default | |
| Default constructor. | |
| measure_set (measure_set &&)=default | |
| Default move constructor. | |
| measure_set (measure_set const &)=delete | |
| Deleted copy constructor. | |
| void | accumulate (MCSignType sign) |
| Perform all measurements in the set. | |
| void | clear () |
| Remove all measures from the set. | |
| void | collect_results (const mpi::communicator &c) |
| Collect results from all the measures in the measure set from multiple MPI processes. | |
| std::string | get_timings (std::string const &prefix="") const |
| Get a formatted string with the timings of all measures. | |
| bool | has (std::string const &name) const |
| Check if a measure with the given name is registered. | |
| template<typename T> requires (MCMeasure<T, MCSignType>) | |
| measure_itr_t | insert (T &&m, std::string name, bool enable_timer, bool enable_report) |
| Add a new measure to the set with a given name. | |
| std::vector< std::string > | names () const |
| Get a vector of all the measure names. | |
| measure_set & | operator= (measure_set &&)=default |
| Default move assignment operator. | |
| measure_set & | operator= (measure_set const &)=delete |
| Deleted copy assignment operator. | |
| void | remove (measure_itr_t const &it) |
| Remove the measure at the given iterator from the set. | |
| std::string | report () const |
| Report information about the measures in the set. | |
| double | total_duration () const |
| Get the total duration of all measures. | |
Static Public Member Functions | |
| static std::string | hdf5_format () |
| Get the HDF5 format tag. | |
Friends | |
| void | h5_read (h5::group g, std::string const &key, measure_set &ms) |
| Read the measure set object from HDF5. | |
| void | h5_write (h5::group g, std::string const &key, measure_set const &ms) |
| Write the measure set object to HDF5. | |
|
inline |
Perform all measurements in the set.
It calls the measure::accumulate method for each measure.
| sign | Sign of the current MC configuration. |
Definition at line 126 of file mc_measure_set.hpp.
| void triqs::mc_tools::measure_set< MCSignType >::collect_results | ( | const mpi::communicator & | c | ) |
Collect results from all the measures in the measure set from multiple MPI processes.
It calls the measure::collect_results method for each measure.
| c | MPI communicator. |
Definition at line 47 of file mc_measure_set.cpp.
|
nodiscard |
Get a formatted string with the timings of all measures.
It calls the measure::get_timings method for each measure and concatenates the results.
| prefix | Prefix string to be added to the beginning of each line (not intended for the user). |
Definition at line 60 of file mc_measure_set.cpp.
|
inlinenodiscard |
Check if a measure with the given name is registered.
| name | Name of the measure. |
Definition at line 113 of file mc_measure_set.hpp.
|
inline |
Add a new measure to the set with a given name.
Throws a std::runtime_error if a measurement with the same name has already been registered.
| T | triqs::mc_tools::MCMeasure type. |
| m | MC measure to add to the set. |
| name | Name of the measure. |
| enable_timer | Enable the timer in the measure::accumulate and measure::collect_results methods. |
| enable_report | Enable the measure::report method. |
Definition at line 94 of file mc_measure_set.hpp.
|
nodiscard |
Get a vector of all the measure names.
Definition at line 37 of file mc_measure_set.cpp.
|
inline |
Remove the measure at the given iterator from the set.
| it | Iterator to the measure to be removed. |
Definition at line 103 of file mc_measure_set.hpp.
|
nodiscard |
Report information about the measures in the set.
It calls the measure::report method for each measure and concatenates the results.
Definition at line 51 of file mc_measure_set.cpp.
|
friend |
Read the measure set object from HDF5.
It loops over all registered measures and calls the h5_read function for each measure.
| g | h5::group to be read from. |
| key | Name of the subgroup. |
| ms | Measure set object to be read into. |
Definition at line 188 of file mc_measure_set.hpp.
|
friend |
Write the measure set object to HDF5.
It loops over all registered measures and calls the h5_write function for each measure.
| g | h5::group to be written to. |
| key | Name of the subgroup. |
| ms | Measure set object to be written. |
Definition at line 173 of file mc_measure_set.hpp.