summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2021-12-09 15:06:47 +0100
committerJaron Kent-Dobias <jaron@kent-dobias.com>2021-12-09 15:06:47 +0100
commit1b9a55a1436b98b6804bc3a140297093e98a30e7 (patch)
treea09737d304c6ebdc39b4642846ffc8b7263829b1
parent1227d7bba8f6e25c99b93aa300b07918ecec2652 (diff)
downloadcode-1b9a55a1436b98b6804bc3a140297093e98a30e7.tar.gz
code-1b9a55a1436b98b6804bc3a140297093e98a30e7.tar.bz2
code-1b9a55a1436b98b6804bc3a140297093e98a30e7.zip
Record numerically integrated length of the line.
-rw-r--r--collectStokesData.hpp7
1 files 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<Complex> zi = c.f((i + 1.0) / (nTest + 1.0));
+ Real t = (i + 1.0) / (nTest + 1.0);
+ Vector<Complex> 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<Complex>& gi : c.gs) {
file << gi.transpose() << std::endl;
}