I have an identity matrix over GF(9); I'd like to rewrite it to a GF(3) matrix; that is mathematically possible and sane. But surprisingly hard in GAP:
gap> m:=IdentityMat(1,GF(9));
[ [ Z(3)^0 ] ]
gap> ConvertToMatrixRep(m,3);
Error, ConvertToMatrixRep( <mat>, <q> ): not all entries of <mat> written over <q>
gap> Matrix(GF(3), m);
Error, ConvertToMatrixRep( <mat>, <q> ): not all entries of <mat> written over <q>
gap> ChangedBaseDomain(m, GF(3));
Error, ConvertToMatrixRep( <mat>, <q> ): not all entries of <mat> written over <q>
gap> Matrix(GF(3), List(m,List)); # works but is super inefficient
[ [ Z(3)^0 ] ]
Of course that wasn't a true compressed matrix, but rather a list of compressed vectors (well, one).
If we first convert to an actual compressed matrix, we fair slightly better (?), in that now ChangedBaseDomain works (yay), and ConvertToMatrixRep returns fail instead of raising an error (is that better or worse, though).
gap> ConvertToMatrixRep(m);
9
gap> m;
[ [ Z(3)^0 ] ]
gap> Is8BitMatrixRep(m);
true
gap> BaseDomain(m);
GF(3^2)
gap> ConvertToMatrixRep(m,3);
fail
gap> Matrix(GF(3), m);
Error, ConvertToMatrixRep( <mat>, <q> ): not all entries of <mat> written over <q>
gap> m2:=ChangedBaseDomain(m, GF(3));
[ [ Z(3)^0 ] ]
gap> Is8BitMatrixRep(m2);
true
gap> BaseDomain(m2);
GF(3)
I have an identity matrix over GF(9); I'd like to rewrite it to a GF(3) matrix; that is mathematically possible and sane. But surprisingly hard in GAP:
Of course that wasn't a true compressed matrix, but rather a list of compressed vectors (well, one).
If we first convert to an actual compressed matrix, we fair slightly better (?), in that now
ChangedBaseDomainworks (yay), andConvertToMatrixRepreturnsfailinstead of raising an error (is that better or worse, though).