Hi,
My name is Danielle Lam and I want to share my understanding of the proposed GSoC project before the deadline.
The Problem
FriCAS has sequence guessing routines (1)guessPRec 2)guessRat 3)guessADE) that infer generating functions from a list of numbers. However, their output cannot currently be used in SageMath (calling .sage() raises a NotImplementedError for the three internal fricas representations 1)FEseries 2)rootOfRec 3)rootOfADE)
My Proposed Solution
SageMath's existing _sage_() method in sage/interfaces/fricas.py already handles polynomials, matrices, and expressions. I plan to extend it by implementing three converter functions ( one for each FriCAS output type) and registering them via the existing register_symbol()
infrastructure:
- convert_FEseries: parses a rational generating function and returns a LazyPowerSeriesRing element via division
- convert_rootOfRec: extracts the recurrence relation and initial conditions, builds a coefficient function, and returns a lazy series via L(get_nth_coefficient, valuation=0)
- convert_rootOfADE: translates the differential equation into SageMath form using L.undefined() and f.define(), substituting derivatives appropriately
The goal is that after this work, a user can write:
fricas.guessPRec([1,1,2,5,14,42]).sage().coefficient(100)
and get a result immediately without Sage throwing an error
Implementation Order
I plan to implement FEseries first (simplest), then rootOfRec, then rootOfADE, with doctests at each stage.
I noticed the comment that rootOfADE should be removed once fully on FriCAS 1.3.10+, and FriCAS is now on 1.3.13. Does this mean rootOfADE no longer appears in output? And if so, what representation does guessADE use now in the current version?
I would be grateful for your feedback on this approach, and particularly whether my understanding of the rootOfRec and rootOfADE argument structures is correct. I plan to run interception experiments to inspect the parsed arguments before writing the converters.
I look forward to hearing from you!
Best regards,
Danielle Lam