Commit 3adf2d32 authored by Florian Goth's avatar Florian Goth
Browse files

Merge branch 'master' into 16-flo-vs-hdf5

parents 138aa6f6 dfa98384
Pipeline #7004 passed with stage
in 1 minute and 24 seconds
......@@ -8,6 +8,8 @@
* Blume-Capel model: Implemented in `BlumeCapel.h`; Extension to integer spin values $`\{-1,0,1\}`$, which calls for a hybrid MC scheme, as the Wolff algorithm does not affect zero-spins; current implementation of the Metropolis and Wolff algorithms are only obvious guesses at the moment, i.e. as it stand it is unclear whether updates obey the detailed balance condition strictly; nonetheless, tested in 3D via critical scaling collapses for a specific parameter choice; results match expected numbers from `hasenbusch2010`, `hasenbusch2018`
* XXZ antiferromagnet: Implemented in `XXZAntiferro.h`; Tested at two points in the T/H phase diagram: Found second-order transition from the AF into the paramagnetic phase at $`\beta=0.6384`$, $`H=0`$ and from the SF into the paramagnetic phase at $`\beta=0.98`$, $`H=4.2`$, consistent with recent literature, such as `selke2009`, `selke2011` and `hu2014`; due to lack of precision critical exponents could not be confirmed so far; note: make sure that the Wolff cluster algorithm is only used at zero external field
# Up next
* something from the XXZ antiferromagnet family
\ No newline at end of file
0.93
0.9425
0.955
0.9675
0.98
0.9925
1.005
1.0175
......@@ -25,7 +25,7 @@ class BlumeCapelMag
mag += statespace[i][0];
}
return abs(mag)/double(N);
return std::abs(mag)/double(N);
}
BlumeCapelMag() : name("m") {}
};
......
[General]
nL = 12,16,24,32,48
betastart = 0.94
betaend = 1.04
nbeta = 10
nL = 8,12,16,24,32,48
betastart = 0.93
betaend = 1.03
nbeta = 8
[IO]
logfilename = ../log/logfile.txt
outdir = ../out
logdir = ../log
logfile = logfile.txt
[END]
......@@ -154,24 +154,34 @@ inline void coutsv(StateVector& vec)
// ---------------------------------------
const int myid = 0; // remove once a parallelization is available
#include "Heisenberg.h"
#include "Ising.h"
#include "Phi4.h"
#include "BlumeCapel.h"
#include "XXZAntiferro.h"
const std::string outdir = "../out/";
const int myid = 0;
#include "marqov.h"
int main()
{
// read config files
RegistryDB registry("../src/config");
// remove old output and prepare new one
std::string command = "rm -r " + outdir;
std::string outdir = registry.Get<std::string>("mc", "IO", "outdir" );
std::string logdir = registry.Get<std::string>("mc", "IO", "logdir" );
std::string command;
command = "rm -r " + outdir;
system(command.c_str());
command = "rm -r " + logdir;
system(command.c_str());
makeDir(outdir);
makeDir(logdir);
// ------------------ live view -----------------------
......@@ -190,17 +200,18 @@ int main()
*/
// ----------------------------------------------------
auto nL = registry.Get<std::vector<int> >("mc", "General", "nL" );
// extract Monte Carlo parameters
auto nL = registry.Get<std::vector<int> >("mc", "General", "nL" );
int nbeta = registry.Get<int>("mc", "General", "nbeta" );
double betastart = registry.Get<double>("mc", "General", "betastart" );
double betaend = registry.Get<double>("mc", "General", "betaend" );
double betastep = (betaend - betastart) / double(nbeta);
std::string logfilename = registry.Get<std::string>("mc", "IO", "logfilename" );
std::ofstream os(logfilename);
// write temperatures in logfile
std::string logfile = registry.Get<std::string>("mc", "IO", "logfile" );
std::ofstream os(logdir+"/"+logfile);
for (int i=0; i<nbeta; i++) os << betastart + i*betastep << endl;
os.close();
......@@ -215,6 +226,7 @@ int main()
// extract lattice size and prepare directories
const int L = nL[j];
cout << endl << "L = " << L << endl << endl;
cout << outdir+std::to_string(L) << endl;
makeDir(outdir+std::to_string(L));
// temperature loop
......@@ -227,7 +239,7 @@ int main()
RegularLattice lattice(L, dim);
// set up outfile
std::string outfile = outdir+std::to_string(L)+"/"+std::to_string(i)+".h5";
std::string outfile = outdir+"/"+std::to_string(L)+"/"+std::to_string(i)+".h5";
// set up model
// Marqov<RegularLattice, Ising<int> > marqov(lattice, currentbeta, outfile);
......@@ -243,8 +255,8 @@ int main()
// number of EMCS during relaxation and measurement
const int nrlx = 1000;
const int nmsr = 2000;
const int nrlx = 2500;
const int nmsr = 5000;
// perform simulation
......
......@@ -233,6 +233,8 @@ inline int Marqov<Grid, Hamiltonian>::metropolisstep(int rsite)
double dE = interactionenergydiff + onsiteenergydiff + (multisiteenergynew - multisiteenergyold);
// improve me: what about models with discrete statevectors where the acceptance probability should be
// looked up in tables? -> specialized Metropolis routine for this case??
int retval = 0;
if ( dE <= 0 )
......@@ -240,7 +242,7 @@ inline int Marqov<Grid, Hamiltonian>::metropolisstep(int rsite)
svold = svnew;
retval = 1;
}
else if (rng.d() < exp(-ham.beta*dE))
else if (rng.d() < exp(-ham.beta*dE))
{
svold = svnew;
retval = 1;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment