Divided matrixPowers kernel into two parts: a mapper and a computing section

It is faster than the standard implementation if s is small