MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Evaluating a polynomial on a matrix; matrix computations over a finite field

  • To: mathgroup at smc.vnet.net
  • Subject: [mg43146] Re: Evaluating a polynomial on a matrix; matrix computations over a finite field
  • From: <bitbucket at comcast.net>
  • Date: Thu, 14 Aug 2003 05:08:03 -0400 (EDT)
  • References: <bhd9c5$roj$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

In article <bhd9c5$roj$1 at smc.vnet.net>, Lot-o-fun <lotofun at hotmail.com>
wrote:

> How do I compute p(A), where p is a polynomial and A is a matrix?


   the following function, written for me by dave park, seems to work
fine.

PolyToMatrix::usage = 
    "PolyToMatrix[polynomial, matrix, var:\[Lambda]] will produce the \
polynomial in the matrix with the identity matrix used with the
constant \
term.";
PolyToMatrix[poly_, matrix_?MatrixQ, var_:\[Lambda]] :=
  
  Module[{clist, n = Length[matrix]},
    clist = CoefficientList[poly, var];
    Fold[#1 + #2\[LeftDoubleBracket]1\[RightDoubleBracket]MatrixPower[
              matrix, #2\[LeftDoubleBracket]2\[RightDoubleBracket]] &, 
      First[clist]IdentityMatrix[n], 
      Transpose[{Rest[clist], Range[Length[Rest[clist]]]}]]]

-- 
email is rip1 AT comcast.net


  • Prev by Date: Re: [newbie] can't get the answer
  • Next by Date: RE: [newbie] can't get the answer
  • Previous by thread: Re: Evaluating a polynomial on a matrix; matrix computations over a finite field
  • Next by thread: Re: Evaluating a polynomial on a matrix; matrix computations over a finite field