From 1a7f1381bc89b66b66600ed534a5e23be08b2344 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Thu, 25 May 2017 14:03:21 -0400 Subject: fixed bug in wolff_step that modified the system energy incorrectly --- lib/wolff_tools.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/wolff_tools.c b/lib/wolff_tools.c index 72cf9f7..4fc096e 100644 --- a/lib/wolff_tools.c +++ b/lib/wolff_tools.c @@ -168,7 +168,7 @@ int32_t wolff_step(double T, double H, ising_state_t *s, gsl_rng *r, double *ps) cluster_t *c = flip_cluster(s->g, ps, H, s->spins, r); s->M += 2 * c->nv; - s->H += c->dH; + s->H += 2 * c->dH; int32_t n_flipped = c->nv; -- cgit v1.2.3-70-g09d2