From 8b7c6b7247735483f369ca850b0f5c3cd3b753ae Mon Sep 17 00:00:00 2001 From: "Martin D. Weinberg" Date: Thu, 1 May 2025 15:40:05 -0400 Subject: [PATCH 1/4] Fix omitted norm in OrthoFunction::dumpOrtho() --- exputil/OrthoFunction.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exputil/OrthoFunction.cc b/exputil/OrthoFunction.cc index e0bf4f1f9..83dc83766 100644 --- a/exputil/OrthoFunction.cc +++ b/exputil/OrthoFunction.cc @@ -114,7 +114,7 @@ void OrthoFunction::dumpOrtho(const std::string& filename) // Eigen::VectorXd p = poly_eval(y, nmax) * W(r); fout << std::setw(16) << r; - for (int n=0; n Date: Sun, 4 May 2025 12:57:20 -0400 Subject: [PATCH 2/4] Fix code typo in version-toggled Eigen workaround for spherical coefficient packing --- expui/Coefficients.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/expui/Coefficients.cc b/expui/Coefficients.cc index c5dbb49cc..52d8f69e7 100644 --- a/expui/Coefficients.cc +++ b/expui/Coefficients.cc @@ -131,7 +131,7 @@ namespace CoefClasses in2.transposeInPlace(); for (size_t c=0, n=0; c Date: Fri, 9 May 2025 13:52:00 +0100 Subject: [PATCH 3/4] version bump only [no CI] --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f5742909..7f85582c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.25) # Needed for CUDA, MPI, and CTest features project( EXP - VERSION "7.8.3" + VERSION "7.8.4" HOMEPAGE_URL https://github.com/EXP-code/EXP LANGUAGES C CXX Fortran) From e55ffe94bb9900bb1dfd8507f1e6cf72ec28b28f Mon Sep 17 00:00:00 2001 From: "Martin D. Weinberg" Date: Fri, 9 May 2025 09:29:48 -0400 Subject: [PATCH 4/4] Added comments on normalization --- exputil/OrthoFunction.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/exputil/OrthoFunction.cc b/exputil/OrthoFunction.cc index 83dc83766..d7812a794 100644 --- a/exputil/OrthoFunction.cc +++ b/exputil/OrthoFunction.cc @@ -54,6 +54,7 @@ double OrthoFunction::scalar_prod(int n, int m) return ans; } +// Compute the unnormalized polynomial Eigen::VectorXd OrthoFunction::poly_eval(double t, int n) { Eigen::VectorXd ret(n+1); @@ -68,6 +69,8 @@ Eigen::VectorXd OrthoFunction::poly_eval(double t, int n) return ret; } +// Compute the orthogonality matrix. A perfect result is the unit +// matrix. Eigen::MatrixXd OrthoFunction::testOrtho() { Eigen::MatrixXd ret(nmax+1, nmax+1); @@ -80,10 +83,10 @@ Eigen::MatrixXd OrthoFunction::testOrtho() double f = dx*lq->weight(i)*d_r_to_x(x)*pow(r, dof-1); double y = 2.0*r/scale; if (segment) y = x; - // Evaluate polynomial + // Evaluate the unnormalized polynomial Eigen::VectorXd p = poly_eval(y, nmax) * W(r); - // Compute scalar products + // Compute scalar products with the normalizations for (int n1=0; n1<=nmax; n1++) { for (int n2=0; n2<=nmax; n2++) { ret(n1, n2) += f * p(n1) * p(n2) / sqrt(norm[n1]*norm[n2]); @@ -110,7 +113,7 @@ void OrthoFunction::dumpOrtho(const std::string& filename) double r = x_to_r(x); double y = 2.0*r/scale; if (segment) y = x; - // Evaluate polynomial + // Evaluate polynomial and apply the normalization // Eigen::VectorXd p = poly_eval(y, nmax) * W(r); fout << std::setw(16) << r; @@ -132,9 +135,11 @@ Eigen::VectorXd OrthoFunction::operator()(double r) double y = 2.0*r/scale; if (segment) y = r_to_x(r); - // Generate normalized orthogonal functions + // Generate normalized orthogonal functions with weighting auto p = poly_eval(y, nmax); for (int i=0; i<=nmax; i++) p(i) *= w/sqrt(norm[i]); + // The inner product of p(i), p(j) is Kronecker delta(i, j) + return p; }