-
-
Notifications
You must be signed in to change notification settings - Fork 557
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
Make symbolic versions of moebius, sigma, and euler_phi functions #8383
Comments
comment:1
We'd have to produce a symbolic version of sigma somewhere. Do you want this for all arithmetic functions? We really should have an arithmetic function class anyway, but it's probably more trouble than it's worth to actually do it. |
comment:3
Okay, then I think I will update the summary of this. Also changing component since it's more at symbolics than calculus. We would need to have a uniform error message as well, and hopefully use plot_step_function as a unified plotting method (?). |
comment:4
Can you either provide a list of "arithmetic functions" which should be made symbolic, or just make this ticket about Tickets with blanket statements about symbolic functions (see #4102, #1158, #4229) are hard to attack since nobody takes on the task of making a list of functions which need to be fixed. |
comment:5
Well, at the very least the ones in rings/arith.py which have 'standard' representations should be, so Moebius, Euler_Phi, Sigma. Someday we will hopefully also implement things like the Mertens function (not to be confused with the constant), and those should also be able to remain symbolic. If Paul has others which we have and Maple leaves symbolic, that would be great. |
comment:6
Replying to @burcin:
doesn't Sage provide such a list? It would then be easy to do a loop over all functions and Paul |
comment:7
But I don't think we want ALL such functions (if you are referring to all functions in rings/arith.py). I don't think we have a keyword otherwise, and it certainly isn't worth the time to do four_squares or primitive_root (which just gives the smallest one) as a symbolic function before we have even implemented some of these other functions. Anyway, I'll change the summary again to make my preference clear :) Interestingly, these three functions all give different errors upon giving them 'x' as an argument. That's probably irrelevant, but still fun to point out. |
comment:11
Is the best way to do this by just making all of the functions BuiltinFunctions? I'm trying to import BuiltinFunction in rings/arith.py, but when I do:
in rings/arith.py, I get the error:
|
comment:12
You're running into circular imports. Symbolic functions are considerably slower compared to the current implementations in Thanks for looking into this. |
comment:13
As I'm writing the symbolic version of sigma, it appears that a symbolic function created using BuiltinFunction has to have an explicit number of arguments. It is a little more work to write
than just
but I'm not sure if there's a way around it. |
comment:14
Hi, thanks for working on this! One solution (this is one I'm using on #4102), is to write a wrapper function
The symbolic function |
comment:19
But all functions mentioned so far are expressible using Dirichlet generating functions, and it would make much more sense to make them just wrappers around that (nonexisting) functionality. The same applies to C-finite "functions" like |
comment:20
Did somebody say defining Dirichlet series? Here is an implementation that I haven't had time to try out but which might be a good basis for that. This sage-support thread may also be relevant, though I don't know how advanced that psage code is. |
comment:21
Thanks. I copied your comment to create #16477. |
comment:24
Removing the "beginner" tag from old tickets. Some could be returned to beginner-friendly status by adding a comment about what needs to be done. Some others might be easy for an experienced developer to finish. |
I hit the following problem:
Wouldn't it better to keep sigma(x) unevaluated for x not an integer?
Note that
f = lambda(x):sigma(x)-x
works but it less nice.CC: @nexttime @benjaminfjones @eviatarbach @slel
Component: symbolics
Issue created by migration from https://trac.sagemath.org/ticket/8383
The text was updated successfully, but these errors were encountered: