Search code examples
c#simulationmontecarlostatistical-sampling

What does it mean to have a transient state or a transient phase in an Ising model?


I downloaded a simple implementation of the Ising model in C# from this link.

I have understood more or less the entire code except the following routine:

    private static void transient_results(double T)
    {
        for (int a = 1; a <= transient; a++)
        {
            array_to_list();
            for (int b = 1; b <= L * L; b++)
            {
                choose = choose_random_site("i", 0);
                posx = choose_random_site("x", choose);
                posy = choose_random_site("y", choose);

                if (test_flip(posx,posy,T))
                {
                    flip(posx,posy);
                }

                list.RemoveAt(choose);
            }
        }
    }

transient_results() takes the temperature T as a real value.

transient is an integer read directly from the console. This represents the count of transient sites.

array_to_list() is emptying up a list of strings and initializing it with new strings of the pattern "i , j". This is used as a site-locator. I.e. to keep track of the positions of processed/unprocessed sites.

This block

choose = choose_random_site("i", 0);
posx = choose_random_site("x", choose);
posy = choose_random_site("y", choose);

is selecting a random site and its corresponding (x, y) coordinate.

test_flip() cheks to see if the state flippable. This function returns a boolean value. Therefore, if a specific site is flippable, it is flipped.

Finally, no matter if a site is flippable or not, its site-locator string item is removed from the list, marking the site as already processed.


Questions:

  1. What does it mean to have a transient state or a transient phase in an Ising model?

  2. What does this function achieve altogether?

  3. How is it going to influence the simulation?


Solution

    1. A transient state is a state that is not stable. It is a state that is not going to last long. It is a state that is going to change soon. It is a state that is going to be replaced by another state. In the context of the Ising model, the transient state is the state of the system before it reaches equilibrium, before it reaches a stable state, before it reaches a state that is not going to change anymore.

    2. This function is going to achieve the following:

      a. It is going to empty up the list of site-locators.

      b. It is going to initialize the list of site-locators with new site-locators.

      c. It is going to select a random site and its corresponding (x, y) coordinate.

      d. It is going to check to see if the state is flippable.

      e. If the state is flippable, it is going to flip it.

      f. It is going to remove the site-locator of the processed site from the list.

    3. It is going to influence the simulation by making the simulation run faster, by making the simulation run more efficiently and by making the simulation run more accurately.

    With the transient phase, the system is allowed to reach a steady state. Without the transient phase, the system is not allowed to reach a steady state.

    With the transient phase, the system is allowed to reach a steady state before the simulation starts. This is done by running the simulation for a number of steps (transient) and then discarding the results. The system is then allowed to reach a steady state again and the simulation is run for a number of steps (transient) and the results are discarded. This process is repeated until the system reaches a steady state. The steady state is then used as the initial state for the simulation.