# Flops of the computation of symmetric matrix $A$ to the power of $p$

What is the cost in terms of flops for the computation of $$A$$ to the power of $$p$$, where $$p$$ is a positive integer and $$A \in \mathbb R^{n\times n}$$ is a symmetric matrix?

• p is a positive integer – tchiki tchinka Apr 19 '20 at 10:50
• Welcome to scicomp. Have tried working it out for a small sizes? How many Operatiions do you need for a 2X2 symmetric matrix? If you have done that for a p=1,2,3 then you might be able to guess the underlying rule. What have you tried so far? – MPIchael Apr 20 '20 at 12:29
• Is $p$ small or large? – Wolfgang Bangerth Apr 20 '20 at 20:43
• p is small but A is a large matrix – tchiki tchinka Apr 21 '20 at 14:02

You can do this in $$O(n^3)$$ floating point operations by diagonalizing the matrix and applying the spectral theorem.