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

Bug in Maxima interface wrt polylog #21907

Closed
rwst opened this issue Nov 20, 2016 · 15 comments
Closed

Bug in Maxima interface wrt polylog #21907

rwst opened this issue Nov 20, 2016 · 15 comments

Comments

@rwst
Copy link

rwst commented Nov 20, 2016

sage: bool(x*polylog(x,x)==0)
...
/home/ralf/sage/local/lib/python2.7/site-packages/sage/symbolic/expression_conversions.pyc in composition(self, ex, operator)
    644         #FIXME: consider stripping pyobjects() in ops
    645         if hasattr(operator, self.name_init + "evaled_"):
--> 646             return getattr(operator, self.name_init + "evaled_")(*ops)
    647         else:
    648             ops = [self(_) for _ in ops]

/home/ralf/sage/local/lib/python2.7/site-packages/sage/functions/log.pyc in _maxima_init_evaled_(self, *args)
    451 
    452         n, x = args_maxima
--> 453         if int(n) in [1,2,3]:
    454             return 'li[%s](%s)'%(n, x)
    455         else:

ValueError: invalid literal for int() with base 10: '_SAGE_VAR_x'

Component: symbolics

Author: Frédéric Chapoton

Branch/Commit: 8f4f726

Reviewer: Dave Morris

Issue created by migration from https://trac.sagemath.org/ticket/21907

@rwst rwst added this to the sage-7.5 milestone Nov 20, 2016
@fchapoton
Copy link
Contributor

comment:1

This seems to be invalid. polylog(x,x) is not correct, the first argument must be an integer.

Of course, one could ask for a better error message.

https://doc.sagemath.org/html/en/reference/functions/sage/functions/log.html?#sage.functions.log.Function_polylog

@fchapoton fchapoton removed this from the sage-7.5 milestone Dec 26, 2020
@DaveWitteMorris
Copy link
Member

comment:2

I don't understand. The documentation seems to clearly state that non-integral values are allowed:

This definition is valid for arbitrary complex order s and for all complex 
arguments z with |z|<1; it can be extended to |z|≥1 by the process of analytic 
continuation.

And non-integral values are accepted in my testing:

sage: polylog(1.1 + 2.2*I, 3.3 + 4.4*I)                                                        
-13.9758786469542 + 8.16803654165145*I

PS I think the documentation should tell us which parameter is s and which is z. (And I find the phrase "complex order s" to be confusing.)

@fchapoton
Copy link
Contributor

comment:3

This seems to work fine in 9.3.beta6, for some reason.

@fchapoton
Copy link
Contributor

comment:4

Here is a branch adding a doctest, and cleaning the file "en passant".


New commits:

88acb4ccleanup the log file, plus one doctest for polylog

@fchapoton
Copy link
Contributor

Branch: u/chapoton/21907

@fchapoton
Copy link
Contributor

Commit: 88acb4c

@fchapoton
Copy link
Contributor

Author: Frédéric Chapoton

@fchapoton fchapoton added this to the sage-9.3 milestone Jan 21, 2021
@fchapoton
Copy link
Contributor

comment:5

green bot, please review

@DaveWitteMorris
Copy link
Member

comment:6

Please clarify the definition of polylog by making the following revision or something similar that specifies the branch cut.

-        This definition is valid for arbitrary complex order `s` and for
-        all complex arguments `z` with `|z| < 1`; it can be extended to
-        `|z| \ge 1` by the process of analytic continuation. So the
-        function may have a discontinuity at `z=1` which can cause a
-        `NaN` value returned for floating point arguments.
+        This definition is valid for arbitrary complex numbers `s` and `z`
+        with `|z| < 1`. It can be extended to `|z| \ge 1` by the process of
+        analytic continuation, with a branch cut along the positive real axis
+        from `1` to `+\infty`. A `NaN` value may be returned for floating
+        point arguments that are on the branch cut.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 22, 2021

Branch pushed to git repo; I updated commit sha1. New commits:

8f4f726doc of polylog

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 22, 2021

Changed commit from 88acb4c to 8f4f726

@fchapoton
Copy link
Contributor

comment:8

ok, done

@DaveWitteMorris
Copy link
Member

Reviewer: Dave Morris

@DaveWitteMorris
Copy link
Member

comment:9

Thanks! You can set to positive review on my behalf when there is a green patchbot again.

@vbraun
Copy link
Member

vbraun commented Jan 31, 2021

Changed branch from u/chapoton/21907 to 8f4f726

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants