Skip to content

special values of transcendental functions #18141

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

Open
rwst opened this issue Apr 8, 2015 · 11 comments
Open

special values of transcendental functions #18141

rwst opened this issue Apr 8, 2015 · 11 comments

Comments

@rwst
Copy link
Contributor

rwst commented Apr 8, 2015

The functions in transcentental.py could return special values:

sage: hurwitz_zeta(5,1/2)
31*zeta(5)
sage: hurwitz_zeta(x,1/2)
hurwitz_zeta(x, 1/2)

The latter should be (2^x-1)*zeta(x). Also hurwitz_zeta(0,...) is missing, http://dlmf.nist.gov/25.11#v

This ticket may also discuss: are there closed forms without zeta for

CC: @behackl

Component: symbolics

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

@rwst rwst added this to the sage-6.6 milestone Apr 8, 2015
@behackl
Copy link
Member

behackl commented Jan 5, 2016

comment:2

Hi!

I'm rather motivated to implement some of the special values mentioned above; and I guess the "correct" place would be src/functions/transcendental.py, wouldn't it?

However, I'm not quite sure of how to tackle the implementation of the Stieltjes constants. I think that it would be elegant if the constants were also available in pynac (such that zeta(s).series(s==1) could yield the appropriate series expansion directly).

The problem with this approach is, that I'm not sure of how to implement a familiy of constants in pynac---or even just in sage.

What do you think about moving the part with the Stieltjes constants to a separate ticket?

@rwst
Copy link
Contributor Author

rwst commented Jan 5, 2016

comment:3

Replying to @behackl:

I'm rather motivated to implement some of the special values mentioned above; and I guess the "correct" place would be src/functions/transcendental.py, wouldn't it?

Yes, where the functions are.

However, I'm not quite sure of how to tackle the implementation of the Stieltjes constants. I think that it would be elegant if the constants were also available in pynac (such that zeta(s).series(s==1) could yield the appropriate series expansion directly).

To recap GiNaC/Pynac by default implements series by differentiation so a naive way to get a nice expansion would be to implement special values of the derivatives like in #17678 with the Bessel functions. With zetaderiv this doesn't look like resulting in something usable:

sage: zeta(x).series(x==1,2)
1*(x - 1)^(-1) + (euler_gamma + log(2) + log(pi) + 2*zetaderiv(1, 0)) + (1/2*euler_gamma^2 - 1/24*pi^2 + (euler_gamma + log(pi) + 2*zetaderiv(1, 0))*log(2) + 1/2*log(2)^2 + (euler_gamma + 2*zetaderiv(1, 0))*log(pi) + 1/2*log(pi)^2 + 2*euler_gamma*zetaderiv(1, 0) - zetaderiv(2, 0))*(x - 1) + Order((x - 1)^2)

I haven't fiddled with Pynac series yet so I'm naive on how to get a different output for this. I'm also not exactly at home with complex analysis.

The problem with this approach is, that I'm not sure of how to implement a familiy of constants in pynac---or even just in sage.

In Sage there is symbolic/constants* with three source files. Earlier I had started written about the Pynac side in https://github.com/pynac/pynac/wiki/%7C-constants

To implement a family of symbolic constants (i.e. indexed) would be a first.

However, at first glance I see no reason why Stieltjes could not be another function taking only arguments from NN.

What do you think about moving the part with the Stieltjes constants to a separate ticket?

It looks like this is a sensible approach.

@rwst
Copy link
Contributor Author

rwst commented Jan 5, 2016

comment:4

See #19834.

Please open a ticket showing which result you would expect from a zeta expansion using the Stieltjes "function" from #19834 so that I know what I should do in Pynac for the series expansion.

@behackl
Copy link
Member

behackl commented Jan 5, 2016

comment:5

Replying to @rwst:

However, at first glance I see no reason why Stieltjes could not be another function taking only arguments from NN.

What do you think about moving the part with the Stieltjes constants to a separate ticket?

It looks like this is a sensible approach.

This is a good idea; I'll open a ticket for the zeta-expansion. Should I also open an issue for pynac?

Also, the numerical evaluation of the Stieltjes constants would be implemented in Sage (by some sort of _evalf_ or _eval_ I guess)---or would you need to add some sort of method in pynac as well?

@rwst
Copy link
Contributor Author

rwst commented Jan 6, 2016

comment:6

Replying to @behackl:

This is a good idea; I'll open a ticket for the zeta-expansion. Should I also open an issue for pynac?

Done.

Also, the numerical evaluation of the Stieltjes constants would be implemented in Sage (by some sort of _evalf_ or _eval_ I guess)---or would you need to add some sort of method in pynac as well?

No. This could be a Cython function using arb.

@rwst
Copy link
Contributor Author

rwst commented Jan 6, 2016

comment:7

No, Python suffices: http://docs.sympy.org/dev/modules/mpmath/functions/zeta.html#stieltjes

@rwst
Copy link
Contributor Author

rwst commented Jan 6, 2016

comment:8

This means we can have generalized Stieltjes constants and Hurwitz zeta expansion with only minor additional work, right?

@behackl
Copy link
Member

behackl commented Jan 6, 2016

comment:9

Replying to @rwst:

This means we can have generalized Stieltjes constants and Hurwitz zeta expansion with only minor additional work, right?

For the Zeta-function: yes, that is my impression. Regarding the expansion of the Hurwitz-Zeta, I'm not quite sure: Function_HurwitzZeta is not a Ginac-function, but a BuiltinFunction---and I don't know whether the series expansion of this function can be influenced. Currently:

sage: hurwitz_zeta(s, x).series(s==1)
Traceback (most recent call last):
...
NotImplementedError: derivative with respect to first argument

But yes, of course: if it is possible to set the expansion in some place, then we get the respective expansion of hurwitz_zeta for free, given that we have the generalized Stiltjes-constants.

@behackl
Copy link
Member

behackl commented Jan 6, 2016

comment:10

It seems that adapting the expansion from .series() is possible by implementing a _series_-method (this is somehow mentioned here in symbolic/function.pyx.

@rwst
Copy link
Contributor Author

rwst commented Jan 8, 2016

comment:11

Replying to @behackl:

It seems that adapting the expansion from .series() is possible by implementing a _series_-method (this is somehow mentioned here in symbolic/function.pyx.

Yes, setting any of these functions in Python will override Pynac's implementation (and slow down its calls). In case of _series_ it's dispatched to in function::series, see https://github.com/pynac/pynac/blob/master/ginac/function.cpp#L943.

From experimentation I can say that if you define a Function_zeta::_series_() method it will be called with 6 arguments, e.g. zeta(y).series(x==1,5) will call the Python function Function_zeta::_series_(self, (y,), {'var': x, 'options': 0, 'at': 1, 'order': 5}) so you need to define it as _series_(self, varlist, var=..., options=... , at=..., order=...) and return an expression.

@behackl
Copy link
Member

behackl commented Jan 19, 2016

comment:12

Regarding this ticket: as it turns out, there are closed-form formulae for zetaderiv(k, 0) in general, cf. this paper, Theorem 3 and (14).

The question is, whether we want that kind of expansion to happen for all k, or just for reasonably small k (as far as I can tell, these expansions really blow up fast in terms of summands).

@mkoeppe mkoeppe removed this from the sage-6.6 milestone Dec 29, 2022
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

3 participants