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}}



obviously returns


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


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)?

  • 3
    $\begingroup$ Does MatrixFunction help? $\endgroup$ – bill s Feb 13 '17 at 18:24
  • 1
    $\begingroup$ @bills - Just add RootReduce, i.e., MatrixFunction[PolyLog[-1, #] &, Q] // RootReduce $\endgroup$ – Bob Hanlon Feb 14 '17 at 0:15
  • $\begingroup$ @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? $\endgroup$ – Mr.Wizard Mar 7 '17 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}}; 
MatrixFunction[PolyLog[-1, #] &, q] // RootReduce

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

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


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.