Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correcting series reversion doc #24245

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

maciejskorski
Copy link
Contributor

@maciejskorski maciejskorski commented Nov 11, 2022

Fixing some mistakes in the documentation.

References to other Issues or PRs

Fixes #24244.

Brief description of what is fixed or changed

Correcting typos and the algorithm logic.

Other comments

Draft a connection to Newton iterations? Would fix the missing reference.

Release Notes

  • polys
    • correcting docs in ring_series module

@sympy-bot
Copy link

sympy-bot commented Nov 11, 2022

Hi, I am the SymPy bot (v167). I'm here to help you write a release notes entry. Please read the guide on how to write release notes.

Your release notes are in good order.

Here is what the release notes will look like:

This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.12.

Click here to see the pull request description that was parsed.
<!-- Your title above should be a short description of what
was changed. Do not include the issue number in the title. -->

Fixing some mistakes in the documentation.

#### References to other Issues or PRs
<!-- If this pull request fixes an issue, write "Fixes #NNNN" in that exact
format, e.g. "Fixes #1234" (see
https://tinyurl.com/auto-closing for more information). Also, please
write a comment on that issue linking back to this pull request once it is
open. -->

Fixes #24244.

#### Brief description of what is fixed or changed

Correcting typos and the algorithm logic.

#### Other comments

Draft a connection to Newton iterations? Would fix the missing reference.

#### Release Notes

<!-- Write the release notes for this release below between the BEGIN and END
statements. The basic format is a bulleted list with the name of the subpackage
and the release note for this PR. For example:

* solvers
  * Added a new solver for logarithmic equations.

* functions
  * Fixed a bug with log of integers.

or if no release note(s) should be included use:

NO ENTRY

See https://github.com/sympy/sympy/wiki/Writing-Release-Notes for more
information on how to write release notes. The bot will check your release
notes automatically to see if they are formatted correctly. -->

<!-- BEGIN RELEASE NOTES -->

* polys
  * correcting docs in ring_series module

<!-- END RELEASE NOTES -->

@maciejskorski
Copy link
Contributor Author

Note: it would be good to add a reference too.

@oscarbenjamin
Copy link
Contributor

This docstring is generally not very well written. The point about "depending polynomially on other variables" is confusing. We can have arbitrary expressions as the coefficients:

In [4]: R, xr, yr = ring('x, y', EX)

In [5]: rs = EX(S.One)*xr + EX(tan(t)+sqrt(pi))*xr**2 + EX(1/sqrt(f(t)))*xr**3

In [6]: rs.as_expr()
Out[6]: 
    3                          
   x        2                  
──────── + x ⋅(tan(t) +π) + x
  ______                       
╲╱ f(t)                        

In [8]: from sympy.polys.ring_series import rs_series_reversion

In [9]: result = rs_series_reversion(rs, xr, 3, yr)

In [10]: result.as_expr()
Out[10]: 
 2                   
y ⋅(-tan(t) -π) + y

In [11]: result = rs_series_reversion(rs, xr, 4, yr)

In [12]: result.as_expr()
Out[12]: 
 32                             12                   
y ⋅⎜2tan (t) + 4⋅√πtan(t) + 2π - ────────⎟ + y ⋅(-tan(t) -π) + y______⎟                        
   ⎝                                ╲╱ f(t) ⎠  

@maciejskorski
Copy link
Contributor Author

maciejskorski commented Nov 12, 2022

This docstring is generally not very well written. The point about "depending polynomially on other variables" is confusing. We can have arbitrary expressions as the coefficients:

Thanks, could you share a minimal working example - with valid imports etc?

@oscarbenjamin
Copy link
Contributor

Thanks, could you share a minimal working example - with valid imports etc?

Those examples come from isympy which does this when you run it:

These commands were executed:
>>> from sympy import *
>>> x, y, z, t = symbols('x y z t')
>>> k, m, n = symbols('k m n', integer=True)
>>> f, g, h = symbols('f g h', cls=Function)
>>> init_printing()

The easiest way to run those imports is just to run isympy from the terminal.

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.

mistakes in series reversion docstrings
3 participants