add matrix power and square root