From d754b8720d7393b3b0ff2bc5e383668c161111b5 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Wed, 11 Dec 2019 17:38:00 -0500 Subject: some support for the denser temperatures around the transition in the main file, but values are currently hardcoded in --- hadamard.cpp | 24 +++++++++++++++--------- hadamard_pt.hpp | 8 +++++--- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/hadamard.cpp b/hadamard.cpp index 9364d3c..c26b558 100644 --- a/hadamard.cpp +++ b/hadamard.cpp @@ -56,7 +56,7 @@ int main(int argc, char* argv[]) { unsigned n_tuning = 1e2; double β0 = 1.00; double βf = 40.00; - unsigned num = 40; + unsigned num = 136; unsigned k = 2; double ε = 0.01; @@ -104,9 +104,12 @@ int main(int argc, char* argv[]) { } MeasureTransitionRates B(num); - range r = {β0, βf, num}; + range r1 = {0.0, 5.5, 44}; + range r2 = {5.5, 6.5, 80}; + range r3 = {6.5, 8, 12}; + auto rs = {r1, r2, r3}; - PT p({r}, n, B, As); + PT p(rs, n, B, As); for (MCMC& sim : p.Ms) { sim.M = walsh(k); @@ -120,8 +123,13 @@ int main(int argc, char* argv[]) { p.run(N, M); std::cout << "Finished " << n << ".\n"; - std::string filename = "probs_" + std::to_string(n) + "_" + std::to_string(β0) + "_" + - std::to_string(βf) + "_" + std::to_string(num) + ".dat"; + std::string rs_string = ""; + + for (range r : rs) { + rs_string += "_" + std::to_string(r.β0) + "_" + std::to_string(r.β1) + "_" + std::to_string(r.N); + } + + std::string filename = "probs_" + std::to_string(n) + rs_string + ".dat"; std::ifstream file(filename); unsigned N_old = 0; @@ -158,8 +166,7 @@ int main(int argc, char* argv[]) { file_out.close(); - std::string efilename = "energies_" + std::to_string(n) + "_" + std::to_string(β0) + "_" + - std::to_string(βf) + "_" + std::to_string(num) + ".dat"; + std::string efilename = "energies_" + std::to_string(n) + rs_string + ".dat"; std::ifstream efile(efilename); unsigned Ne_old = 0; @@ -187,8 +194,7 @@ int main(int argc, char* argv[]) { efile_out.close(); - std::string ρfilename = "rhos_" + std::to_string(n) + "_" + std::to_string(β0) + "_" + - std::to_string(βf) + "_" + std::to_string(num) + ".dat"; + std::string ρfilename = "rhos_" + std::to_string(n) + rs_string + ".dat"; std::ifstream ρfile(ρfilename); std::vector> ρdata_old(As.size()); diff --git a/hadamard_pt.hpp b/hadamard_pt.hpp index 744c866..0b32908 100644 --- a/hadamard_pt.hpp +++ b/hadamard_pt.hpp @@ -32,10 +32,12 @@ public: PT(std::list ranges, unsigned n, ParallelMeasurement& B, std::vector& As) : B(B), As(As) { + unsigned count = 0; for (range r : ranges) { - for (unsigned i = 0; i < r.N; i++) { - double β = r.β0 + i * (r.β1 - r.β0) / (r.N - 1); - Ms.push_back(MCMC(n, β, *As[i])); + for (unsigned i = 1; i <= r.N; i++) { + double β = r.β0 + i * (r.β1 - r.β0) / r.N; + Ms.push_back(MCMC(n, β, *As[count])); + count++; } } } -- cgit v1.2.3-70-g09d2