diff --git a/Exercise sheet 6/exercise_sheet_06.ipynb b/Exercise sheet 6/exercise_sheet_06.ipynb index d04ff24..8664b39 100644 --- a/Exercise sheet 6/exercise_sheet_06.ipynb +++ b/Exercise sheet 6/exercise_sheet_06.ipynb @@ -294,8 +294,8 @@ " s_i_n = -state[site]@nhat\n", " for nbr in neighboring_sites(site,w):\n", " s_j_n = state[nbr]@nhat\n", - " p_add = 1 - np.exp(-2*beta*s_i_n*s_j_n)\n", - " if np.sign(s_i_n) == np.sign(s_j_n) and rng.uniform() < p_add:\n", + " one_minus_p_add = np.exp(-2*beta*s_i_n*s_j_n)\n", + " if np.sign(s_i_n) == np.sign(s_j_n) and rng.uniform() > one_minus_p_add:\n", " state[nbr] -= 2*s_j_n*nhat\n", " unvisited.appendleft(nbr)\n", " cluster_size += 1\n", @@ -311,7 +311,7 @@ }, { "cell_type": "code", - "execution_count": 107, + "execution_count": 109, "id": "3f810041", "metadata": { "deletable": false, @@ -342,7 +342,7 @@ }, { "cell_type": "code", - "execution_count": 108, + "execution_count": 110, "id": "bde560e4", "metadata": { "deletable": false,