In this section, the general features of the simulation and data analysis processes are presented. Further explanation applied to different examples can be found in the Tutorials section.
𝕍egas takes in some input files to perform a simulation:
In this file, the simulation parameters are defined using a JSON file format. The following attributes can be defined in this file:
An example of a configuration file is shown below:
{
"sample": "sample.dat",
"anisotropy": "anisotropy.dat",
"initialstate": "initialstate.dat",
"out": "results.h5",
"mcs": 10000,
"seed": 5681401,
"kb": 0.08618,
"field": 0.0,
"temperature": 100.0
}
In this example, the system is simulated at a temperature of without presence of external magnetic field. There are different ways to input the values of the “field” and “temperature” attributes:
If the “field” is a float and the “temperature” a list, the system is simulated using the same inputed “field” float at each “temperature” value, and vice versa:
"field": 0.5,
"temperature": [10.0, 20.0, 30.0, 40.0, 50.0]
If both attribute values are inputed as lists, the number of items in each list must be the same.
"field": [0.5, 1.0, 1.5, 2.0, 2.5],
"temperature": [10.0, 20.0, 30.0, 40.0, 50.0]
Then, each temperature is simulated using its corresponding value in the “field” lists, i.e., the simulation is carried out at (temperature, magnetic field) pair steps of (), (), (), () and ().
Structures can also be used to input the values:
"field": 1.0,
"temperature": {
"start": 1500.0,
"final": 1.0,
"points": 100
}
Using this structure, the system is cooled down from to in a constant magnetic field of using temperature steps.
Also, the values can be cycled (“cycle”), which is useful for hysteresis loop simulations:
"field": {
"start": 2.0,
"final": -2.0,
"points": 100,
"cycle": true
},
"temperature": 10.0
Using this structure, the magnetic field is varied from to , and then from to at a temperature of for a total of steps ( is discarded once to avoid a repetition).
The sample and anisotropy files contain the structural and magnetic characteristics of the system that will be simulated. The user can input different anisotropy files, each one adding an anisotropy term to the Hamiltonian. The initial state file contains a system magnetization state that will be used to start the simulation. However, this file is optional, and if no file is given, the system would start in a random magnetization state. The name of these files must match the filenames in the path of the “sample”, “anisotropy” and “initialstate” attributes in the configuration file. The format and construction of these files is explained in the System building section.
Once all the files have been created, to start the simulation, open a terminal and change directory to the folder. If the name of the configuration file is config.json, execute:
vegas config.json
Then, a message like this should appear:
In this message, it is possible to appreciate the input and output files, along with the value of kb, the random seed number and the number of sites per type (all Fe ions in this simulation). Also, some information is shown per temperature/magnetic field pair. The ETR (Estimated time remaining) of the simulation, which is an estimation of the time remaining to complete the simulation, is shown in the first column. Then, the percentage of completion of the simulation and the temperature/magnetic field pair that is being simulated are shown. Finally, because the Adaptive move is being used as the spin update policy, the cone width is shown. In simulations where various types are considered, the cone width for each type should appear.
Once the simulation is completed a message like this should appear:
Finally, an output file (results.h5) must has been created. This file contains all the history of the simulation, from where the magnetic properties of the system can be extracted and analyzed.
Simulation results are stored in a set of variables and attributes. Variables include the temperature, external magnetic field and energy values, ions spatial positions, final magnetization states, spatial components of the magnetization per ion type and spatial components of the total magnetization. The final magnetization states correspond to the magnetization state of the system at the last Monte Carlo step per temperature/magnetic field pair point. Attributes include the number of Monte Carlo steps, random number seed and Boltzmann constant value.
HDFView is an useful tool to visualize the contents of the output file. If the output file is opened with this tool, something like this is observed:
However, to handle the data and facilitate its analysis, it is better to create and use python scripts to extract and visualize the data of interest of the results output file.