-
-
Notifications
You must be signed in to change notification settings - Fork 512
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
Implement symbolic Kronecker delta and also make current signum (sgn) symbolic #6803
Comments
comment:1
Attachment: trac_6803-symbolic-kronecker-n-signum.patch.gz |
This comment has been minimized.
This comment has been minimized.
Author: Golam Mortuza Hossain |
Reviewer: Karl-Dieter Crisman |
comment:2
Overall this is good, and should get positive review. However, there is a doctest failure (very typical when one adds a new symbolic function in line 204 of symbolic/random_tests.py, with random_expr(). This should be easy to fix. |
comment:3
I have attached the patch, but with the random test fixed as a reviewer patch. Apply only this patch. |
Based on 4.2.1.alpha0, apply only this patch. |
comment:4
Attachment: trac_6803-symbolic-kronecker-n-signum-review.patch.gz |
comment:5
I had to add a small patch to the doctest for sage.quadratic_forms.extras.sgn to make sure that the doctest was actually doctesting that function. |
Merged: sage-4.3.alpha0 |
comment:6
Replying to @mwhansen:
Can you post that here, or at least the code in braces - just for posterity? |
apply after previous |
comment:7
Attachment: trac_6803-sgn.patch.gz Replying to @kcrisman:
mhansen's patch is contained in |
We should have a symbolic Kronecker delta in Sage.
Also, current implementation of signum (sgn) function
returns wrong answer for symbolic input.
So we should make sgn() symbolic aware. Given, implementation of
these functions in new symbolics should be very similar to the existing generalized function Dirac delta and Heaviside, I am putting them together here.
Also, ticket #777 should be closed down as Sign is already in Sage
and this ticket will further enhance it.
Patch:
Apart from implementing these two symbolic functions, attached patch slightly speeds up three other generalized functions by avoiding default
__call__
method of PrimitiveFunction. These functions take explicit value either 0,-1,1 so those checks are not needed.Timing before the patches:
Timing after the patches:
Also, it does slight re-arrangements of references.
Component: symbolics
Author: Golam Mortuza Hossain
Reviewer: Karl-Dieter Crisman
Merged: sage-4.3.alpha0
Issue created by migration from https://trac.sagemath.org/ticket/6803
The text was updated successfully, but these errors were encountered: