diff options
author | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2021-02-12 09:21:09 +0100 |
---|---|---|
committer | Jaron Kent-Dobias <jaron@kent-dobias.com> | 2021-02-12 09:21:09 +0100 |
commit | 2a98d566247da745947d16b103c12842b3a5389b (patch) | |
tree | 12f18377816fe0d8f2ab11b500c14cef7e5affd0 | |
parent | 09fff09004b4e3350ef369d08c9113ea235df777 (diff) | |
download | code-2a98d566247da745947d16b103c12842b3a5389b.tar.gz code-2a98d566247da745947d16b103c12842b3a5389b.tar.bz2 code-2a98d566247da745947d16b103c12842b3a5389b.zip |
Revert "Added code to try and find critical points at very large a."
This reverts commit 388449d66164fe8b5595cf11dbc0f3aa116ef36d.
-rw-r--r-- | langevin.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/langevin.cpp b/langevin.cpp index 38ef3d9..5ca2d72 100644 --- a/langevin.cpp +++ b/langevin.cpp @@ -92,24 +92,26 @@ int main(int argc, char* argv[]) { return W; }; - double aGoal = 1e2; + double aGoal = 1e3; std::function<double(const ComplexTensor&, const ComplexVector&)> energyInvA = [aGoal] (const ComplexTensor& J, const ComplexVector& z) { - return 0; + double a = z.squaredNorm(); + if (a > aGoal) { + return -aGoal; + } else { + return -z.squaredNorm(); + } }; - while (zSaddle.squaredNorm() / z.size() < aGoal) { - std::tie(std::ignore, z) = metropolis(J, z, energyInvA, T, 0.1, M, d, r.engine()); + while (zSaddle.squaredNorm() < aGoal) { + std::tie(std::ignore, z) = metropolis(J, z, energyInvA, T, γ, 100, d, r.engine()); try { - std::cerr << "Starting descent from " << z.squaredNorm() / z.size() << "." << std::endl; + std::cerr << "Starting descent from " << z.squaredNorm() << "." << std::endl; zSaddle = findSaddle(J, z, ε); } catch (std::exception& e) { } - std::cerr << "Current saddle is of size " << zSaddle.squaredNorm() / z.size() << "." << std::endl; - Complex energy; - std::tie(energy, std::ignore, std::ignore) = hamGradHess(J, zSaddle); - std::cout << zSaddle.squaredNorm() / z.size() << " " << energy.real() / z.size() << " " << energy.imag() / z.size() << std::endl; + std::cerr << "Current saddle is of size " << zSaddle.squaredNorm() << "." << std::endl; } ComplexVector zSaddlePrev = ComplexVector::Zero(N); |