What is a quadratic matrix to the 0th power?

m^0 should be the identity matrix. but most of my test matrices return a 0^0 Indeterminate error .

m={{1,-\[Sqrt]3,0},{\[Sqrt]3,-1,0},{0,0,1}};
m^0

I am just wondering what’s going on here.
Where I encountered this funny behavior:
I want to check if the infinite power series of a matrix returns the MatrixExp[]. The series starts with the 0th power.

Hi Raspi,

m^0 raises each element of the matrix to the power 0, which causes the Indeterminate. Use MatrixPower.

MatrixPower[m, 0]
(* {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}} *)

Hi Rohit, thanks so much for the helpful answer! I am feeling so beginner haha. I haven’t been doing maths with Mathematica other than high school level maths, the language keeps me busy already. I must have heard of MatrixPower before, but totally forgot about it. That happens when I only read about a function but never was in a RL case scenario where I had to come up with it on my own.

In[1]:= m = {{1, -\[Sqrt]3, 0}, {\[Sqrt]3, -1, 0}, {0, 0, 1}}
Out[1]= {{1, -Sqrt[3], 0}, {Sqrt[3], -1, 0}, {0, 0, 1}}

In[2]:= MatrixExp[m] // Simplify // N
Out[2]= {{0.8544, -1.20976, 0.}, {1.20976, -0.542512, 0.}, {0., 0., 2.71828}}

In[3]:= \!\(
\*UnderoverscriptBox[\(\[Sum]\), \(k = 0\), \(Infinity\)]
\*FractionBox[\(MatrixPower[m, k]\), \(k!\)]\) // FullSimplify // N
Out[3]= {{0.8544, -1.20976, 0.}, {1.20976, -0.542512, 0.}, {0., 0., 2.71828}}

My active vocabulary is growing very slowly. But with this thread I am sure that I won’t forget about the existence of the function in future.

Happy Holidays!!