Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Use of LazyLaurentSeriesRing.

I would like to better understand the use of 'LazyLaurentSeriesRing' in Sage.

The expansion of the function 'Omega', as defined below, sometimes works, sometimes not.

More precisely, it works in the cases m = 0, 1, 2, 4, and does not work for m = 3, 5, 6.

What's the trick?

def Omega(m, z) :
    if m == 0: return z**0
    if m == 1: return exp(z)
    if m == 2: return cosh(z)
    if m == 3: return (exp(z) + 2 * exp(-z / 2) * cos(z * 3 ** (1 / 2) / 2)) / 3
    if m == 4: return (cosh(z) + cos(z)) / 2
    if m == 5: return (exp(z)
            + 2 * exp(-cos(pi / 5) * z) * cos(sin(pi / 5) * z)
            + 2 * exp(cos((2 * pi) / 5) * z) * cos(sin((2 * pi) / 5) * z) ) / 5
    if m == 6: return (cosh(z) + 2 * cos(z * sqrt(3) / 2) * cosh(z / 2)) / 3
    return 0

Test:

L = LazyLaurentSeriesRing(QQ, 'z')
for m in [0, 1, 2, 4]:
    f = Omega(m, L.gen())
    print(f"m={m}: {[factorial(n)*f.coefficient(n) for n in range(24)]}")