Sandbox for the Exponential and Gaussian Random Energy Models
If you use this code, please consider citing our work.
Aside from MPI, the hdspin repository requires no external libraries whatsoever (except via Git Submodules). Downloading and building the code should be simple via CMake.
git clone git@github.com:matthewcarbone/hdspin.git
cd hdspin
git submodule init
git submodule update
cmake -S . -B build -DPRECISON=256 -DBUILD_TESTS=ON -DSMOKE=ON
cd build
makeNote, it is required you have MPI available on your system in order to build hdspin. You can do this via your system's package managers (such as Homebrew or apt). hdspin is tested with openmpi. See here for how hdspin's CI system installs MPI (you can emulate this).
There are three options for the user to set:
-DPRECISON=<INT>is the maximum number of spins you can use during the simulation. Should be a power of 2 (as recommended by the Arbitrary Precision library). Default is256. Note that this is the maximum value you can use forN_spinsin the simulation.-DBUILD_TESTS={ON, OFF}is a boolean flag for telling CMake whether or not to compile the testing suite. Default isOFF.-DSMOKE={ON, OFF}controls whether or not to use the smoke testing or not. Smoke tests basically run tests using slightly less statistics, and are generally faster. Default isON.
After running make in the previous steps, an executable build/hdspin will be created. Running hdspin is simple. hdspin uses a command line parser called CLI11. Use hdspin -h to see a list of options. A config.json is always saved to the working directory with all of the command line inputs.
Four parameters are absolutely required:
log10_N_timesteps=<INT>: the log10 number of timesteps to runN_spins=<INT>: the number of spins to use in the simulation. Must be<=PRECISON.beta=<FLOAT>: inverse temperature (beta_criticalis set automatically based on thelandscape).landscape={"EREM", "GREM"}: the type of simulation to run (either exponential or Gaussian REM).
Once simulations are computed, run the post-processing script from the same working directory to finalize the results into the final directory
python3 /path/to/postprocess.pyPost-processing creates averages and spreads of all observable quantities, such as the energy.
The hdspin code is released under a 3-clause BSD license. Hosted codes are contained locally as per the permissive terms of the associated licenses. This includes nlohmann's Json header, as well as Catch2, CLI11 and the Arbitrary Precision library.
This software is based upon work supported by the U.S. Department of Energy, Office of Science, Office of Advanced Scientific Computing Research, Department of Energy Computational Science Graduate Fellowship under Award Number DE-FG02-97ER25308.