I was trying to evaluate the sum of $e^{-\pi(x^2+y^2+z^2)}$ over lattice points $(x,y,z)\in \mathbb{Z}^3$ that satisfies $2x+3y+5z=3$ using the following code.
c = 3;
{x0, y0, z0} = {x, y, z} /.
Flatten[FindInstance[2 x + 3 y + 5 z == c, {x, y, z}, Integers]];
NSum[Exp[-Pi ((x0 + u)^2 + (y0 + u + 5 v)^2 + (z0 - u -
3 v)^2)], {u, -Infinity, Infinity}, {v, -Infinity, Infinity}]
And I got the following error message:
NSum::nsnum: Summand (or its derivative) -1. 3.14159 (2. u-2. (-1. u-3. v)+2. (1. +u+5. v)) Exp[-3.14159 (u^2+(-1. u-3. v)^2+(1+u+5. v)^2)] is not numerical at point v = 15.
while it still outputted some answer
0.0450814
I read the help file of NSum, which states that NSum can be used to evaluate multi-dimensional sums, so why is that error message? Doesn't NSum use some method that work in multidimensional case directly instead of reducing the dimension one by one?
Another question is, with that error message, how reliable is the answer?
Boole[2 x + 3 y + 5 z == 3]
instead. $\endgroup$Boole[2 x + 3 y + 5 z == 3] Exp[-π (x^2 +y^2 +z^2)]
, considering you asked "how reliable is the answer". $\endgroup$