Ask Your Question

Finding zeros of zeta function.

asked 2017-06-19 01:57:54 -0500

ablmf gravatar image

I am trying to make the following code work.

t = var('t')
f = zeta(1/2+i*t).abs()
ff = fast_callable(f, vars=[t], domain=CDF)
print find_root(ff, 0, 40)

There are actually 6 roots between 0 and 40. But find_root could not find any of them. Is there any walkaround?

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted

answered 2017-06-19 04:32:20 -0500

tmonteil gravatar image

The probleme is the use of abs. Indeed, your function f will not change its sign, so that the zeroes are hard to find, especially, with the numerical noise. Here is how your function looks like (see this sample):

sage: plot(ff, 0, 40)

So, what you could do is to locate the zeroes of the real part of the function, not its absolute value:

sage: f = zeta(1/2+i*t).real()
sage: ff = fast_callable(f, vars=[t], domain=CDF)

As you can see, there are too many roots (basically twice as much as you want, see this sample):

sage: plot(ff, 0, 40)

So, to select the correct ones, let us also look at the imaginary part of the function (see this sample):

sage: g = zeta(1/2+i*t).imag()
sage: gg = fast_callable(g, vars=[t], domain=CDF)
sage: plot(ff, 0, 40) + plot(gg, 0, 40, color='red')

So, now you have to find the common zeroes. find_root only finds one root, so let us for exemple use the recursive algorithm described on this ask question, and look for the common roots of the real and the imaginary part of the function. The problem is that there are numerical approximations of the roots, so they might not exactly be equal:

sage: A = find_root_recursive(ff,0,40)
sage: B = find_root_recursive(gg,0.1,40)
sage: [a for a in A for b in B if a == b]
[30.424876125859512, 37.586178158825675]

So, we should add some tolerance:

sage: [a for a in A for b in B if abs(b-a)<0.00001]

Here are the 6 zeroes you were looking for.

Note that if you want to go further, you will have to play with the tolerance in find_root_recursive since consecutive zeroes get closer and closer.

edit flag offensive delete link more

answered 2017-06-19 06:22:30 -0500

Sébastien gravatar image

You may also install an optional package:

sage -i database_odlyzko_zeta

which allows to get a list of the first 2 millions zeros:

sage: zz = zeta_zeros()
sage: type(zz)
<type 'list'>
sage: len(zz)
sage: zz[:6]
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2017-06-19 01:57:54 -0500

Seen: 51 times

Last updated: Jun 19