Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exact integer nullspace of integer matrix?

nullspace(A) finds a basis for the null-space of a 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 compute an integer basis for an integer matrix in Julia?

Update: I get build errors with Nemo.jl (see comments to Dan Getz's answer). In the mean time, is there an alternative?

like image 604
becko Avatar asked Aug 31 '16 17:08

becko


People also ask

How do you find the Nullspace of a matrix?

To find the null space of a matrix, reduce it to echelon form as described earlier. To refresh your memory, the first nonzero elements in the rows of the echelon form are the pivots. Solve the homogeneous system by back substitution as also described earlier. To refresh your memory, you solve for the pivot variables.

What does it mean to be in the Nullspace of a matrix?

The null space of any matrix A consists of all the vectors B such that AB = 0 and B is not zero. It can also be thought as the solution obtained from AB = 0 where A is known matrix of size m x n and B is matrix to be found of size n x k .

What is the null of a matrix?

The null matrix is a matrix having zero as all its elements. The null matrix is also called a zero matrix, as all its elements are zero. The addition of a null matrix to any matrix does not change the value of the matrix, and hence the null matrix is also called the additive identity.


1 Answers

Nemo.jl is a package for algebra in Julia. It has a lot of functionality and should also allow to compute the null space. One way to go about it would be:

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)

After which d is the dimension of the nullspace and bmat has a basis in its columns.

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

like image 155
Dan Getz Avatar answered Oct 19 '22 06:10

Dan Getz