SSEP coupling.py
From Werner KRAUTH
(Difference between revisions)
Revision as of 20:06, 12 June 2024 Werner (Talk | contribs) (SSEPCoupling.py moved to SSEP coupling.py) ← Previous diff |
Revision as of 22:12, 12 June 2024 Werner (Talk | contribs) Next diff → |
||
Line 1: | Line 1: | ||
+ | ==Context== | ||
+ | This page is part of my [[BegRohu_Lectures_2024|2024 Beg Rohu Lectures]] on "The second Markov chain revolution" at the [https://www.ipht.fr/Meetings/BegRohu2024/index.html Summer School] "Concepts and Methods of Statistical Physics" (3 - 15 June 2024). | ||
+ | |||
+ | ==Python program== | ||
+ | |||
import math | import math | ||
import random | import random |
Revision as of 22:12, 12 June 2024
Context
This page is part of my 2024 Beg Rohu Lectures on "The second Markov chain revolution" at the Summer School "Concepts and Methods of Statistical Physics" (3 - 15 June 2024).
Python program
import math import random Ntrials = 100 for NPart in [8, 16, 32, 64]: NSites = 2 * NPart Coupling = [] for Iter in range(Ntrials): ConfLow = {-1: -1, NPart: NSites}; ConfHigh = {-1: -1, NPart: NSites} for k in range(NPart): ConfLow[k] = k ConfHigh[NPart - 1 - k] = NSites - 1 - k iter = 0 while True: iter += 1 Active = random.randint (0, NPart - 1) sigma = random.choice([-1, 1]) if ConfLow[Active + sigma] != ConfLow[Active] + sigma: ConfLow[Active] += sigma if ConfHigh[Active + sigma] != ConfHigh[Active] + sigma: ConfHigh[Active] += sigma CLow = [ConfLow[k] for k in range(NPart)] CHigh = [ConfHigh[k] for k in range(NPart)] for k in range(NPart): if CLow[k]> CHigh[k]: print(Error) if ConfLow == ConfHigh: Coupling.append(iter / NPart ** 3 / math.log(NPart)) break print(NPart, sum(Coupling) / len(Coupling))
N t_coup / N^3 / log N 8 1.2698 16 1.1993 32 1.1190 64 1.1028