Skip to content

Introduce rational numbers and harmonic sums - #454

Closed
Parsnip37 wants to merge 2 commits into
flintlib:mainfrom
Parsnip37:docs/harmonic-number-guide
Closed

Parsnip37 wants to merge 2 commits into
flintlib:mainfrom
Parsnip37:docs/harmonic-number-guide

Conversation

@Parsnip37

@Parsnip37 Parsnip37 commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

The fmpq page currently provides only an API reference. Introduce exact rational numbers, canonical numerator and denominator, construction from integers and fraction strings, and basic arithmetic with worked values.

Then define ordinary and generalized harmonic numbers, including their domains and the empty sum. Explain the exact recurrence recommended in the discussion of #265, with a worked prefix through H_{4,2} = 205/144.

Derive the Hurwitz-zeta identity for integer m > 1 by splitting its convergent defining series, cite DLMF 25.11.4, and explain the poles at m = 1. Distinguish real-ball evaluation with arb.zeta from the exact rational recurrence.

Related to #265; this documents existing arithmetic rather than adding a generalized harmonic-number API or caching.

Validation:

  • Fresh full Sphinx HTML renders of the previous published revision and this revision generated HTML and both exited 1 with the same existing definition-list warning in gr_ctx.factor. Neither is a clean strict build. The introduction adds no warning. Earlier baseline and render logs remain preserved.
  • 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 arithmetic examples, recurrence and rational sums were checked by mathematical reasoning. The displayed Python snippets and zeta expression were not executed. No software tests, doctests, native builds or manual hosted workflows ran.

Comment thread doc/source/fmpq.rst
**fmpq** -- rational numbers
===============================================================================

Harmonic numbers

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.

Similar to previous PR there should be some docs for fmpq itself before jumping into special topics.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added a construction and arithmetic section before harmonic numbers in 71ce29c. It covers reduced fractions, integer and fraction-string construction, numerator/denominator access, and exact arithmetic.

@Parsnip37 Parsnip37 changed the title Document exact generalized harmonic sums Introduce rational numbers and harmonic sums Nov 25, 2026
@oscarbenjamin

Copy link
Copy Markdown
Collaborator

I don't know who you are but you seem like a bot and I'm not interested in interacting with bots so closing.

@Parsnip37

Copy link
Copy Markdown
Contributor Author

Hi Oscar, I’m a real person and I’ve reviewed both contributions. I’m happy to discuss the mathematics and address your feedback directly.

I’d like to continue contributing to python-flint. Would you be open to continuing the conversation?

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