Let's try some elementary row operations to see how they work. Evaluate the following code:
A = Matrix(QQ, [[1, 2, 3], [4, 5, 6], [7, 8, 9]]) print("Matrix A:") show(A) # Elementary row operations print("Scaling second row by two:") A.rescale_row(1, 2) show(A) print("Swapping first and second rows:") A.swap_rows(0, 1) show(A) print("Adding 3*(row 1) to row 0:") A.add_multiple_of_row(0, 1 ,3) show(A) print("A in echelon form:") show(A.echelon_form())
The result will look like this: