5

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?

user366312
  • 16,949
  • 65
  • 235
  • 452

1 Answers1

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

Tibic4
  • 3,709
  • 1
  • 13
  • Regarding (2), what do **a-f** achieve together as one function? – user366312 Sep 24 '22 at 02:38
  • As I said, it will make the simulation run faster, more efficiently, and more accurately. It will make the simulation run faster because it will remove the site locators of the processed sites from the list. It is going to make the simulation run more efficiently because it is going to check to see if the state is flippable before it is going to flip it. It is going to make the simulation run more accurately because it is going to flip the state only if it is flippable. – Tibic4 Sep 24 '22 at 11:57
  • Then, what does it have to do with transient states? I don't see its connection with transient states. – user366312 Sep 25 '22 at 06:16
  • I edited the response to include the answer to your question. – Tibic4 Sep 25 '22 at 13:26
  • I am terribly sorry if I am unable to get my point across. I was asking: What is the function `transient_results(double T)`'s role in the case of transient states? It seems to be checking the flippable sites, doing some flipping, and marking the sites as processed. I don't see anything related to transient states inside this specific function. – user366312 Sep 26 '22 at 02:22
  • The transient_results(double T) function is used to remove the transient states from the system. Then the system is in equilibrium. (energy and magnetisation are constant). The transient states are removed by flipping the spins randomly for a number of times (transient). – Tibic4 Sep 26 '22 at 10:44