diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2021-08-02 14:16:02 +0200 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2021-08-02 14:16:02 +0200 |
commit | 3e9beab27c343d1008199302e644c3e740d66592 (patch) | |
tree | ed72438ef841e15fbed6e230dd5ed7aa0a535ff3 /distinguishable.cpp | |
parent | 30d0fee3be1b899e93c5af7cf9de585071bacd44 (diff) | |
download | lattice_glass-3e9beab27c343d1008199302e644c3e740d66592.tar.gz lattice_glass-3e9beab27c343d1008199302e644c3e740d66592.tar.bz2 lattice_glass-3e9beab27c343d1008199302e644c3e740d66592.zip |
Effort started to compare energy autocorrelation time to self-inverse scattering.
Diffstat (limited to 'distinguishable.cpp')
-rw-r--r-- | distinguishable.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/distinguishable.cpp b/distinguishable.cpp index b739927..0aae0c1 100644 --- a/distinguishable.cpp +++ b/distinguishable.cpp @@ -1,6 +1,7 @@ #include <iostream> #include "glass.hpp" +#include "quantity.hpp" class DistinguishableState { public: @@ -71,6 +72,7 @@ int main() { } } + unsigned n = 1; for (double T = Tmax; T > Tmin; T -= δT) { @@ -86,6 +88,7 @@ int main() { std::cout << T << " "; s.setInitialPosition(); auto start = std::chrono::high_resolution_clock::now(); + Quantity<double> energy(1e3); for (unsigned i = 0; i < 1e5; i++) { for (unsigned j = 0; j < s.vertices.size(); j++) { s.tryRandomSwap(T, r); @@ -96,9 +99,10 @@ int main() { s.wolff(Transformation<D>(L, m, v.position - m * v.position), T, r); */ if (i % 10 == 0) { + energy.add(s.energy()); auto stop = std::chrono::high_resolution_clock::now(); auto duration = duration_cast<std::chrono::microseconds>(stop - start); - std::cout << duration.count() << " " << s.selfIntermediateScattering(ms) << " "; + std::cout /*<< duration.count() << " "*/ << s.selfIntermediateScattering(ms) << " "; } } /* @@ -110,6 +114,11 @@ int main() { } */ std::cout << std::endl; + std::vector<double> rho = energy.ρ(); + for (const double& x : rho) { + std::cout << x << " "; + } + std::cout << std::endl; std::cerr << T << " " << s.energy() / N << std::endl; // s.sweepLocal(r); // s.sweepSwap(r); |