summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2021-12-09 14:49:07 +0100
committerJaron Kent-Dobias <jaron@kent-dobias.com>2021-12-09 14:49:07 +0100
commit3183619c455b7e3ca2e365ffdf6ee50988d8c3c5 (patch)
tree82a61c3829010b203d6aee666375db42a3666bf1
parent61ee450ddf82c6206ac3e55dd5e064d5002e57fe (diff)
downloadcode-3183619c455b7e3ca2e365ffdf6ee50988d8c3c5.tar.gz
code-3183619c455b7e3ca2e365ffdf6ee50988d8c3c5.tar.bz2
code-3183619c455b7e3ca2e365ffdf6ee50988d8c3c5.zip
Now looks for Stokes lines at an increasing radius from a small initial radius, independant of N.
-rw-r--r--collectStokesData.hpp7
-rw-r--r--mixedStokes.cpp6
-rw-r--r--pureStokes.cpp6
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<Real>;
template<int ...ps, class Generator, typename... T>
-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<Complex> zSaddle = zMin;
+ Real δz = δz₀;
+
while ((zSaddle - zMin).norm() < newSaddleThres * N || abs(imag(M.getHamiltonian(zSaddle))) < 1e-10) {
- Vector<Complex> z0 = normalize(zSaddle + N * δz * randomVector<Complex>(N, d, r));
+ Vector<Complex> z0 = normalize(zSaddle + δz * randomVector<Complex>(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;