Commit 5acb7974 authored by Manuel Schrauth's avatar Manuel Schrauth
Browse files

fix model by comparison with analytic solution

parent 1385e505
Pipeline #10120 failed with stage
in 6 minutes and 8 seconds
......@@ -5,19 +5,19 @@ Hamiltonian = SSH
[SSH]
L = 4
Ltime = 20
Ltime = 40
dim = 2
dim = 1
rep = 1
rep = 6
betaMC = 1.0
betaQM = 1.0
dtau = 0.2
k = 2
m = 1
k = 10
g = 0.0, 0.5, 1, 2
mu = 0.4
g = 0.2, 0.4, 0.8, 1.6, 3.2
mu = 0.0
[BlumeCapelBipartite]
......
......@@ -56,9 +56,8 @@
std::string str_g = "g"+std::to_string(std::get<3>(hp));
std::string str_mu = "mu"+std::to_string(std::get<4>(hp));
double betaQM = std::get<5>(hp);
double dtau = std::get<5>(hp);
int Ltime = std::get<6>(hp);
double dtau = betaQM / double(Ltime);
std::string str_Ltime = "Ltime"+std::to_string(Ltime);
std::string str_dtau = "dtau"+std::to_string(dtau);
......
......@@ -68,7 +68,7 @@ class SSHTwoPointCorrSpace
const int Ls = grid.len;
const int Lt = grid.lentime;
const double norml = 1.0 / Ls / Ls;
const double norml = 1.0 / Ls / Ls / 2; // division by two accounts for double counting
// std::vector<double> retval;
// for (int i=0; i<10; i++) retval.push_back(0);
......@@ -155,7 +155,7 @@ class SSH_multisite
double *const gdat;
std::complex<double>* dexpk;
double *const ftexp;
SSH_multisite(double g, double mu, double b, double d, int myL) : k(-0.5*g*g), beta(b), dtau(d), L(myL), ntau(std::round(beta/dtau)), g(g), mu(mu),
SSH_multisite(double g, double mu, double b, double d, int myL) : k(-0.5*g*g*d*d), beta(b), dtau(d), L(myL), ntau(std::round(beta/dtau)), g(g), mu(mu),
#ifndef SSH_2D
gdat(new double[ntau*L]),
ftexp(new double[L*L])
......@@ -389,19 +389,11 @@ class SSH_multisite
const auto t1 = w1[4];
const auto t2 = w2[4];
// const auto c1 = wick({w1[0],w1[1],t1}, {w1[2],w1[3],t1}, {w2[0],w2[1],t2}, {w2[2],w2[3],t2});
// const auto c2 = wick({w1[0],w1[1],t1}, {w1[2],w1[3],t1}, {w2[2],w2[3],t2}, {w2[0],w2[1],t2});
// const auto c3 = wick({w1[2],w1[3],t1}, {w1[0],w1[1],t1}, {w2[0],w2[1],t2}, {w2[2],w2[3],t2});
// const auto c4 = wick({w1[2],w1[3],t1}, {w1[0],w1[1],t1}, {w2[2],w2[3],t2}, {w2[0],w2[1],t2});
const auto c1 = wick<decltype(w1)>({w1[0],w1[2],t1}, {w1[1],w1[3],t1}, {w2[0],w2[2],t2}, {w2[1],w2[3],t2});
const auto c2 = wick<decltype(w1)>({w1[0],w1[2],t1}, {w1[1],w1[3],t1}, {w2[1],w2[3],t2}, {w2[0],w2[2],t2});
const auto c3 = wick<decltype(w1)>({w1[1],w1[3],t1}, {w1[0],w1[2],t1}, {w2[0],w2[2],t2}, {w2[1],w2[3],t2});
const auto c4 = wick<decltype(w1)>({w1[1],w1[3],t1}, {w1[0],w1[2],t1}, {w2[1],w2[3],t2}, {w2[0],w2[2],t2});
// const std::complex<double> K1 = green({w1[0],w1[1],w1[4]},{w1[2],w1[3],w1[4]}) + green({w1[2],w1[3],w1[4]},{w1[0],w1[1],w1[4]});
// const std::complex<double> K2 = green({w2[0],w2[1],w2[4]},{w2[2],w2[3],w2[4]}) + green({w2[2],w2[3],w2[4]},{w2[0],w2[1],w2[4]});
const std::complex<double> K1 = green<decltype(w1)>({w1[0],w1[2],t1},{w1[1],w1[3],t1}) + green<decltype(w1)>({w1[1],w1[3],t1},{w1[0],w1[2],t1});
const std::complex<double> K2 = green<decltype(w1)>({w2[0],w2[2],t2},{w2[1],w2[3],t2}) + green<decltype(w1)>({w2[1],w2[3],t2},{w2[0],w2[2],t2});
#else
......@@ -446,7 +438,7 @@ class SSH_Initializer
StateVector newsv(const StateVector& svold)
{
StateVector retval(svold);
double amp = 0.7;
double amp = 0.5;
double diff = rng.real(-amp, amp);
retval[0] += diff;
return retval;
......@@ -472,7 +464,7 @@ class SSH
static constexpr uint Nbeta = 1;
static constexpr uint Ngamma = 1;
SSH(double m, double k, double g, double mu, double bQ, int Ltime, int L) : m(m), k(k), g(g), mu(mu), dtau(bQ/double(Ltime)), L(L), betaQM(bQ), name("SSH")
SSH(double m, double k, double g, double mu, double dtau, int Ltime, int L) : m(m), k(k), g(g), mu(mu), dtau(dtau), betaQM(dtau*Ltime), L(L), name("SSH")
{
interactions[0] = new SSH_interaction<StateVector>(m, dtau);
onsite[0] = new SSH_onsite<StateVector>(m, k, dtau);
......@@ -497,7 +489,7 @@ class SSH
{
for (int i=0; i<grid.size(); i++)
{
if (rng.real() > 0.1) statespace[i][0] = 1;
if (rng.real() > 0.5) statespace[i][0] = 1;
else statespace[i][0] = -1;
}
}
......
......@@ -82,7 +82,7 @@ void selectsim(RegistryDB& registry, std::string outbasedir, std::string logbase
// ----------------- select simulation ------------------
auto beta = registry.Get<std::vector<double> >("mc.ini", ham, "betaMC");
auto betaQM = registry.Get<std::vector<double> >("mc.ini", ham, "betaQM");
auto dtau = registry.Get<std::vector<double> >("mc.ini", ham, "dtau");
auto m = registry.Get<std::vector<double> >("mc.ini", ham, "m");
auto k = registry.Get<std::vector<double> >("mc.ini", ham, "k");
auto g = registry.Get<std::vector<double> >("mc.ini", ham, "g");
......@@ -98,7 +98,7 @@ void selectsim(RegistryDB& registry, std::string outbasedir, std::string logbase
// we need "L" and "Ltime" as explicit parameters in the Hamiltonian
// which requires some gymnastics ...
std::vector<int> dummy = {0};
auto hp = cart_prod(beta, m, k, g, mu, betaQM, dummy, dummy);
auto hp = cart_prod(beta, m, k, g, mu, dtau, dummy, dummy);
// prepare lattices
......@@ -137,16 +137,18 @@ void selectsim(RegistryDB& registry, std::string outbasedir, std::string logbase
std::string outpath = outbasedir+"/"+std::to_string(L)+"/";
MARQOV::Config mp(outpath);
mp.setnsweeps(1);
mp.setnsweeps(5);
mp.setncluster(0);
mp.setwarmupsteps(0);
mp.setgameloopsteps(10);
mp.setgameloopsteps(100);
makeDir(mp.outpath);
// set up parameters
auto params = finalize_parameter_pair(mp, hp);
auto rparams = finalize_parameter_pair(mp, hp);
auto params = replicator_pair(rparams, nreplicas[0]);
SSHLattice& latt = latts[j][jj];
auto f = [&latt, &outbasedir, L](auto p){return sshfilter(latt, p);}; //partially apply filter
......
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