TASEPCompact.py

From Werner KRAUTH

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

← Previous diff
Revision as of 14:05, 10 June 2024
Werner (Talk | contribs)
(Output)
Next diff →
Line 70: Line 70:
------------------------------------------------------------------ ------------------------------------------------------------------
Total time = 1.0 * N ^ 2.0 Total time = 1.0 * N ^ 2.0
 +
 +With all its limitations, the program illustrates that the N^2 steps are not sufficient to move the compact initial state and to approach the equilibrium.

Revision as of 14:05, 10 June 2024

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.

Here, we are concerned with the TASEP. With periodic boundary conditions, we may separate the forward-and-backward moving TASEP, as discussed in Lecture 3, into two independent copies. At each time step, the TASEP samples the random particle to be moved (forward). This, as discussed, is one half of a lifting of the SSEP.

Python program

import math
import random
exponent = 2.0
alpha = 0.5
prefactor = 1.0
NPart = 32; NSites = 2 * NPart
NIter = int(prefactor * NPart ** exponent)
NStrob = NIter // 20
Conf = [1] * NPart + [0] * (NSites - NPart)
Active = random.randint (0, NSites - 1)
while Conf[Active] != 1:
    Active = random.randint(0, NSites - 1)
Text = 'Periodic TASEP, 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 = 1
    NewActive = (Active + Step) % NSites
    if Conf[NewActive] == 0:
       Conf[Active], Conf[NewActive] = 0, 1
    if iter % NStrob == 0:
        PP = 
        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)
print(' ' * (NSites// 2 + 1 - len(Text) // 2) + Text + ' ' * (NSites// 2 + 1 - len(Text) // 2))


Output

Here is output of the above Python program for the TASEP with, for simplicity, N=32, L=64 and only 20 configurations over the length of the simulation.

                   Periodic TASEP, N= 32, L= 64
------------------------------------------------------------------
|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX                                |
|XXXXXXXXXXXXXXXXXXXXXXXXXXXX XXX X                              |
|XXXXXXXXXXXXXXXXXXXXXXXXX XXXX XX  X                            |
|XXXXXXXXXXXXXXXXXXXXXXXX XXXXX X X X                            |
|XXXXXXXXXXXXXXXXXXXXXX XXXXXX X  XX X                           |
|XXXXXXXXXXXXXXXXXXXXX XXXXX X  XXX XX                           |
|XXXXXXXXXXXXXXXXXXXXX XXX XX  XXXX X X                          |
|XXXXXXXXXXXXXXXXXXX XXXXX  X XX XX  XXX                         |
|XXXXXXXXXXXXXXX XXXXXXXXX  X XX X  XXXX                         |
|XXXXXXXXXXXXXX XXXXXXXX XX  XX   XX XXX  X                      |
|XXXXXXXXXXXXXX XXXXXXXX   XXXX    XX X X XX                     |
|XXXXXXXX XXXXXXXXXXXXX   X XXXX   XX  XX XX                     |
|XXXX XXXXXXXXXXXXXXXXX    XX XX X X  XX X X X                   |
|XX XXXXXXXXXXXXXXXXXX X   X XXX   X XX X XX   X                 |
| XXXXXXXXXXXXXXXXXX X XX   XXX X   XX  XXX   X    X             |
| XXXXXXXXXXXXXXX X XX XX X X X X  XX X XX  X X      X           |
| XXXXXXXXXXXXXX XX  X XXX X XX  X  XX XXX   X   X   X           |
| XXXXXXXXXXX XX XXX  XX XX XX X X   XXXXX    X   X   X          |
| XXXXXXXXX XXX XXXX  XX  XXXX   X  XXX  X X  XX    X  X         |
| XXXXXXXX XXXX XXXX  XX  XXX X    XX XX  XX   X   X X    X      |
| XXXXXXX XXXX XX XXX XX   XX X  X  XX X XXX   X   X  X   X      |
------------------------------------------------------------------
                    Total time = 1.0 *  N ^ 2.0

With all its limitations, the program illustrates that the N^2 steps are not sufficient to move the compact initial state and to approach the equilibrium.

Personal tools