Exact integer zero space of an integer matrix?

nullspace(A) finds the basis for the zero space of the matrix A The returned vectors have floating point coordinates. If the matrix A is an integer matrix, the basis can be found in integer coordinates.

For example, in Mathematica

 NullSpace[RandomInteger[{-10, 10}, {3, 4}]] 

always returns integer vectors.

Is there a way to calculate an integer basis for an integer matrix in Julia?

Update: I get build errors using Nemo.jl (see comments on Dan Getz's answer). Meanwhile, is there an alternative?

+7
linear-algebra julia-lang
source share
1 answer

Nemo.jl is a package for algebra in Julia. It has many functions, and also allows you to calculate zero space. One way to do this:

 using Nemo # install with Pkg.add("Nemo") S = MatrixSpace(ZZ, 3, 4) mm = rand(-10:10,3,4) m = S(mm) (bmat,d) = nullspace(m) 

Then d is the dimension of zero space, and bmat has a basis in its columns.

Hope this helps (I would be glad to see alternative solutions, possibly using other algebra packages).

+7
source share

All Articles