Commit 7f734e87 authored by Manuel Schrauth's avatar Manuel Schrauth
Browse files

fixed severe bug in multi site energy difference calculation

parent 9bd78b79
Pipeline #10178 failed with stage
in 3 minutes and 30 seconds
......@@ -9,49 +9,15 @@ Ltime = 20
dim = 1
rep = 1
rep = 6
betaMC = 1.0
dtau = 0.2
k = 2
m = 1
g = 0.0
mu = 1.0
[BlumeCapelBipartite]
beta = 0.4, 0.45, 0.50, 0.55, 0.60, 0.65, 0.70, 0.75, 0.80
J = -1.0
DA = 1.0
DB = -1.0
dim = 2
rep = 50
L = 8,12,16,24,32,48,64,96,128
[Phi4]
L = 4,6,8,12,16
rep = 5
dim = 3
beta = 0.678, 0.681, 0.684, 0.687, 0.690, 0.693
lambda = 4.5
mass = 1.0
[Ising]
L = 16
rep = 1
dim = 2
beta = 0.430
J = -1.0
mu = 0.0
g = 1.0, 1.1, 1.2, 1.25, 1.26, 1.27, 1.28, 1.29, 1.295, 1.3, 1.302, 1.304, 1.306, 1.308, 1.31
[IO]
......
......@@ -72,6 +72,7 @@ class SSHLattice
retval.push_back(j);
for(int j = i+1; j < this->nsites; ++j)
retval.push_back(j);
break;
}
......
......@@ -9,8 +9,8 @@
#include "../hamparts.h"
#include "../metropolis.h"
#define CREATE_CHI_TABLE // writes out the susceptibility and exits the simulation
//#define USE_CHI_TABLE // read susceptibility from file and use it
//#define CREATE_CHI_TABLE // writes out the susceptibility and exits the simulation
#define USE_CHI_TABLE // read susceptibility from file and use it
// ----------------------------------- OBSERVABLES --------------------------------
......@@ -241,6 +241,7 @@ class SSH_multisite
#ifdef CREATE_CHI_TABLE
cout << "writing susceptibiliy to file ... ";
std::ofstream os("../log/chi.dat");
cout << grid.size() << endl;
for (int i=0; i<grid.size(); i++)
{
os << std::fixed << std::setprecision(14);
......@@ -257,13 +258,41 @@ class SSH_multisite
#endif
double retval = 0;
for (int i=0; i<nbrs.size(); i++)
{
auto chi = suscept(grid, rsite, nbrs[i]);
auto new1 = dot(svnew, mult(chi,s[nbrs[i]]));
auto old1 = dot(svold, mult(chi,s[nbrs[i]]));
retval = retval + 2*(new1 - old1); // since matrix is symmetric
}
/*
for (int i=0; i<nbrs.size(); i++)
{
auto chi = suscept(grid, nbrs[i], rsite);
auto new2 = dot(s[nbrs[i]], mult(chi,svnew));
auto old2 = dot(s[nbrs[i]], mult(chi,svold));
retval = retval + (new2 - old2);
}
*/
auto chi = suscept(grid, rsite, rsite);
auto newself = dot(svnew, mult(chi, svnew));
auto oldself = dot(svold, mult(chi, svold));
retval = retval + (newself-oldself);
return retval;
/* old version (not debugged!)
double retval = 0;
for (int i=0; i<nbrs.size(); i++)
{
auto b1 = svnew-svold;
auto b2 = suscept(grid, rsite, nbrs[i]);
auto b3 = s[i];
auto b3 = s[nbrs[i]];
auto a1 = dot(b1, mult(b2,b3));
auto a2 = dot(b3, mult(b2,b1));
......@@ -275,6 +304,7 @@ class SSH_multisite
retval -= dot(svold, mult(suscept(grid, rsite, rsite), svold));
return retval;
*/
}
~SSH_multisite() {delete [] gdat; delete [] dexpk; delete [] ftexp; }
......
......@@ -8,7 +8,7 @@
#include <tuple>
#include <iomanip>
#define SSH_2D // dimension switch
#undef SSH_2D // dimension switch
using std::cout;
using std::endl;
......@@ -140,7 +140,7 @@ void selectsim(RegistryDB& registry, std::string outbasedir, std::string logbase
mp.setnsweeps(10);
mp.setncluster(0);
mp.setwarmupsteps(0);
mp.setgameloopsteps(2000);
mp.setgameloopsteps(3000);
makeDir(mp.outpath);
......@@ -149,7 +149,6 @@ void selectsim(RegistryDB& registry, std::string outbasedir, std::string logbase
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
for(auto p : params)
......
......@@ -92,6 +92,7 @@ namespace MARQOV
template <class StateSpace, class M, class RNGType>
int Metropolis<Hamiltonian, Lattice>::move(const Hamiltonian& ham, const Lattice& grid, StateSpace& statespace, M& metro, RNGCache<RNGType>& rng, double beta, int rsite)
{
typedef typename Hamiltonian::StateVector StateVector;
// old state vector at rsite
......@@ -158,7 +159,6 @@ namespace MARQOV
double dE = interactionenergydiff + onsiteenergydiff + multisiteenergdiff;
int retval = 0;
if ( dE <= 0 )
{
......
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