diff options
-rw-r--r-- | doc/system.rst | 6 | ||||
-rw-r--r-- | lib/include/wolff.hpp | 4 | ||||
-rw-r--r-- | lib/include/wolff/cluster.hpp | 8 | ||||
-rw-r--r-- | lib/include/wolff/system.hpp | 4 |
4 files changed, 10 insertions, 12 deletions
diff --git a/doc/system.rst b/doc/system.rst index cb78a6d..928d85b 100644 --- a/doc/system.rst +++ b/doc/system.rst @@ -56,7 +56,7 @@ This class and associated member functions are defined in the header files :file The states of the spins and ghost site are initialized using the default constructors for :type:`X_t` and :type:`R_t`, respectively. :any:`nv` and :any:`ne` are taken directly from :any:`G`, after which the ghost site is added to :any:`G`. - .. function:: system::flip_cluster(v_t i0, const R_t& r, std::mt19937& rng, measurement<R_t, X_t>& A, double x = 1.0) + .. function:: system::flip_cluster(v_t i0, const R_t& r, std::mt19937& rng, measurement<R_t, X_t>& A) Performs one Wolff cluster flip to the system. @@ -64,9 +64,8 @@ This class and associated member functions are defined in the header files :file :param const R_t& r: The transformation by which the cluster is flipped. :param std\:\:mt19937& rng: A random number generator. :param measurement<R_t, X_t>& A: Object whose class inherits :class:`measurement` and provides relevant measurement hooks. - :param double x = 1.0: Optional argument. When assigned, changes the bond activation probability to :math:`p=1-xe^{-\beta\Delta\mathcal H}`. - .. function:: system::run_wolff(N_t N, std::function <R_t(std::mt19937&, const system<R_t, X_t>&, v_t)> r_gen, measurement<R_t, X_t>& A, std::mt19937& rng, double x = 1.0) + .. function:: system::run_wolff(N_t N, std::function <R_t(std::mt19937&, const system<R_t, X_t>&, v_t)> r_gen, measurement<R_t, X_t>& A, std::mt19937& rng) Performs :any:`N` Wolff cluster flips to the system. @@ -74,6 +73,5 @@ This class and associated member functions are defined in the header files :file :param std\:\:function <R_t(std\:\:mt19937&, const system<R_t, X_t>&, v_t>)> r_gen: Generator of transformations for the cluster flips. :param measurement<R_t, X_t>& A: Object whose class inherits :class:`measurement` and provides relevant measurement hooks. :param std\:\:mt19937& rng: A random number generator. - :param double x = 1.0: Optional argument. When assigned, changes the bond activation probability to :math:`p=1-xe^{-\beta\Delta\mathcal H}`. diff --git a/lib/include/wolff.hpp b/lib/include/wolff.hpp index 7ad608f..7e909c8 100644 --- a/lib/include/wolff.hpp +++ b/lib/include/wolff.hpp @@ -10,7 +10,7 @@ namespace wolff{ template <class R_t, class X_t> void system<R_t, X_t>::run_wolff(N_t N, std::function <R_t(std::mt19937&, const system<R_t, X_t>&, v_t)> r_gen, - measurement<R_t, X_t>& A, std::mt19937& rng, double x) { + measurement<R_t, X_t>& A, std::mt19937& rng) { std::uniform_int_distribution<v_t> dist(0, nv - 1); @@ -20,7 +20,7 @@ void system<R_t, X_t>::run_wolff(N_t N, A.pre_cluster(n, N, *this, i0, r); - this->flip_cluster(i0, r, rng, A, x); + this->flip_cluster(i0, r, rng, A); A.post_cluster(n, N, *this); } diff --git a/lib/include/wolff/cluster.hpp b/lib/include/wolff/cluster.hpp index 34d256a..b66f367 100644 --- a/lib/include/wolff/cluster.hpp +++ b/lib/include/wolff/cluster.hpp @@ -13,7 +13,7 @@ namespace wolff { template <class R_t, class X_t> void system<R_t, X_t>::flip_cluster(v_t i0, const R_t& r, - std::mt19937& rng, measurement<R_t, X_t>& A, double x) { + std::mt19937& rng, measurement<R_t, X_t>& A) { std::uniform_real_distribution<double> dist(0.0, 1.0); std::queue<v_t> queue; @@ -69,7 +69,7 @@ void system<R_t, X_t>::flip_cluster(v_t i0, const R_t& r, #endif #ifdef WOLFF_FINITE_STATES - p = 1.0 - x + x * finite_states_Bp[finite_states_enum(s0s_old)] + p = finite_states_Bp[finite_states_enum(s0s_old)] [finite_states_enum(s0s_new)]; #endif @@ -85,7 +85,7 @@ void system<R_t, X_t>::flip_cluster(v_t i0, const R_t& r, #endif #ifdef WOLFF_FINITE_STATES - p = 1.0 - x + x * finite_states_Zp[finite_states_enum(s[i])] + p = finite_states_Zp[finite_states_enum(s[i])] [finite_states_enum(si_new)] [finite_states_enum(s[j])]; #endif @@ -95,7 +95,7 @@ void system<R_t, X_t>::flip_cluster(v_t i0, const R_t& r, } #ifndef FINITE_STATES - p = 1.0 - x * exp(-dE / T); + p = 1.0 - exp(-dE / T); #endif if (dist(rng) < p) { diff --git a/lib/include/wolff/system.hpp b/lib/include/wolff/system.hpp index 6e9c951..32ad38e 100644 --- a/lib/include/wolff/system.hpp +++ b/lib/include/wolff/system.hpp @@ -68,8 +68,8 @@ class system { #endif } - void flip_cluster(v_t, const R_t&, std::mt19937&, measurement<R_t, X_t>&, double x = 1.0); - void run_wolff(N_t, std::function <R_t(std::mt19937&, const system<R_t, X_t>&, v_t)> r_gen, measurement<R_t, X_t>& A, std::mt19937& rng, double x = 1.0); + void flip_cluster(v_t, const R_t&, std::mt19937&, measurement<R_t, X_t>&); + void run_wolff(N_t, std::function <R_t(std::mt19937&, const system<R_t, X_t>&, v_t)> r_gen, measurement<R_t, X_t>& A, std::mt19937& rng); }; } |