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
Define Is meromorphic #19306
Define Is meromorphic #19306
Conversation
Sums and products of meromorphic functions are meromorphic. This implementation returns True if all terms of a sum or factors of a product are meromorphic, and False if exactly one term or factor is not meromorphic. Otherwise it returns None as the singularities of several functions may cancel.
There are two kinds of powers that are meromorphic. If the exponent is an integer, then the power is meromorphic if and only if the base is meromorphic. More generally, a power is meromorphic if both base and exponent are meromorphic and finite and, in addition, base is nonzero.
Most functions defined in SymPy are meromorphic with a few essential singularities or branch points. A private attribute, ``_singularities``, is added to function classes. For meromorphic functions, it is a finite iterator that contains the essential singularities and branch points. It may also be ``True``, ``False`` or ``None``, in which case it will be the return value of ``is_meromorphic``.
✅ Hi, I am the SymPy bot (v158). 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.7. Note: This comment will be updated with the latest check if you edit the pull request. You need to reload the page to see it. Click here to see the pull request description that was parsed.
Update The release notes on the wiki have been updated. |
This looks useful but I wonder if it should be a method on all of Expr firstly because there are too many methods on Expr but also because I'm not sure it can make sense for all of Expr e.g.: In [1]: M = MatrixSymbol('M', 2, 2)
In [2]: M.is_meromorphic(x, 0)
Out[2]: True Maybe |
Maybe
|
Codecov Report
@@ Coverage Diff @@
## master #19306 +/- ##
=============================================
- Coverage 75.595% 71.382% -4.213%
=============================================
Files 651 651
Lines 169536 169483 -53
Branches 40015 39988 -27
=============================================
- Hits 128161 120981 -7180
- Misses 35755 42754 +6999
- Partials 5620 5748 +128 |
Is this correct? In [23]: sqrt(x).is_meromorphic(x, -1)
Out[23]: True |
Yes, the two branches of |
Is this correct: In [14]: x = Symbol('x', real=True)
In [15]: sqrt(-1 +I*x).limit(x, 0)
Out[15]: ⅈ
In [16]: sqrt(-1 +I*x).limit(x, 0, '+')
Out[16]: ⅈ
In [17]: sqrt(-1 +I*x).limit(x, 0, '-')
Out[17]: ⅈ
In [18]: sqrt(-1 + I*1e-10).n()
Out[18]: 5.0e-11 + 1.0⋅ⅈ
In [19]: sqrt(-1 - I*1e-10).n()
Out[19]: 5.0e-11 - 1.0⋅ⅈ Should the limit not be different in the two directions approaching the branch cut? |
That is something that |
I guess I don't really understand what meromorphic means if the sqrt function defined in this way can be meromorphic on the negative reals. Wikipedia says:
https://en.wikipedia.org/wiki/Meromorphic_function Here we talk about being meromorphic at a point which presumably means in a neighbourhood of that point so The |
I am used to consider multivalued functions meromorphic at point if all its branches are meromorphic. Some mechanism should be implemented for choosing the branch at a branch cut. I have made an attempt towards that in #14715. Some methods like |
Perhaps a definition of meromorphic could be given in the docstring with the |
That looks like a good idea. |
Looks good to me |
Thanks, @oscarbenjamin |
References to other Issues or PRs
See #8320
Brief description of what is fixed or changed
Added a new method,
.is_meromorphic(x, a)
to check whether an expression is ameromorphic function of
x
ata
.Other comments
Limits of meromorphic functions can be easily found from the leading terms of their Laurent
series expansions. There is some heuristic in
Limit.doit()
for that purpose (if all(ok(w) ...)
)but in most cases the limit will be handled by
gruntz
. That will make a change of variablesintroducing an essential singularity and consequently increasing the difficulty of finding a limit.
This method can be used to cover most cases where the limit can be found from the leading
term.
Release Notes
is_meromorphic
is added.