From 3183619c455b7e3ca2e365ffdf6ee50988d8c3c5 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Thu, 9 Dec 2021 14:49:07 +0100 Subject: Now looks for Stokes lines at an increasing radius from a small initial radius, independant of N. --- collectStokesData.hpp | 7 +++++-- mixedStokes.cpp | 6 +++--- pureStokes.cpp | 6 +++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/collectStokesData.hpp b/collectStokesData.hpp index b48c6bc..8b85d6b 100644 --- a/collectStokesData.hpp +++ b/collectStokesData.hpp @@ -5,7 +5,7 @@ using Complex = std::complex; template -void collectStokesData(std::string tag, unsigned N, Generator& r, Real ε, Real δz, bool minimum, T... μs) { +void collectStokesData(std::string tag, unsigned N, Generator& r, Real ε, Real δz₀, bool minimum, T... μs) { unsigned nIts = 5; unsigned nGs = 4; unsigned coDim = 16; @@ -38,9 +38,12 @@ void collectStokesData(std::string tag, unsigned N, Generator& r, Real ε, Real Vector zSaddle = zMin; + Real δz = δz₀; + while ((zSaddle - zMin).norm() < newSaddleThres * N || abs(imag(M.getHamiltonian(zSaddle))) < 1e-10) { - Vector z0 = normalize(zSaddle + N * δz * randomVector(N, d, r)); + Vector z0 = normalize(zSaddle + δz * randomVector(N, d, r)); zSaddle = findSaddle(M, z0, ε); + δz₀ *= 1.01; } Complex Hz; diff --git a/mixedStokes.cpp b/mixedStokes.cpp index 09a75b2..a437ff3 100644 --- a/mixedStokes.cpp +++ b/mixedStokes.cpp @@ -13,7 +13,7 @@ int main(int argc, char* argv[]) { unsigned N = 10; // number of spins // simulation parameters Real ε = 1e-15; - Real δ = 1; + Real δz₀ = 1e-3; unsigned n = 10; bool useMinima = false; @@ -28,7 +28,7 @@ int main(int argc, char* argv[]) { ε = atof(optarg); break; case 'd': - δ = atof(optarg); + δz₀ = atof(optarg); break; case 'n': n = atof(optarg); @@ -45,7 +45,7 @@ int main(int argc, char* argv[]) { for (unsigned i = 0; i < n; i++) { auto tag = std::chrono::high_resolution_clock::now(); - collectStokesData<2, 4>(std::to_string(tag.time_since_epoch().count()), N, r.engine(), ε, δ, useMinima, 1.0, 0.01); + collectStokesData<2, 4>(std::to_string(tag.time_since_epoch().count()), N, r.engine(), ε, δz₀, useMinima, 1.0, 0.01); } return 0; diff --git a/pureStokes.cpp b/pureStokes.cpp index a07dbbc..448d5ef 100644 --- a/pureStokes.cpp +++ b/pureStokes.cpp @@ -13,7 +13,7 @@ int main(int argc, char* argv[]) { unsigned N = 10; // number of spins // simulation parameters Real ε = 1e-15; - Real δ = 1; + Real δz₀ = 1e-3; unsigned n = 10; bool useMinima = false; @@ -28,7 +28,7 @@ int main(int argc, char* argv[]) { ε = atof(optarg); break; case 'd': - δ = atof(optarg); + δz₀ = atof(optarg); break; case 'n': n = atof(optarg); @@ -45,7 +45,7 @@ int main(int argc, char* argv[]) { for (unsigned i = 0; i < n; i++) { auto tag = std::chrono::high_resolution_clock::now(); - collectStokesData<3>(std::to_string(tag.time_since_epoch().count()), N, r.engine(), ε, δ, useMinima, 1.0); + collectStokesData<3>(std::to_string(tag.time_since_epoch().count()), N, r.engine(), ε, δz₀, useMinima, 1.0); } return 0; -- cgit v1.2.3-54-g00ecf