Applying a real or complex-valued function to a matrix, using matrix operations

I'm having difficulty applying real or complex-valued functions to matrices. For example let's define

Q = {{1,2,3},{2,3,1},{6,7,8}}


Then

PolyLog[-1,Q]


obviously returns

{{ComplexInfinity,2,3/4},{2,3/4,ComplexInfinity},{6/25,7/36,8/49}}


because it is doing the PolyLog on each entry of Q separately. However, what I really want is for the PolyLog[-1,z] expression, which evaluates to z/(1-z)^2, to be applied to Q as a matrix. That is, I want output that matches

Q.MatrixPower[Inverse[IdentityMatrix[3]-Q],2]


which returns

{{-17/20, -39/20, 7/10},{9/5,26/5,-8/5},{-11/10,-37/10,6/5}}


In my research, I need to iteratively evaluate polylogs of matrices, for n= -1, -2, -3, .... The problem is the huge difference in syntax for matrices vs. real or complex numbers. Is there any way to do this without manually rewriting the function in terms of the matrix syntax?

If not, is there a way to symbolically differentiate a function defined on a matrix (since you can get polylogs iteratively using differentiation)?

• Does MatrixFunction help? Commented Feb 13, 2017 at 18:24
• @bills - Just add RootReduce, i.e., MatrixFunction[PolyLog[-1, #] &, Q] // RootReduce Commented Feb 14, 2017 at 0:15
• @bill Perhaps you would case to post that as an Answer to take this off the unanswered list, or cast a close vote if you feel this is easily found in the documentation? Commented Mar 7, 2017 at 11:11

You can use MatrixFunction to force PolyLog to treat its arguments as a matrix.
q = {{1, 2, 3}, {2, 3, 1}, {6, 7, 8}};

As Bob Hanlon suggested, RootReduce gives the numerical quantities (instead of the root objects).