One way to evaluate the following sums is combining Table and Sum:
$u_{abcd} = \sum_{e=1}^3 v_{aeb}w_{ced}$
$q_{ab} = \sum_{d,e=1}^3 v_{d e a}w_{deb}$
It will look like
v = Table[Times[i, j, k], {i, 3}, {j, 3}, {k, 3}]
w = Table[Times[i+2, j-1, k+1], {i, 3}, {j, 3}, {k, 3}]
u = Table[Sum[v[[a, e, b]] w[[c, e, d]], {e, 3}], {a, 3}, {b, 3}, {c, 3}, {d, 3}]
q = Table[Sum[v[[d, e, a]] w[[d, e, b]], {d, 3}, {e, 3}], {a, 3}, {b, 3}]
Is there a more elegant way to evaluate sums like these?

Dotas inu2 = Outer[Dot[v[[#1, All, #2]], w[[#3, All, #4]]] &, Range[3], Range[3], Range[3], Range[3]]. – b.gatessucks Jan 14 at 15:27