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