SymmetricPolynomial
is the built-in way to get the sums you want:
vec = Table[q[i], {i, 4}];
SymmetricPolynomial[2, vec^k]
(* q[1]^k q[2]^k+q[1]^k q[3]^k+q[2]^k q[3]^k+q[1]^k q[4]^k+q[2]^k q[4]^k+q[3]^k q[4]^k *)
(But @Xavier 's way will help you understand Mathematica better.)
Update
To follow up on @ciao 's comment, if the values are numeric, then there are definitely better ways. For your example, the following works:
n = 4000;
k = 2;
vec = Abs[RandomVariate[NormalDistribution[1, 0.2], n]];
Timing[(Total[vec^k]^2 - Total[vec^(2 k)])/2]
(* {0.`,8.583920493183017`*^6} *)
Timing[SymmetricPolynomial[2, vec^k]]
(* {2.6364169`,8.583920493183037`*^6} *)
Note the difference in timing. The point is that one can determine such sums as you have using just using the sums of the powers of the vector elements.