Bernoulli.py
From Werner KRAUTH
(Difference between revisions)
Revision as of 05:29, 6 June 2024 Werner (Talk | contribs) ← Previous diff |
Revision as of 14:38, 6 June 2024 Werner (Talk | contribs) Next diff → |
||
Line 1: | Line 1: | ||
+ | ==Context== | ||
+ | This page is part of my 2024 [https://www.ipht.fr/Meetings/ 2024 Beg Rohu] Lectures on "The second , the Wolff cluster algorithm for the Ising model on an LxL square lattice in two dimensions | ||
+ | |||
import random | import random | ||
p = 0.7 | p = 0.7 |
Revision as of 14:38, 6 June 2024
Context
This page is part of my 2024 2024 Beg Rohu Lectures on "The second , the Wolff cluster algorithm for the Ising model on an LxL square lattice in two dimensions
import random p = 0.7 count_a = 0 N_trial = 1000000 for iter in range(N_trial): Upsilon = random.uniform(0.0, 1.0) if Upsilon < p: count_a += 1 print(count_a / N_trial)