Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

In short, the reason for appearance of FractionFieldElements is the base ring of matrix Mtx, which is R, making Sage think it divides polynomials. In reality, the elements of Mtx happens to be in k, which suggests a workaround of changing the ring of Mtx just before calling .solve_right():

Mtx = Mtx.change_ring(k)
yb=Mtx.solve_right(mbc)

In short, the reason for appearance of FractionFieldElements is the base ring of matrix Mtx, which is R, making Sage think it divides polynomials. In reality, the elements polynomials.

The easiest solution in this case is to use method .monomial_coefficient() instead of Mtx.coefficient() happens to for extracting polynomial coefficients so that they will be in k, which suggests a workaround of changing the ring of rather than in MtxR just before calling .solve_right():.

Mtx = Mtx.change_ring(k)
yb=Mtx.solve_right(mbc)