Ask Your Question

Tuples or for loops

asked 2013-08-05 23:56:01 -0500

Blackadder gravatar image

updated 2015-01-13 15:49:00 -0500

FrédéricC gravatar image

Hi everybody, I would like to compute the $L$-function of an elliptic curve of the form $$y^2=x^3-d^2x$$ for multiple values of $d$ at $s=1$. I was hoping to use an $n$-tuple


with the hope that I could then do

L = E.lseries().dokchitser()

such that at every stage the data would be in a vector/$n$-tuple form, but this is not possible. Does anyone know how I can make this method work? With a for-loop perhaps? Thanks in advance for your help!

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted

answered 2013-08-06 04:42:24 -0500

Volker Braun gravatar image

List comprehensions are usually clearer than map/lambda where applicable:

[EllipticCurve([0,0,0,-d^2,0]).lseries().dokchitser()(1) for d in range(1, n+1, 2)]
edit flag offensive delete link more


This is exactly what I was looking for thank you so much Volker!!

Blackadder gravatar imageBlackadder ( 2013-08-06 05:04:47 -0500 )edit

answered 2013-08-06 00:41:45 -0500

ppurka gravatar image

updated 2013-08-06 00:45:57 -0500

Use the map and lambda operators.

dlist = range(1, n+1, 2)
map(lambda d: EllipticCurve([0,0,0,-(d^2),0]).lseries().dokchitser()(1), dlist)

If it gets too complicated, then use a python function instead of the lambda so that the code retains readability.

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


Asked: 2013-08-05 23:56:01 -0500

Seen: 231 times

Last updated: Aug 06 '13