MathGroup Archive 2011

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

Search the Archive

MatrixPower works inconsistently for a matrix of elements of GF[p]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg122329] MatrixPower works inconsistently for a matrix of elements of GF[p]
  • From: Francois Grieu <fgrieu at gmail.com>
  • Date: Tue, 25 Oct 2011 06:18:16 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

Hello,

I'm trying to evaluate powers of a square matrix of elements in GF[p].

I obtain mostly the correct result with MatrixPower, as follows.
However, some of the elements equal to 0 (mod p) are plain 0,
rather than elements of GF[p]; how could that be?


<<FiniteFields`;
m={
  {GF[5][{1}], GF[5][{1}]},
  {GF[5][{1}], GF[5][{0}]}
};
For[n=1,n<12,n++,Print["n=",n," ",MatrixPower[m,n]]];

gives:

n=1 {{Subscript[{1}, 5],Subscript[{1}, 5]},{Subscript[{1}, 5],Subscript[{0}, 5]}}
n=2 {{Subscript[{2}, 5],Subscript[{1}, 5]},{Subscript[{1}, 5],Subscript[{1}, 5]}}
n=3 {{Subscript[{3}, 5],Subscript[{2}, 5]},{Subscript[{2}, 5],Subscript[{1}, 5]}}
n=4 {{0,Subscript[{3}, 5]},{Subscript[{3}, 5],Subscript[{2}, 5]}}
n=5 {{Subscript[{3}, 5],0},{Subscript[{0}, 5],Subscript[{3}, 5]}}
n=6 {{Subscript[{3}, 5],Subscript[{3}, 5]},{Subscript[{3}, 5],0}}
n=7 {{Subscript[{1}, 5],Subscript[{3}, 5]},{Subscript[{3}, 5],Subscript[{3}, 5]}}
n=8 {{Subscript[{4}, 5],Subscript[{1}, 5]},{Subscript[{1}, 5],Subscript[{3}, 5]}}
n=9 {{0,Subscript[{4}, 5]},{Subscript[{4}, 5],Subscript[{1}, 5]}}
n=10 {{Subscript[{4}, 5],0},{0,Subscript[{4}, 5]}}
n=11 {{Subscript[{4}, 5],Subscript[{4}, 5]},{Subscript[{4}, 5],Subscript[{0}, 5]}}



Also, the power n in MatrixPower[m,n] is limited: MatrixPower[m, 2^31] fails,
although only 31 matrix multiplications are required to evaluate it; how comes?

TIA,

   Francois Grieu



  • Prev by Date: Re: Large control loops
  • Next by Date: Re: algebraic ReplaceAll?
  • Previous by thread: Re: Geometric series for matrices
  • Next by thread: language settings for date functions