implement matrix exponentials