Skip to content

Calling NullspaceMat with Matrix Object on Zero/Invertible Matrix behaves unexpectedly #6622

Open

Description

@GalaxyCo

Calling

gap> A := Matrix(IsPlistMatrixRep, GF(5), [ [ 0*Z(5), 0*Z(5), 0*Z(5), 0*Z(5) ], [ 0*Z(5), 0*Z(5), 0*Z(5), 0*Z(5) ], [ 0*Z(5), 0*Z(5), 0*Z(5), 0*Z(5) ], [ 0*Z(5), 0*Z(5), 0*Z(5), 0*Z(5) ] ]);
<4x4-matrix over GF(5)>
gap> NullspaceMat(A);
[ [ Z(5)^0, 0*Z(5), 0*Z(5), 0*Z(5) ], [ 0*Z(5), Z(5)^0, 0*Z(5), 0*Z(5) ], [ 0*Z(5), 0*Z(5), Z(5)^0, 0*Z(5) ],
  [ 0*Z(5), 0*Z(5), 0*Z(5), Z(5)^0 ] ]
gap> NullspaceMatDestructive(A);
[ [ Z(5)^0, 0*Z(5), 0*Z(5), 0*Z(5) ], [ 0*Z(5), Z(5)^0, 0*Z(5), 0*Z(5) ], [ 0*Z(5), 0*Z(5), Z(5)^0, 0*Z(5) ],
  [ 0*Z(5), 0*Z(5), 0*Z(5), Z(5)^0 ] ]

does not yield a matrix obj of full rank and similarly calling

gap>  A := PseudoRandom(GL(4, 5));
   NullspaceMat(A);[ [ 0*Z(5), Z(5)^3, Z(5)^2, Z(5) ], [ Z(5)^2, Z(5)^2, 0*Z(5), 0*Z(5) ], [ Z(5)^0, 0*Z(5), Z(5)^2, Z(5)^3 ],
  [ Z(5)^2, Z(5)^2, Z(5), Z(5)^0 ] ]
gap>       A := Matrix(IsPlistMatrixRep, GF(5), A);
<4x4-matrix over GF(5)>
gap>       NullspaceMat(A);
[  ]
gap> NullspaceMatDestructive(A);
[  ]

also does not yield a matrix obj

Activity

  1. added
    kind: bugIssues describing general bugs, and PRs fixing them
    kind: bug: wrong resultIssues describing bugs that result in mathematically or otherwise wrong results, and PRs fixing them
    on Sep 29, 2026
  2. ThomasBreuer commented on Sep 29, 2026

    @ThomasBreuer
    Contributor

    Thanks.
    I will create a pull request for fixing this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: bugIssues describing general bugs, and PRs fixing themkind: bug: wrong resultIssues describing bugs that result in mathematically or otherwise wrong results, and PRs fixing them

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions