Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #5854

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

From Francois Grieu <fgrieu@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject MatrixPower works inconsistently for a matrix of elements of GF[p]
Date 2011-10-25 10:23 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j862mm$5t9$1@smc.vnet.net> (permalink)

Show all headers | View raw


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

Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

MatrixPower works inconsistently for a matrix of elements of GF[p] Francois Grieu <fgrieu@gmail.com> - 2011-10-25 10:23 +0000

csiph-web