Skip to content

Explain rational row reduction of integer matrices - #455

Closed
Parsnip37 wants to merge 1 commit into
flintlib:mainfrom
Parsnip37:docs/rational-row-reduction
Closed

Parsnip37 wants to merge 1 commit into
flintlib:mainfrom
Parsnip37:docs/rational-row-reduction

Conversation

@Parsnip37

Copy link
Copy Markdown
Contributor

fmpz_mat.rref() returns an integer numerator, a denominator and the rank. Its docstring lists these values without explicitly stating that the rational RREF is R/d.

Add a guide explaining the scaled pivots, the unreduced common denominator and inplace=True. Interpret the existing 3-by-3 example with a row-space argument, show conversion to fmpq_mat and its two-value rref() interface, and distinguish rational row reduction from preservation of the integer row lattice. Link to the FLINT RREF contract.

Related to #198; the guide describes the current API.

Validation:

  • Fresh full baseline and final Sphinx HTML renders generated HTML and both exited 1 with the same existing definition-list warning in gr_ctx.factor. Neither is a clean strict build. The guide adds no warning.
  • Used the source revision's configuration with -b html -W --keep-going -E -a, Python 3.12.3, Sphinx 9.1.1 and Furo 2025.12.19. Autodoc imported the published python-flint 0.9.0 package; the native checkout was not rebuilt.
  • Inspected the generated text, mathematical markup and API link destinations from disk. The row identities and lattice example are elementary mathematical arguments. The Python snippets were not executed. No tests, doctests, native builds or manual hosted workflows ran.

Comment thread doc/source/fmpz_mat.rst
Comment on lines +70 to +80
from flint import fmpq_mat, fmpz_mat

A = fmpz_mat([[0, 1, 2], [3, 4, 5], [6, 7, 8]])
R, d, r = A.rref()
B = fmpq_mat(R) / d

For this matrix, the :meth:`~flint.fmpz_mat.rref` example gives

.. math::

R = \begin{pmatrix}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better for this to be a doctest that displays the value of B.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants