diff options
-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); |