summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2021-11-11 17:27:21 +0100
committerJaron Kent-Dobias <jaron@kent-dobias.com>2021-11-11 17:27:21 +0100
commit646dcb5b35afb2f7dbcdae59fe7280d2de91546c (patch)
treeaac24daf9cb58cdc8f505c22da27f1b7dd8e12e7
parent8c38676379b33ce4e3c80086c6063de12dd1d829 (diff)
downloadcode-646dcb5b35afb2f7dbcdae59fe7280d2de91546c.tar.gz
code-646dcb5b35afb2f7dbcdae59fe7280d2de91546c.tar.bz2
code-646dcb5b35afb2f7dbcdae59fe7280d2de91546c.zip
Added executable files for mixed p-spin.
-rw-r--r--mixedStokesFromMinima.cpp54
-rw-r--r--mixedStokesFromSaddles.cpp54
2 files changed, 108 insertions, 0 deletions
diff --git a/mixedStokesFromMinima.cpp b/mixedStokesFromMinima.cpp
new file mode 100644
index 0000000..f6d2cba
--- /dev/null
+++ b/mixedStokesFromMinima.cpp
@@ -0,0 +1,54 @@
+#include <getopt.h>
+#include <chrono>
+#include <fstream>
+
+#include "collectStokesData.hpp"
+
+#include "pcg-cpp/include/pcg_random.hpp"
+#include "randutils/randutils.hpp"
+#include "unsupported/Eigen/CXX11/src/Tensor/TensorFFT.h"
+
+#define PSPIN_P 3
+const int p = PSPIN_P; // polynomial degree of Hamiltonian
+
+using Rng = randutils::random_generator<pcg32>;
+
+int main(int argc, char* argv[]) {
+ // model parameters
+ unsigned N = 10; // number of spins
+ // simulation parameters
+ Real ε = 1e-15;
+ Real δ = 1;
+ unsigned n = 10;
+
+ int opt;
+
+ while ((opt = getopt(argc, argv, "N:e:d:n:")) != -1) {
+ switch (opt) {
+ case 'N':
+ N = (unsigned)atof(optarg);
+ break;
+ case 'e':
+ ε = atof(optarg);
+ break;
+ case 'd':
+ δ = atof(optarg);
+ break;
+ case 'n':
+ n = atof(optarg);
+ break;
+ default:
+ exit(1);
+ }
+ }
+
+ Rng r;
+
+ for (unsigned i = 0; i < n; i++) {
+ auto tag = std::chrono::high_resolution_clock::now();
+ std::ofstream output("stokes_" + std::to_string(tag.time_since_epoch().count()) + ".dat");
+ collectStokesData<2, 4>(output, N, r.engine(), ε, δ, true, 1.0, 0.01);
+ }
+
+ return 0;
+}
diff --git a/mixedStokesFromSaddles.cpp b/mixedStokesFromSaddles.cpp
new file mode 100644
index 0000000..2373146
--- /dev/null
+++ b/mixedStokesFromSaddles.cpp
@@ -0,0 +1,54 @@
+#include <getopt.h>
+#include <chrono>
+#include <fstream>
+
+#include "collectStokesData.hpp"
+
+#include "pcg-cpp/include/pcg_random.hpp"
+#include "randutils/randutils.hpp"
+#include "unsupported/Eigen/CXX11/src/Tensor/TensorFFT.h"
+
+#define PSPIN_P 3
+const int p = PSPIN_P; // polynomial degree of Hamiltonian
+
+using Rng = randutils::random_generator<pcg32>;
+
+int main(int argc, char* argv[]) {
+ // model parameters
+ unsigned N = 10; // number of spins
+ // simulation parameters
+ Real ε = 1e-15;
+ Real δ = 1;
+ unsigned n = 10;
+
+ int opt;
+
+ while ((opt = getopt(argc, argv, "N:e:d:n:")) != -1) {
+ switch (opt) {
+ case 'N':
+ N = (unsigned)atof(optarg);
+ break;
+ case 'e':
+ ε = atof(optarg);
+ break;
+ case 'd':
+ δ = atof(optarg);
+ break;
+ case 'n':
+ n = atof(optarg);
+ break;
+ default:
+ exit(1);
+ }
+ }
+
+ Rng r;
+
+ for (unsigned i = 0; i < n; i++) {
+ auto tag = std::chrono::high_resolution_clock::now();
+ std::ofstream output("stokes_" + std::to_string(tag.time_since_epoch().count()) + ".dat");
+ collectStokesData<2, 4>(output, N, r.engine(), ε, δ, false, 1.0, 0.01);
+ }
+
+ return 0;
+}