Ask Your Question
1

Dedekind eta function in sage

asked 2024-07-27 11:40:28 +0100

anonymous user

Anonymous

updated 2024-08-14 18:39:16 +0100

dan_fulea gravatar image

I would like to use the dedekind eta function, $q^{\frac{1}{24}}\prod_{n=1}(1-q^n)$, in my code. However when I do

N = 20
R.<q> = PowerSeriesRing(QQ,default_prec=p*N+1)

eta = q^(1/24) * prod([(1-q^n) for n in range(1,N)]) 
eta = R(eta.truncate(N))

I get "ValueError: power series valuation is not a multiple of 24". I would like to know how I can implement the formula above or if there is some inbuilt eta function I can use somehow (I couldn't find anything in the documentation).

edit retag flag offensive close merge delete

Comments

1

Not a SageMath way but you can try some Python libraries (and you can use them directly in SageMath): https://mpmath.org/doc/current/functions/qfunctions.html

tolga gravatar imagetolga ( 2024-07-28 06:10:42 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2024-07-30 17:40:36 +0100

Max Alekseyev gravatar image

updated 2024-07-30 17:40:57 +0100

It's a always a good idea using the existing functionality rather than reinventing the wheel. Without the factor $q^{1/24}$ the expansion of eta function in Sage can be computed as follows:

from sage.modular.etaproducts import qexp_eta
N=20
qexp_eta(ZZ[['q']], N)
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

Stats

Asked: 2024-07-27 11:40:28 +0100

Seen: 408 times

Last updated: Aug 14