From 6482fcaf4e5d8ede27d9492ed08e6bc81b28b418 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Thu, 25 Feb 2021 16:23:13 +0100 Subject: More changes. --- langevin.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'langevin.cpp') diff --git a/langevin.cpp b/langevin.cpp index 8c191f3..e5b370c 100644 --- a/langevin.cpp +++ b/langevin.cpp @@ -37,7 +37,7 @@ std::list> saddlesCloserThan(const std::unordered_m template std::tuple matchImaginaryEnergies(const ComplexTensor& J0, const ComplexVector& z10, const ComplexVector& z20, Real ε, Real Δ, Generator& r) { - Real σ = sqrt(factorial(p) / (2.0 * pow(z10.size(), p - 1))); + Real σ = sqrt(factorial(p) / (Real(2) * pow(z10.size(), p - 1))); complex_normal_distribution dJ(0, σ, 0); ComplexTensor J = J0; @@ -46,7 +46,7 @@ std::tuple matchImaginaryEnergies(c std::tie(H1, std::ignore, std::ignore) = hamGradHess(J, z10); std::tie(H2, std::ignore, std::ignore) = hamGradHess(J, z20); Real prevdist = abs(imag(H1-H2)); - Real γ = 0.1 * prevdist; + Real γ = prevdist / 10; std::function)> perturbJ = [&γ, &dJ, &r] (ComplexTensor& JJ, std::array ind) { @@ -67,13 +67,12 @@ std::tuple matchImaginaryEnergies(c std::tie(H1, std::ignore, std::ignore) = hamGradHess(Jp, z1); std::tie(H2, std::ignore, std::ignore) = hamGradHess(Jp, z2); - if (abs(imag(H1 - H2)) < prevdist && dist > 1e-2) { + if (abs(imag(H1 - H2)) < prevdist && dist > Real(1) / 100) { J = Jp; prevdist = abs(imag(H1 - H2)); - γ = 0.1 * prevdist; - std::cerr << prevdist << std::endl; + γ = prevdist / 10; - if (abs(imag(H1 - H2)) < ε && dist > 1e-2) { + if (abs(imag(H1 - H2)) < ε && dist > Real(1) / 100) { break; } } @@ -140,7 +139,7 @@ int main(int argc, char* argv[]) { } Complex κ(Rκ, Iκ); - Real σ = sqrt(factorial(p) / (2.0 * pow(N, p - 1))); + Real σ = sqrt(factorial(p) / ((Real)2 * pow(N, p - 1))); Rng r; @@ -185,7 +184,9 @@ int main(int argc, char* argv[]) { ComplexVector z1 = nearbySaddles.front()[0]; ComplexVector z2 = nearbySaddles.front()[1]; - std::tie(J, z1, z2) = matchImaginaryEnergies(J, z1, z2, 1e-14, ε, r); + std::tie(J, z1, z2) = matchImaginaryEnergies(J, z1, z2, 1e-15, ε, r); + + std::cerr << "Im H is now sufficently close, starting to relax rope." << std::endl; Rope stokes(10, z1, z2, J); -- cgit v1.2.3-70-g09d2