60 Diagram_core(
double beta,
int s0,
double H,
double GAMMA, std::list<double> vertices=std::list<double>() );
225 std::uniform_real_distribution<double> _uniform_dist;
226 std::mt19937 _mt_generator;
243 Diagram(
double beta,
int s0,
double H,
double GAMMA,
244 std::list<double>
_vertices=std::list<double>(),
245 unsigned int seed = std::chrono::system_clock::now().time_since_epoch().count());
247 using Diagram_core::operator/ ;
286 std::list<double> vertices=std::list<double>(),
287 unsigned int seed = std::chrono::system_clock::now().time_since_epoch().count());
This class is the base class of Diagram, and should not be used directly, aside from testing function...
bool operator!=(const Diagram_core &other) const
operator to test wether two Diagram_core objects are different. It is the negation of operator==....
double acceptance_rate_add(double tau1, double tau2, double tau2max, double new_segment_spin) const
Returns the acceptance rate for the ADD_SEGMENT update for the given parameters.
double operator/(const Diagram_core &other) const
Returns the ratio of the weights of the two diagrams, i.e. this->value()/other.value()
bool attempt_remove_segment(double RN1, double RNacc)
Attemps the REMOVE_SEGMENT update for the current status of the diagram, using the two random numbers...
double value() const
Returns the value ("weight") of the current diagram.
int get_s0() const
Get the value of the spin of the 0-th segment of the diagram [0—t1].
Diagram_core(double beta, int s0, double H, double GAMMA, std::list< double > vertices=std::list< double >())
Construct a new diagram, setting its defining parameters. The list of vertices is optional: by defaul...
std::list< double > get_vertices() const
Get a copy of the list of _vertices.
double get_GAMMA() const
Get the value of the transverse field _GAMMA.
std::list< double > _vertices
list containing the times of the diagram vertices
double _H
value of the longitudinal component of magnetic field
double get_H() const
Get the value of the longitudinal field _H.
double acceptance_rate_remove(double tau1, double tau2, double tau2max, double segment_toberemoved_spin) const
Returns the acceptance rate for the REMOVE_SEGMENT update for the given parameters.
double _beta
length of the diagram (here representing the thermondinamical beta = 1/T)). Must be > 0.
size_t order() const
Get the order of the diagram (number of _vertices)
double get_beta() const
Get the value of _beta (length of the diagram)
int _s0
spin of the 0-th segment of the diagram [0—t1]. Must be +1 or -1
bool operator==(const Diagram_core &other) const
operator to test wether two Diagram_core objects are equal. It is intended for TESTING purposes only,...
double sum_deltatau() const
Small helper function, performing the sum (... +t4-t3 + t2-t1)
double _GAMMA
Value of the transversal component of magnetic field. Must be != 0.
double acceptance_rate_flip() const
Returns the acceptance rate for the SPIN_FLIP update for the given parameter.
void assert_parameters_validity(double beta, int s0, double H, double GAMMA, std::list< double > vertices) const
Internal (non-public) member function that checks wether all the parameters are within the allowed va...
bool attempt_spin_flip(double RNacc)
Attemps the SPIN_FLIP update for the current status of the diagram, using the random number given in ...
bool attempt_add_segment(double RN1, double RN2, double RNacc)
Attemps the ADD_SEGMENT update for the current status of the diagram, using the three random numbers ...
This is the main Diagram class, containing the variables defining the diagram - inherited from Diagra...
bool attempt_remove_segment()
Attemps the REMOVE_SEGMENT update for the current status of the diagram.
bool attempt_add_segment()
Attemps the ADD_SEGMENT update for the current status of the diagram.
Diagram(double beta, int s0, double H, double GAMMA, std::list< double > _vertices=std::list< double >(), unsigned int seed=std::chrono::system_clock::now().time_since_epoch().count())
Construct a new Diagram object, setting its defining parameters. The list of vertices is optional: by...
bool attempt_spin_flip()
Attemps the SPIN_FLIP update for the current status of the diagram.
void reset_diagram(double beta, int s0, double H, double GAMMA, std::list< double > vertices=std::list< double >(), unsigned int seed=std::chrono::system_clock::now().time_since_epoch().count())
Reset all diagram parameters with the new values.
bool lists_are_float_equal(const std::list< double > &list1, const std::list< double > &list2, double epsilon)
Small helper function that checks if two lists of floating points numbers are equal,...