Skip to content

Converting a GF(9) matrix to a GF(3) matrix should be easier #6394

@fingolfin

Description

@fingolfin

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions