Closed MrVeka closed 1 week ago
Hi, I found some colone of the identity matrix is not completely left when using .row_reduce(eye="left") on matrices where the rank is less than the number of rows. Here is the left and right behavior :
.row_reduce(eye="left")
import galois import numpy as np GF = galois.GF(3) H = GF([[0, 2, 2, 2, 1, 0, 0, 0], [2, 0, 2, 2, 0, 1, 0, 0], [2, 1, 0, 2, 0, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0]]) H_rre = H.row_reduce(eye="left") print(H_rre, "rank:", np.linalg.matrix_rank(H), ", #row:", H.shape[0], end="\n") >>> [[1 0 1 0 1 1 1 0] [0 1 1 0 0 2 1 0] [0 0 0 1 2 1 2 0] [0 0 0 0 0 0 0 0]] rank: 3 , #row: 4
H_ = GF([[1, 0, 0, 0, 0, 2, 2, 2,], [0, 1, 0, 0, 2, 0, 2, 2,], [0, 0, 1, 0, 2, 1, 0, 2,], [0, 0, 0, 0, 0, 0, 0, 0,]]) H_rre_ = H_.row_reduce(eye="right") print(H_rre_, "rank:", np.linalg.matrix_rank(H_), ", #row:", H.shape[0]) >>> [[0 0 0 0 0 0 0 0] [2 1 0 0 2 1 0 0] [1 1 1 0 1 0 1 0] [2 1 2 0 0 0 0 1]] rank: 3 , #row: 4
Is it normal behavior?
seems normal, reduced row echelon form does not require the property that you suggest. See eg wikipedia.
I agree with @dimbleby. This is normal behavior of Gaussian Elimination / row reduction.
Hi, I found some colone of the identity matrix is not completely left when using
.row_reduce(eye="left")
on matrices where the rank is less than the number of rows. Here is the left and right behavior :Is it normal behavior?