summaryrefslogtreecommitdiff
path: root/langevin.cpp
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2021-02-25 16:23:13 +0100
committerJaron Kent-Dobias <jaron@kent-dobias.com>2021-02-25 16:23:13 +0100
commit6482fcaf4e5d8ede27d9492ed08e6bc81b28b418 (patch)
tree9653bcb04ca148e85d5f494664f276a9ac828713 /langevin.cpp
parent3276bdd1e9796fec71e169e6c41d77da72b3a4fb (diff)
downloadcode-6482fcaf4e5d8ede27d9492ed08e6bc81b28b418.tar.gz
code-6482fcaf4e5d8ede27d9492ed08e6bc81b28b418.tar.bz2
code-6482fcaf4e5d8ede27d9492ed08e6bc81b28b418.zip
More changes.
Diffstat (limited to 'langevin.cpp')
-rw-r--r--langevin.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/langevin.cpp b/langevin.cpp
index 8c191f3..e5b370c 100644
--- a/langevin.cpp
+++ b/langevin.cpp
@@ -37,7 +37,7 @@ std::list<std::array<ComplexVector, 2>> saddlesCloserThan(const std::unordered_m
template <class Generator>
std::tuple<ComplexTensor, ComplexVector, ComplexVector> 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<Real> dJ(0, σ, 0);
ComplexTensor J = J0;
@@ -46,7 +46,7 @@ std::tuple<ComplexTensor, ComplexVector, ComplexVector> 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<void(ComplexTensor&, std::array<unsigned, p>)> perturbJ =
[&γ, &dJ, &r] (ComplexTensor& JJ, std::array<unsigned, p> ind) {
@@ -67,13 +67,12 @@ std::tuple<ComplexTensor, ComplexVector, ComplexVector> 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);