The average amount of time required to travel between two points in a torus-like space
Don't write using namespace std;.
The constants including pi are provided in a standard header already.  If you did need to define a constant,  use constexpr.
double deltaa;
if (k == 0) {
        deltaa = 1;
      } else {
        deltaa = 0.5;
      }

That is much clear to write as:
const double deltaa = k==0 ? 1 : 0.5;

which also allows you to initialize the value in the declaration and make it const.
The block for deltaa and deltab are the same except for the parameter.  You should make a small inline function for that.
total = total + 0;

Why?
total = total + res;

Better to write total += res;

Generally:
Use const where you can.  Initialize variables in the statement where you declare them.
In addition to using const, which may allow the optimizer to better figure such things out on its own, consider hoisting subexpressions out of the loop.  For example pi * k does not change inside the nested loop so compute it once in the outer loop only.
Express your comments as preconditions (e.g. assert or Expect statements).

for (double i = 0; i &lt; size; i++) {
    series_res[i] = sumSij(half_a, half_b, xvec[i], yvec[i], a, b, coeff);
  }

Why is i of type double?  It's an index into the NumericArrays.
I see a call to sumSij but no call to sumAll.  The code is not complete, and doesn't agree with your comment (unless the former calls the latter, but I don't know how).