Skip to content

acb_ode, numerical solution of linear ODEs with polynomial coefficients - #2186

Open
mezzarobba wants to merge 25 commits into
flintlib:mainfrom
mezzarobba:holonomic
Open

mezzarobba wants to merge 25 commits into
flintlib:mainfrom
mezzarobba:holonomic

Conversation

@mezzarobba

@mezzarobba mezzarobba commented Jan 26, 2025 •

Copy link
Copy Markdown
Contributor

This PR adds the core of a new acb_ode module for solving linear differential equations with polynomial coefficients (in other words, evaluating holonomic functions).

The main feature at this stage is evaluation of fundamental matrices of differential operators within their disk of convergence (in other words, transition matrices for individual Taylor steps), including tail bounds and support for regular singular points. There is some limited support for analytic continuation along a path but no automatic path subdivision yet.

LLM usage: The library code added in this PR and its documentation are human-written, but I used LLMs for finding bugs, including via multiple rounds of LLM review of the module and its documentation. The tests are mostly LLM-generated (with one exception).

@mezzarobba

This comment was marked as outdated.

@mezzarobba

Copy link
Copy Markdown
Contributor Author

Note that @rburing has an implementation of more or less the same algorithm at https://gitlab.inria.fr/ricardo-thomas.buring/d-finite-fun, but

  • over generic rings,
  • for nonsingular first-order systems (vs regular singular equations here),
  • with a focus on computing truncated series (vs evaluating the sum).

@mezzarobba mezzarobba closed this May 6, 2026
@mezzarobba mezzarobba reopened this May 6, 2026
@mezzarobba mezzarobba changed the title [wip] divconquer summation for d-finite series acb_ode, numerical solution of linear ODEs with polynomial coefficients May 6, 2026
@mezzarobba
mezzarobba force-pushed the holonomic branch 2 times, most recently from 2d30eed to 1a5c356 Compare June 21, 2026 16:18
mezzarobba and others added 6 commits November 3, 2026 15:21
Mostly LLM-generated. More precisely:
- t-fundamental_matrix.c is mostly human-written;
- t-apply_diffop.c and t-sum_divconquer.c are full rewrites using LLMs
  of previous weaker human-written versions;
- all others are entirely or mostly LLM-generated.

Assisted-By: Claude Opus 4.8 <noreply@anthropic.com>
Assisted-By: Claude Opus 5 <noreply@anthropic.com>
Assisted-By: Claude Fable 5 <noreply@anthropic.com>
Assisted-By: Claude Haiku 5.5 <noreply@anthropic.com>
Assisted-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
@mezzarobba
mezzarobba marked this pull request as ready for review November 3, 2026 15:05
@mezzarobba

Copy link
Copy Markdown
Contributor Author

Ok, ready for review!

This PR doesn't exactly contain everything I originally wanted to include even in the first version, but I think it can be useful as is, and @simonbrandhorst says he and collaborators are waiting for it to be merged to use it in some research projects.

The code is full of todos to which I am planning to come back in follow-up PRs, hopefully in the near future. Same for additional high-level features, alternative algorithms, and optimizations.
(I have early drafts of a few things like analytic continuation along a path and evaluation of pFqs in local branches, but nothing really usable yet.)

@mezzarobba

Copy link
Copy Markdown
Contributor Author

hmm, is there any way I could get more information on the two failures than the little that appears in the logs?

@rburing

rburing commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

hmm, is there any way I could get more information on the two failures than the little that appears in the logs?

See #2180 (comment) for a Dockerfile and instructions to build/run FLINT with 32-bit musl.

(Generally it would be nice to make the test suite print the backtrace in case of a segfault.)

@simonbrandhorst

Copy link
Copy Markdown

Awsome! Can you point me at the public interface and its most important parts? Then I can take a look.

@mezzarobba

Copy link
Copy Markdown
Contributor Author

Thanks Ricardo!

@simonbrandhorst:

Awsome! Can you point me at the public interface and its most important parts? Then I can take a look.

Here is the rendered documentation:
acb_ode.tar.gz

The most important parts from a user perspective are the introduction and the first section (Evaluation of fundamental matrices). Depending on what you want to do, you may also be interested in the next two sections.

The key parts algorithmically and for advanced usage are Sections 4, 8, and 9.

The next things I am planning to add include functions for computing transition matrices along paths (both fixed and with adaptive subdivision) instead of just individual steps, and functions for non-rigorous evaluation in the style of existing acb_approx functions.

@mezzarobba

mezzarobba commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor Author
  • Added some basic analytic continuation code
  • Added an AI-generated command-line interface to it
  • Made the interface of a few internal functions a bit less awkward
  • Merged with main to solve conflicts with the addition of acb_mzeta in the Makefiles

…rams list

Assisted-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@mezzarobba

This comment was marked as outdated.

mezzarobba and others added 7 commits November 20, 2026 11:01
Automatically computed exponents were computed at the target precision
even when they entered into a recurrence that needed to be unrolled at a
higher working precision.
The new version estimates the precision needed for the iterative
computation of a linearly recurrent sequence based on the generic
asymptotic behavior of a majorant recurrence.

Also simplify acb_ode_solution_growth.
Move the tests of t-fundamental_matrix_vs_ref that relied on shifting
the operator by hand to a new file t-transition_matrix_fixed_vs_ref, and
add some more tests adapted from ore_algebra.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
@mezzarobba

Copy link
Copy Markdown
Contributor Author

The last batch of commits fix a number of precision management issues and improve some tests. There is one minor API change. I think I will now stop updating this PR except in response to comments or to fix outright bugs or conflicts with main) and carry on on separate PRs.

@mezzarobba
mezzarobba force-pushed the holonomic branch 2 times, most recently from dac75ba to fca439a Compare November 20, 2026 10:50
(the exact error bounds printed by the examples seem to depend on the
architecture or build options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants