|
TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
|
#include <triqs/mc_tools/mc_measure.hpp>
Type erasure class for MC measures.
It takes any type that models the triqs::mc_tools::MCMeasure concept and erases its type.
Optionally, the following method can be defined:
Optionally, the following free functions can be defined:
| MCSignType | Type of the sign/weight of a MC configuration (triqs::mc_tools::DoubleOrComplex). |
Definition at line 62 of file mc_measure.hpp.
Public Member Functions | |
| measure (measure &&)=default | |
| Default move constructor leaves the moved from object in an empty state. | |
| measure (measure const &)=delete | |
| Deleted copy constructor. | |
| template<typename T> requires (MCMeasure<T, MCSignType> && !std::is_same_v<T, measure>) | |
| measure (T m, bool enable_timer, bool enable_report) | |
| Constructor takes an object that models the triqs::mc_tools::MCMeasure concept and erases its type. | |
| void | accumulate (MCSignType sign) |
| Perform the measurement on the current MC configuration. | |
| void | collect_results (mpi::communicator const &c) |
| Collect results from multiple MPI processes. | |
| auto | count () const |
| Get the number of measurements performed. | |
| double | duration () const |
| Get the duration of the cumulative accumulate() and collect_results() calls. | |
| std::string | get_timings (std::string const &name, std::string const &prefix="") const |
| Get a formatted string showing the runtime of the accumulate() and collect_results() calls. | |
| auto | is_set () const |
| Is the measure object a measure set? | |
| std::vector< std::string > | names () const |
| Get a vector of all the measure names in a measure set. | |
| measure & | operator= (measure &&)=default |
| Default move assignment operator leaves the moved from object in an empty state. | |
| measure & | operator= (measure const &)=delete |
| Deleted copy assignment operator. | |
| std::string | report () const |
| Report information about the measure. | |
Friends | |
| void | h5_read (h5::group g, std::string const &name, measure &m) |
| Read the measure object from HDF5. | |
| void | h5_write (h5::group g, std::string const &name, measure const &m) |
| Write the measure object to HDF5. | |
|
inline |
Constructor takes an object that models the triqs::mc_tools::MCMeasure concept and erases its type.
| T | Original type of the MC measure object. |
| m | MC measure object to have its type erased. |
| enable_timer | Enable timer for measuring the duration of the accumulate() and collect_results() calls. |
| enable_report | Enable the report() callback method. |
Definition at line 123 of file mc_measure.hpp.
|
inline |
Perform the measurement on the current MC configuration.
It calls the accumulate method of the original measure object.
| sign | Sign of the current MC configuration. |
Definition at line 146 of file mc_measure.hpp.
| void triqs::mc_tools::measure< MCSignType >::collect_results | ( | mpi::communicator const & | c | ) |
Collect results from multiple MPI processes.
It calls the collect_results method of the original measure object.
| c | MPI communicator. |
Definition at line 36 of file mc_measure.cpp.
|
nodiscard |
Get a formatted string showing the runtime of the accumulate() and collect_results() calls.
| name | Name of the measure. |
| prefix | Prefix string to be added to the beginning of each line. |
Definition at line 47 of file mc_measure.cpp.
|
nodiscard |
Get a vector of all the measure names in a measure set.
Definition at line 56 of file mc_measure.cpp.
|
nodiscard |
Report information about the measure.
It calls the report method of the original measure object (if reports are enabled in the ctor).
Definition at line 42 of file mc_measure.cpp.
|
friend |
Read the measure object from HDF5.
Does nothing if there is no specialized h5_read function for the original measure object.
| g | h5::group to be read from. |
| name | Name of the dataset/subgroup. |
| m | Measure object to be read into. |
Definition at line 214 of file mc_measure.hpp.
|
friend |
Write the measure object to HDF5.
Does nothing if there is no specialized h5_write function for the original measure object.
| g | h5::group to be written to. |
| name | Name of the dataset/subgroup. |
| m | Measure object to be written. |
Definition at line 203 of file mc_measure.hpp.