Skip to content
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

Add infinite q-Pochhammer symbol #34381

Closed
tscrim opened this issue Aug 17, 2022 · 32 comments
Closed

Add infinite q-Pochhammer symbol #34381

tscrim opened this issue Aug 17, 2022 · 32 comments

Comments

@tscrim
Copy link
Collaborator

tscrim commented Aug 17, 2022

(z; q)_{\infty} has a nice expression for its coefficients in z. We implement this very important series as a lazy Laurent series.

We implement the Euler function (q; q)_{\infty} as a lazy Laurent series in q as well.

Depends on #32324

CC: @mantepse @fchapoton

Component: algebra

Keywords: q_pochhammer, euler function, LazyPowerSeries

Author: Travis Scrimshaw

Branch/Commit: 247faf7

Reviewer: Martin Rubey

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

@tscrim tscrim added this to the sage-9.7 milestone Aug 17, 2022
@tscrim
Copy link
Collaborator Author

tscrim commented Aug 17, 2022

Author: Travis Scrimshaw

@tscrim
Copy link
Collaborator Author

tscrim commented Aug 17, 2022

Commit: 80bc4e5

@tscrim
Copy link
Collaborator Author

tscrim commented Aug 17, 2022

comment:1

After doing this, we might want to move the construction of the underlying function to the lazy series ring. We might also want to special case composition of a lazy Laurent series with a monomial in a lazy Laurent series.


New commits:

3f9045dImplementing infinite q-Pochhammer symbol as a lazy Laurent series.
80bc4e5Adding more documetnation and Euler's function.

@tscrim
Copy link
Collaborator Author

tscrim commented Aug 17, 2022

@tscrim

This comment has been minimized.

@tscrim
Copy link
Collaborator Author

tscrim commented Aug 17, 2022

Changed keywords from none to q_pochhammer, euler function

@tscrim

This comment has been minimized.

@tscrim
Copy link
Collaborator Author

tscrim commented Aug 17, 2022

comment:3

This also does not conflict with #32324.

@mantepse
Copy link
Collaborator

comment:4

Cool! It makes me happy to see so many possibilities opening up!

Question: what do you mean with moving the construction of the underlying function to the LazyLaurentSeriesRing?

Idea / Suggestion: maybe it makes sense to use "dummy" (or something similar) instead of "z" for the variable name, to make it clear to the reader that it plays no role. Of course, this would equally apply to all the other special functions. I am not sure about the benefit / cost ratio, I am not even sure that there would be a benefit.

@tscrim
Copy link
Collaborator Author

tscrim commented Aug 17, 2022

comment:5

Replying to @mantepse:

Question: what do you mean with moving the construction of the underlying function to the LazyLaurentSeriesRing?

For each of these special functions, we first construct a series f. So I propose having, e.g., L.sin() return f(z) = sin(z) in the variable of that lazy Laurent series ring. This avoids a composition call. I feel like it might make for a more natural home for, e.g., euler().

Idea / Suggestion: maybe it makes sense to use "dummy" (or something similar) instead of "z" for the variable name, to make it clear to the reader that it plays no role. Of course, this would equally apply to all the other special functions. I am not sure about the benefit / cost ratio, I am not even sure that there would be a benefit.

It gets substituted out every time. So it is never visible, and so I see no net change (although it would make a bug easier to spot if we ended up in the very unlikely scenario that the composition returned the wrong parent). If we wanted to do this, we should do it for all special functions simultaneously on a follow-up ticket.

@mantepse
Copy link
Collaborator

comment:6

Replying to @tscrim:

Replying to @mantepse:

Question: what do you mean with moving the construction of the underlying function to the LazyLaurentSeriesRing?

For each of these special functions, we first construct a series f. So I propose having, e.g., L.sin() return f(z) = sin(z) in the variable of that lazy Laurent series ring. This avoids a composition call. I feel like it might make for a more natural home for, e.g., euler().

Indeed, that makes a lot of sense to me. Similarly for all the other special functions where we end up composing with self in the last line.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 22, 2022

Changed commit from 80bc4e5 to 70486e6

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 22, 2022

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

feba6b8Working more on `__call__` for LazySymFunc.
3f3e0f2Merge branch 'public/rings/lazy_talyor_series-32324' of https://github.com/sagemath/sagetrac-mirror into public/rings/lazy_talyor_series-32324
6727228Merge branch 'public/rings/lazy_talyor_series-32324' of trac.sagemath.org:sage into t/32324/public/rings/lazy_talyor_series-32324
028796dFixing numerous issues with `__call__` and expanding its functionality. Moving plethysm to a Stream_plethysm.
9fb155fRemoving unused code from previous version.
7f9dbb1Some last doc fixes and tweaks.
4e03feeremove unused local variable
e780472Addressing the linter complaint.
06123e1Merge branch 'public/rings/lazy_talyor_series-32324' into public/rings/infinite_q_pochhammer-34381
70486e6Refactoring the implementation of q_pochhammer and euler.

@tscrim
Copy link
Collaborator Author

tscrim commented Aug 22, 2022

Dependencies: #32324

@tscrim
Copy link
Collaborator Author

tscrim commented Aug 22, 2022

comment:8

Replying to @mantepse:

Replying to @tscrim:

Replying to @mantepse:

Question: what do you mean with moving the construction of the underlying function to the LazyLaurentSeriesRing?

For each of these special functions, we first construct a series f. So I propose having, e.g., L.sin() return f(z) = sin(z) in the variable of that lazy Laurent series ring. This avoids a composition call. I feel like it might make for a more natural home for, e.g., euler().

Indeed, that makes a lot of sense to me. Similarly for all the other special functions where we end up composing with self in the last line.

I did this just for the functions implemented on this ticket. Although I forgot to revert back my merge with #32324, but since that is positively reviewed, I am just adding it as a dependency (if you'll allow me to be lazy about it).

@mantepse
Copy link
Collaborator

comment:9

No problem. For #32367 I need a few more operations on lazy series, like reversion for LazySymmetricFunctions, "functorial composition", etc., see #34383. However, I think I am making progress.

Do you prefer to get LazyTaylorSeries into sage, and rename it to LazyPowerSeries later? I would need more time (and possibly a zoom call) to be able to get rid of LazyPowerSeries right now.

@tscrim
Copy link
Collaborator Author

tscrim commented Aug 22, 2022

comment:10

Replying to @mantepse:

No problem. For #32367 I need a few more operations on lazy series, like reversion for LazySymmetricFunctions, "functorial composition", etc., see #34383. However, I think I am making progress.

That's good to hear. Let me know if I can help.

Do you prefer to get LazyTaylorSeries into sage, and rename it to LazyPowerSeries later? I would need more time (and possibly a zoom call) to be able to get rid of LazyPowerSeries right now.

Yes. I think it would be good to have that functionality available and get people to start using it.

Send me an email if you want to do a Zoom call too.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 29, 2022

Branch pushed to git repo; I updated commit sha1. New commits:

c041897Trac #34381: Fixing pyflakes issues.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Aug 29, 2022

Changed commit from 70486e6 to c041897

@tscrim
Copy link
Collaborator Author

tscrim commented Aug 29, 2022

comment:12

Bot was green modulo the pyflakes issues, which I have just pushed. I have also tested this locally post change.

@mantepse
Copy link
Collaborator

Changed keywords from q_pochhammer, euler function to q_pochhammer, euler function, LazyPowerSeries

@mantepse
Copy link
Collaborator

Reviewer: Martin Rubey

@mkoeppe mkoeppe changed the title Add infinte q-Pochhammer symbol Add infinite q-Pochhammer symbol Sep 15, 2022
@mantepse
Copy link
Collaborator

comment:15

I am a bit unhappy about the amount of (documentation) duplication, especially, since it would be nice to do this for all the "special" functions.

@tscrim
Copy link
Collaborator Author

tscrim commented Sep 15, 2022

comment:16

Unfortunately that is not possible. Note that they are actually different functions with different doctests. We can make a link, but we cannot do any duplication.

@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Sep 19, 2022
@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 22, 2022

Branch pushed to git repo; I updated commit sha1. New commits:

4ecf547Merge branch 'develop' into public/rings/infinite_q_pochhammer-34381
7912292Merge branch 'develop' into public/rings/infinite_q_pochhammer-34381

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 22, 2022

Changed commit from c041897 to 7912292

@mantepse
Copy link
Collaborator

comment:19

One tiny thing: I think that we should be explicit that the function passed should be interpreted as coefficients:

sage: L.<q> = LazyLaurentSeriesRing(ZZ)
sage: phi = q.euler()
sage: phi
1 - q - q^2 + q^5 + O(q^7)
sage: L.<q> = LazyLaurentSeriesRing(LazyDirichletSeriesRing(QQ, "s"))
sage: phi = q.euler()
sage: phi
(-1 - 1/(2^s) + 1/(5^s) + 1/(7^s) + O(1/(8^s)))
diff --git a/src/sage/rings/lazy_series_ring.py b/src/sage/rings/lazy_series_ring.py
index b7b1953f52f..51e2b1c365f 100644
--- a/src/sage/rings/lazy_series_ring.py
+++ b/src/sage/rings/lazy_series_ring.py
@@ -1550,7 +1550,7 @@ class LazyLaurentSeriesRing(LazySeriesRing):
         one = qP.one()
         def coeff(n):
             return (-1)**n * q**binomial(n, 2) / qP.prod(one - q**i for i in range(1, n+1))
-        return self(coeff, valuation=0)
+        return self(coefficients=coeff, valuation=0)
 
     def euler(self):
         r"""
@@ -1588,7 +1588,7 @@ class LazyLaurentSeriesRing(LazySeriesRing):
             if rem:
                 return ZZ.zero()
             return (-1) ** ((m + 1) // 6)
-        return self(coeff, valuation=0)
+        return self(coefficients=coeff, valuation=0)
 ######################################################################

If this looks OK to you, let's go (with a big "thank you" for reviewing all the other issues, and being careful with #15248, etc.)!

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 28, 2022

Changed commit from 7912292 to 247faf7

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 28, 2022

Branch pushed to git repo; I updated commit sha1. New commits:

247faf7Being more careful about passing the coefficients.

@tscrim
Copy link
Collaborator Author

tscrim commented Oct 28, 2022

comment:22

Good catch. Thank you.

(No problem. Sorry I haven't been able to work so much on the other tickets, but I right now have a bit of time at least.)

@tscrim
Copy link
Collaborator Author

tscrim commented Oct 29, 2022

comment:24

Thank you.

@vbraun
Copy link
Member

vbraun commented Nov 7, 2022

Changed branch from public/rings/infinite_q_pochhammer-34381 to 247faf7

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

4 participants