summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--langevin.cpp20
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);