SSEPCompact.py

From Werner KRAUTH

(Difference between revisions)
Jump to: navigation, search
Revision as of 12:31, 10 June 2024
Werner (Talk | contribs)

← Previous diff
Current revision
Werner (Talk | contribs)
(Python program)
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).
 +
 +==Introduction==
 +
 +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 because they are usually described in continuous time. Here, we rather use a formulation in discrete time, where at each time step t=0,1,2,..., 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 math
import random import random
Line 4: Line 12:
alpha = 0.5 alpha = 0.5
prefactor = 1.0 prefactor = 1.0
- NPart = 64; NSites = 2 * NPart+ NPart = 100; NSites = 2 * NPart
NIter = int(prefactor * NPart ** exponent * math.log(NPart)) NIter = int(prefactor * NPart ** exponent * math.log(NPart))
- NStrob = NIter // 40+ NStrob = NIter // 400
Conf = [1] * NPart + [0] * (NSites - NPart) Conf = [1] * NPart + [0] * (NSites - NPart)
Active = random.randint (0, NSites - 1) Active = random.randint (0, NSites - 1)
Line 16: Line 24:
for iter in range(NIter): for iter in range(NIter):
Active = random.randint (0, NSites - 1) Active = random.randint (0, NSites - 1)
- while Conf[Active] != 1: Active = random.randint(0, NSites - 1)+ while Conf[Active] != 1:
- Step = random.choice([-1,1])+ Active = random.randint(0, NSites - 1)
 + Step = random.choice([-1, 1])
NewActive = (Active + Step) % NSites NewActive = (Active + Step) % NSites
- if Conf[NewActive] == 0: Conf[Active], Conf[NewActive] = 0, 1+ if Conf[NewActive] == 0:
- PP = '|'+ Conf[Active], Conf[NewActive] = 0, 1
- ktot= 0+ if iter % NStrob == 0:
- for k in range(NSites):+ PP = str()
- if Conf[k] == 0:+ for k in range(NSites):
- PP += ' '+ if Conf[k] == 0: PP += ' '
- else:+ else: PP += 'X'
- ktot += 1+ print('|' + PP + '|')
- if ktot != NPart / 2: PP += 'X'+
- else: PP += '|'+
- if iter % NStrob == 0: print(PP)+
print('-' * (NSites + 2)) print('-' * (NSites + 2))
Text = 'Total time = ' + str(prefactor) + ' * N ^ ' + str(exponent) + ' * log N' Text = 'Total time = ' + str(prefactor) + ' * N ^ ' + str(exponent) + ' * log N'
print(' ' * (NSites// 2 + 1 - len(Text) // 2) + Text + ' ' * (NSites// 2 + 1 - len(Text) // 2)) 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 (without the logarithm). It is thus asymptotically smaller than the mixing time, leading to the cutoff phenomenon.
 +
 +==References==
 +* Essler F. H. L, Krauth W., Lifted TASEP: a Bethe ansatz integrable paradigm for non-reversible Markov chains, [https://doi.org/10.1103/PhysRevX.14.041035 Phys. Rev. X 14, 041035 (2024)]
 +* Lacoin H., The cutoff profile for the simple exclusion process on the circle, Ann. Probab. 44, 3399 (2016)
 +* Lacoin H., The simple exclusion process on the circle has a diffusive cutoff window, Ann. Inst. H. Poincaré Probab.Statist. 53, 1402 (2017).
 +* Kapfer S. C. and Krauth W., Irreversible Local Markov Chains with Rapid Convergence towards Equilibrium, [https://doi.org/10.1103/PhysRevLett.119.240603 Phys. Rev. Lett. 119, 240603 (2017)].

Current revision

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).

Introduction

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 because they are usually described in continuous time. Here, we rather use a formulation in discrete time, where at each time step t=0,1,2,..., 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 = 100; NSites = 2 * NPart
NIter = int(prefactor * NPart ** exponent * math.log(NPart))
NStrob = NIter // 400
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
    if iter % NStrob == 0:
        PP = str()
        for k in range(NSites):
            if Conf[k] == 0: PP += ' '
            else: PP += 'X'
        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 (without the logarithm). It is thus asymptotically smaller than the mixing time, leading to the cutoff phenomenon.

References

  • Essler F. H. L, Krauth W., Lifted TASEP: a Bethe ansatz integrable paradigm for non-reversible Markov chains, Phys. Rev. X 14, 041035 (2024)
  • Lacoin H., The cutoff profile for the simple exclusion process on the circle, Ann. Probab. 44, 3399 (2016)
  • Lacoin H., The simple exclusion process on the circle has a diffusive cutoff window, Ann. Inst. H. Poincaré Probab.Statist. 53, 1402 (2017).
  • Kapfer S. C. and Krauth W., Irreversible Local Markov Chains with Rapid Convergence towards Equilibrium, Phys. Rev. Lett. 119, 240603 (2017).
Personal tools