How to make check matrix H when you have generator matrix (algorithm)

324 Views Asked by At

It's all built on top of python numpy lib. So we have a class finite field and get access to elements of field like Finite_field[index_of_element]. Elements of field are numpy matrices(ndarray). For a linear code it's given matrix G so G can be generated. And our G is ndarray of nrarrays. It think it's legal in numpy.

But to get H matrix we should 'solve' G matrix as $GH ^ \intercal = 0$. And numpy provides a solution you say as some function. But we can not divide in our class.

Any ideas?

Also if you have programmed codes in different environment and could recommend something it will be very appreciated. Cause I've heard about sympy, sage, etc., but thought that numpy will be great for such a task.

Thank you!

1

There are 1 best solutions below

0
On

You can form a generator matrix $G=(I\mid A)$ where $I$ is the identity matrix, by row eliminiation (and eventually by column permutations). Then as said, $H=(-A^T\mid I)$ is a parity check matrix, since $GH^T=0$.