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

fix parent of 0th Bernoulli polynomial #32970

Closed
fchapoton opened this issue Dec 4, 2021 · 14 comments
Closed

fix parent of 0th Bernoulli polynomial #32970

fchapoton opened this issue Dec 4, 2021 · 14 comments

Comments

@fchapoton
Copy link
Contributor

CC: @videlec @orlitzky

Component: number theory

Author: Frédéric Chapoton

Branch/Commit: 078c078

Reviewer: Michael Orlitzky

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

@fchapoton fchapoton added this to the sage-9.5 milestone Dec 4, 2021
@fchapoton
Copy link
Contributor Author

Commit: 756f605

@fchapoton
Copy link
Contributor Author

New commits:

756f605fix parent of 0-th Bernoulli polynomial

@fchapoton
Copy link
Contributor Author

Branch: u/chapoton/32970

@orlitzky
Copy link
Contributor

orlitzky commented Dec 5, 2021

comment:2

I think you can avoid the coercion entirely by returning x**0. It looks 3-4x faster on my machine.

@slel
Copy link
Member

slel commented Dec 5, 2021

comment:3

Would parent(x).one() work?

@orlitzky
Copy link
Contributor

orlitzky commented Dec 5, 2021

comment:4

Replying to @slel:

Would parent(x).one() work?

Yeah, x.parent().one() does the same thing should skip the intermediate exponentiation method.

@fchapoton
Copy link
Contributor Author

comment:5

the only alternative is to use parent(x), as x can be an int, with no parent method.

and the the "parent" may not have any one method..

@orlitzky
Copy link
Contributor

orlitzky commented Dec 5, 2021

comment:6

Replying to @fchapoton:

the only alternative is to use parent(x), as x can be an int, with no parent method.

and the the "parent" may not have any one method..

Hmm, I would just stick with x**0 then. It's the most pedagogically correct option, and avoids the parent() issues. Anything that you can feed into a polynomial, by definition, should support a zeroth power that gives the corresponding "one."

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 5, 2021

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

078c078using x**0

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 5, 2021

Changed commit from 756f605 to 078c078

@orlitzky
Copy link
Contributor

orlitzky commented Dec 5, 2021

Reviewer: Michael Orlitzky

@orlitzky
Copy link
Contributor

orlitzky commented Dec 5, 2021

comment:8

LGTM, thanks

@slel
Copy link
Member

slel commented Jan 30, 2022

comment:9

Setting milestone to 9.6 now that 9.5 is out.

@slel slel modified the milestones: sage-9.5, sage-9.6 Jan 30, 2022
@vbraun
Copy link
Member

vbraun commented Jan 31, 2022

Changed branch from u/chapoton/32970 to 078c078

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