From 1b9a55a1436b98b6804bc3a140297093e98a30e7 Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Thu, 9 Dec 2021 15:06:47 +0100 Subject: Record numerically integrated length of the line. --- collectStokesData.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/collectStokesData.hpp b/collectStokesData.hpp index 50a43c5..b230ac6 100644 --- a/collectStokesData.hpp +++ b/collectStokesData.hpp @@ -96,16 +96,19 @@ void collectStokesData(std::string tag, unsigned N, Generator& r, Real ε, Real Real reConstraintError = 0; Real imConstraintError = 0; Real imEnergyError = 0; + Real ell = 0; for (unsigned i = 0; i < nTest; i++) { - Vector zi = c.f((i + 1.0) / (nTest + 1.0)); + Real t = (i + 1.0) / (nTest + 1.0); + Vector zi = c.f(t); imEnergyError += pow(std::imag(M.getHamiltonian(zi) - M.getHamiltonian(zMin)), 2); Complex constraintError = (Complex)(zi.transpose() * zi) - (Complex)N; reConstraintError += pow(real(constraintError), 2); imConstraintError += pow(imag(constraintError), 2); + ell += c.df(t).norm(); } - file << oldGs.size() << " " << c.totalCost(nTest) / (nTest) << " " << sqrt(imEnergyError / (Real)(nTest)) << " " << sqrt(reConstraintError / (Real)(nTest)) << " " << sqrt(imConstraintError / (Real)(nTest)) << std::endl; + file << oldGs.size() << " " << ell << " " << c.totalCost(nTest) / (nTest) << " " << sqrt(imEnergyError / (Real)(nTest)) << " " << sqrt(reConstraintError / (Real)(nTest)) << " " << sqrt(imConstraintError / (Real)(nTest)) << std::endl; for (const Vector& gi : c.gs) { file << gi.transpose() << std::endl; } -- cgit v1.2.3-54-g00ecf