SSEPCompact.py
From Werner KRAUTH
Contents |
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).
My Lecture 3 is concerned with the Symmetric Simple Exclusion Process (SSEP), treated here, and its liftings, the TASEP (totally asymmetric simple exclusion process) and the lifted TASEP. All these dynamical systems carry the word "Process" in their descriptions. This is because, it is usually described in continuous time. We rather use a formulation in descrete time, where at each time step, a single move is attempted. In fact, each move consists in the choice of a random particle and the choice of a random direction. The SSEP is a local diffusive Markov chain, and it has very slow dynamics: it takes N^3 log N steps to get it from a compact initial state into equilibrium.
Python program
import math import random exponent = 3.0 alpha = 0.5 prefactor = 1.0 NPart = 64; NSites = 2 * NPart NIter = int(prefactor * NPart ** exponent * math.log(NPart)) NStrob = NIter // 40 Conf = [1] * NPart + [0] * (NSites - NPart) Active = random.randint (0, NSites - 1) while Conf[Active] != 1: Active = random.randint(0, NSites - 1) Text = 'Periodic SSEP, N= ' + str(NPart) + ', L= ' + str(NSites) print(' ' * (NSites// 2 + 1 - len(Text) // 2) + Text + ' ' * (NSites// 2 + 1 - len(Text) // 2)) print('-' * (NSites + 2)) for iter in range(NIter): Active = random.randint (0, NSites - 1) while Conf[Active] != 1: Active = random.randint(0, NSites - 1) Step = random.choice([-1,1]) NewActive = (Active + Step) % NSites if Conf[NewActive] == 0: Conf[Active], Conf[NewActive] = 0, 1 PP = '|' for k in range(NSites): if Conf[k] == 0: PP += ' ' else: PP += '|' PP += '|' if iter % NStrob == 0: print(PP) print('-' * (NSites + 2)) Text = 'Total time = ' + str(prefactor) + ' * N ^ ' + str(exponent) + ' * log N' print(' ' * (NSites// 2 + 1 - len(Text) // 2) + Text + ' ' * (NSites// 2 + 1 - len(Text) // 2))
This example program performs a large number of iterations of the Monte Carlo algorithm for the Symmetric Simple Exclusion Process, and plots 40 lines of output over the entire simulation time.
Output
Here is output of the above Python program with, for simplicity, N=32, L=64 and only 20 configurations over the length of the simulation.
The initial configuration is compact. Clearly, the simulation has not run long enough to forget its initial state, and it would be necessary to increase the simulation time from N^2 log N to N^3 log N. In our simplified setting, the logarithm is difficult to see, but better analysis tools readily extract it from the numerical data.
Periodic SSEP, N= 32, L= 64 ------------------------------------------------------------------ |XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | |XXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX X | | XXXXXXXXXXXXXXXXXXXXXXXXXXXXX X X X| | X XXXXXXXXXXXXXXXXXXXXXXXXXXX X X X X| | X XXXXXXXXXXXXXXXXXXXXXX X XXX X X XX X| |X XXXXXXXXXXXXXXXXXXXXX XXX X XX X X X X | |X XXX XXXXXXXXXXXXXXXXXXXX XX X X X X X X | | XXXX XXXXXXXXXXXXXXXXXXXX X X XX X X X X| | XXXXXX XXXXXXXXXXXXXXXXXX X X X X X X X X | | XXXXXXXX XXXXXXXXXXXXXXX X X X XX X XX X| | XXXXXXX XXXXXXXXXXXXX XXXX X X XX XX X X | | XXXX XXXXXXXXXXXXXX XXXXX X XXXX X X X X | |X XX XXXXXXXXXXXX XXXXXXX X XX XX X X X XX | |X XXXX XXXXXXXXXX XXXX XXXX XXX X X X X XX| | XXX XXXXXXXXXXX XXXXXXXXX X X X X X X X X X| |X XXX XXXXXXXXXXX XXXX XXXXX X X X XX X XX| | XXXXX XXXXXXXXX X XXXXXXXXX X X XXX X XX| |XXXX XXXXXXXXXXXX X XXXXX XX X XX X X XX X| |XXXX XXXXXXXXX XXXXXXXX XX X XX X X XX X X| |XXXXXX XXXXXX XXXXXXXXXXX X X X X XX X X X | |X XXXXXX XX XXXXXXXXXXXXX XX X X X X X X X X| ------------------------------------------------------------------ Total time = 1.0 * N ^ 2.0 * log N
Further Information
- The mixing behavior of the SSEP t_mix \sim N^3 log N has been computed by Lacoin (2016, 2017) (see references).
- The relaxation time of the SSEP is t_rel \sim N^3. It is thus asymptotically smaller than the mixing time, leading to the cutoff phenomenon.