|
TRIQS/TRIQS 4.0.0
Researching Interacting Quantum Systems
|
#include <triqs/mc_tools/mc_move_set.hpp>
Set of MC moves.
It combines multiple MC moves.
Since it models the triqs::mc_tools::MCMove concept, it can be used just like any other MC move:
| MCSignType | Type of the sign/weight of a MC configuration (triqs::mc_tools::DoubleOrComplex). |
Definition at line 63 of file mc_move_set.hpp.
Public Member Functions | |
| move_set (move_set &&)=default | |
| Default move constructor. | |
| move_set (move_set const &)=delete | |
| Deleted copy constructor. | |
| move_set (random_generator &rng) | |
| Construct a move set with a given random number generator (stored in a std::reference_wrapper). | |
| MCSignType | accept () |
| Accept the new MC configuration. | |
| template<typename T> requires (MCMove<T, MCSignType>) | |
| void | add (T &&m, std::string name, double weight) |
| Add a new move to the set with a given name and weight. | |
| double | attempt () |
| Propose a new MC configuration. | |
| auto | attempt_sign () const |
| Get the sign of the acceptance ratio of the last attempt. | |
| void | calibrate (mpi::communicator const &c) |
| Calibrate all the moves in the set. | |
| void | clear_statistics () |
| Clear the statistics of all the moves in the set. | |
| void | collect_statistics (mpi::communicator const &c) |
| Collect statistics for all the moves in the set from multiple MPI processes. | |
| auto | current () const |
| Get the index of the current move. | |
| std::map< std::string, double > | get_acceptance_rates () const |
| Get the acceptance rates of all moves in the set. | |
| std::string | get_statistics (std::string const &prefix="") const |
| Get a formatted string showing the acceptance rates of all moves. | |
| std::string | get_timings (std::string const &prefix="") const |
| Get a formatted string with the timings of all moves. | |
| move_set & | operator= (move_set &&)=default |
| Default move assignment operator. | |
| move_set & | operator= (move_set const &)=delete |
| Deleted copy assignment operator. | |
| auto const & | probabilities () const |
| Get the probabilities with which the moves are selected. | |
| void | reject () |
| Reject the new MC configuration. | |
| double | total_duration () const |
| Get the total duration of all moves. | |
Static Public Member Functions | |
| static std::string | hdf5_format () |
| Get the HDF5 format tag. | |
Friends | |
| void | h5_read (h5::group g, std::string const &name, move_set &ms) |
| Read the move set object from HDF5. | |
| void | h5_write (h5::group g, std::string const &name, move_set const &ms) |
| Write the move set object to HDF5. | |
|
inline |
Construct a move set with a given random number generator (stored in a std::reference_wrapper).
| rng | RNG object. |
Definition at line 69 of file mc_move_set.hpp.
|
inline |
Accept the new MC configuration.
It calls the move::accept method of the previously attempted move.
Definition at line 119 of file mc_move_set.hpp.
|
inline |
Add a new move to the set with a given name and weight.
It adds a new MC move to the set, normalizes the weights of all moves and calculates the accumulated probabilities.
Throws a std::runtime_error if the weight is negative.
| T | triqs::mc_tools::MCMove type. |
| m | MC move to add to the set. |
| name | Name of the move. |
| weight | Weight of the move ( \( \geq 0 \)). |
Definition at line 98 of file mc_move_set.hpp.
| double triqs::mc_tools::move_set< MCSignType >::attempt | ( | ) |
Propose a new MC configuration.
It selects a move from the set based on the given weights and calls the move::attempt method of the selected move.
Definition at line 44 of file mc_move_set.cpp.
| void triqs::mc_tools::move_set< MCSignType >::calibrate | ( | mpi::communicator const & | c | ) |
Calibrate all the moves in the set.
It calls the move::calibrate method for each move.
| c | MPI communicator. |
Definition at line 63 of file mc_move_set.cpp.
| void triqs::mc_tools::move_set< MCSignType >::clear_statistics | ( | ) |
Clear the statistics of all the moves in the set.
It calls the move::clear_statistics method for each move.
Definition at line 55 of file mc_move_set.cpp.
| void triqs::mc_tools::move_set< MCSignType >::collect_statistics | ( | mpi::communicator const & | c | ) |
Collect statistics for all the moves in the set from multiple MPI processes.
It calls the move::collect_statistics method for each move.
| c | MPI communicator. |
Definition at line 59 of file mc_move_set.cpp.
|
nodiscard |
Get the acceptance rates of all moves in the set.
Definition at line 67 of file mc_move_set.cpp.
|
nodiscard |
Get a formatted string showing the acceptance rates of all moves.
| prefix | Prefix string to be added to the beginning of each line (not intended for the user). |
Definition at line 77 of file mc_move_set.cpp.
|
nodiscard |
Get a formatted string with the timings of all moves.
| prefix | Prefix string to be added to the beginning of each line (not intended for the user). |
Definition at line 83 of file mc_move_set.cpp.
|
inline |
Reject the new MC configuration.
It calls the move::reject method of the previously attempted move.
Definition at line 125 of file mc_move_set.hpp.
|
friend |
Read the move set object from HDF5.
It loops over all registered moves and calls the h5_read function for each move.
| g | h5::group to be read from. |
| name | Name of the subgroup. |
| ms | Move set object to be read into. |
Definition at line 211 of file mc_move_set.hpp.
|
friend |
Write the move set object to HDF5.
It loops over all registered moves and calls the h5_write function for each move.
| g | h5::group to be written to. |
| name | Name of the subgroup. |
| ms | Move set object to be written. |
Definition at line 196 of file mc_move_set.hpp.