Commit 6051ebe0 authored by Manuel Schrauth's avatar Manuel Schrauth
Browse files

fixed a couple of bugs

parent ed0683a6
Pipeline #10151 passed with stage
in 5 minutes and 38 seconds
......@@ -4,7 +4,7 @@ Hamiltonian = SSH
[SSH]
L = 4
L = 2
Ltime = 20
dim = 1
......@@ -16,9 +16,9 @@ dtau = 0.2
k = 2
m = 1
g = 20
g = 3.0, 3.5, 4.0
mu = 0.0
mu = 0.5
[BlumeCapelBipartite]
......
......@@ -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 --------------------------------
......@@ -178,7 +178,7 @@ class SSH_multisite
#ifdef USE_CHI_TABLE
// read susceptibility from file
double innumber;
std::ifstream infile("/home/schrauth/chi.dat", std::fstream::in);
std::ifstream infile("../log/chi.dat", std::fstream::in);
while (infile >> innumber)
{
chi_table.push_back(innumber);
......@@ -213,7 +213,7 @@ class SSH_multisite
for(int jy = 0; jy < L; ++jy)
{
double ky = (jy*2)*M_PI/double(L); // Fourier faktor
double eps = -2.0*std::cos(kx) - std::cos(ky) - mu; // 2D disperson relation (square lattice)
double eps = -2.0*std::cos(kx) - 2.0*std::cos(ky) - mu; // 2D disperson relation (square lattice)
for(int dt = 0; dt < ntau; ++dt)
{
gdat[dt * L*L + L*jx + jy] = 0.5*std::exp((-beta/2 + dt*dtau)*eps)/std::cosh(beta*eps/2);
......@@ -249,9 +249,28 @@ class SSH_multisite
os << suscept(grid,i,j) << endl;
}
}
os.close();
cout << "done! exiting ... " << endl;
// exit(0);
std::ofstream oss("../log/green.dat");
for (int i=0; i<grid.lentime; i++)
{
// std::vector<double> vx1 = {0, 0, i};
// std::vector<double> vx2 = {1, 0, 17};
// std::vector<double> vx3 = {0, 0, 0};
// std::vector<double> vx4 = {0, 0, 0};
// oss << green(vx1,vx2) << endl;
// oss << wick(vx1,vx2,vx3,vx4) << endl;
// oss << suscept(grid, i, i) << endl;
}
exit(0);
#endif
......@@ -345,7 +364,7 @@ class SSH_multisite
expk *= dexpkx; // increment Fourier transform
}
const double norml = 1.0 / pow(2*L,2); // the number of sites per time slice
const double norml = 1.0 / pow(L,2); // the number of sites (not bonds!)
return norml*signum*retval;
}
......@@ -358,6 +377,7 @@ class SSH_multisite
[[gnu::hot, gnu::optimize("fast-math"), gnu::pure ]]
inline double green(const VertexType& c1, const VertexType& c2)
{
// space
auto dist = std::lrint(c1[0]-c2[0]);
if (dist < 0) dist = L + dist; // yes or no?
......@@ -550,7 +570,7 @@ class SSH
{
for (int i=0; i<grid.size(); i++)
{
if (rng.real() > 0.5) statespace[i][0] = 1;
if (rng.real() > 0.0) statespace[i][0] = 1;
else statespace[i][0] = -1;
}
}
......
......@@ -8,7 +8,7 @@
#include <tuple>
#include <iomanip>
#undef SSH_2D // dimension switch
#define 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(20000);
mp.setgameloopsteps(2500);
makeDir(mp.outpath);
......@@ -180,11 +180,11 @@ int main()
std::string command;
command = "rm -r " + outbasedir;
system(command.c_str());
command = "rm -r " + logbasedir;
system(command.c_str());
// command = "rm -r " + logbasedir;
// system(command.c_str());
makeDir(outbasedir);
makeDir(logbasedir);
// makeDir(logbasedir);
selectsim(registry, outbasedir, logbasedir);
}
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