Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagelib
Path: blob/master/sage/symbolic/todo.txt
4108 views
1
done * get it to work with a union
2
done * make type and value private
3
done * move all definition code into cpp file
4
done * add an int type
5
done * create a coercion model
6
done * make everything actually work with these two types
7
done * get rid of ginsh and other crap from distro.
8
done * change verbose logging stuff to be macros
9
done * figure out how to properly check for and raise a Python exception
10
done * implement stub functions:
11
done * use gmp to implement binomial on ui's
12
@deftypefunx void mpz_bin_uiui (mpz_t @var{rop}, unsigned long int @var{n}, @w{unsigned long int @var{k}})
13
done * fix the binomial expand memory leak
14
done * Need to print with parenthesis, e.g.:
15
sage: K.<alpha> = NumberField(x^5 + x^2 + x -1)
16
sage: var('x,y,z,w',ns=1); P=x.parent();
17
sage: x^(alpha+1)
18
x^alpha + 1
19
done * fix symbol order (done by changing hashing and compare_same_type in symbol.cpp)
20
mostly done/changed -- above fix made all this change. replaced by new todo * Fix printing order.
21
sage: x^2 + x^4 + x^3
22
x^4 + x^2 + x^3
23
sage: var('a,x,y')
24
(a, x, y)
25
sage: a+x+y
26
y + x + a
27
sage: a+y+x
28
y + x + a
29
sage: y+x+a
30
y + x + a
31
32
* print degree order:
33
Now,
34
sage: x^2 + x^4 + x^3
35
x^2 + x^3 + x^4
36
sage: a^3*x^10 + x^12 - a^15
37
x^12 + a^3*x^10 - a^15
38
39
So it is printing from lowest to highest degree, like mathematica (or power series),
40
but unlike the standard sage convention (or maple, singular, MATH, etc.):
41
sage: R.<a,x> = QQ[]
42
sage: a^3*x^10 + x^12 - a^15
43
-a^15 + a^3*x^10 + x^12
44
sage: singular(a^3*x^10 + x^12 - a^15)
45
-a^15+a^3*x^10+x^12
46
done * switch everything to use except+.
47
done * doctest all existing functions
48
done * add copyright headers
49
done * wrap differentiation
50
done * integrate in burcin's new code
51
done * put sig_on()/ sig_off() back so control-c works.
52
done (?) * printing sums is still out of wack and non-deterministic
53
done * implement isqrt, etc. and other stubs in pynac.pyx
54
done * BUG:
55
get gcd to work
56
sage: from sage.all import *; x,y= var('x,y',ns=1); (x**2-y**2).gcd(x-y)
57
boom!
58
59
done * Bug...
60
sage: var('x',ns=1); k.<a> = GF(9); k(2)*x
61
x
62
with 9 replaced by 25 it works fine...
63
64
done * wrap basic pattern matching
65
66
done * wrap basic polynomial functions
67
68
done * wrap substituting expressions
69
70
done * {{{id=27|
71
var('x,y',ns=1)
72
S = x.parent()
73
pi = sage.symbolic.ring.pi
74
def hermite(n,y):
75
if n == 1:
76
return 2*y
77
if n == 0:
78
return 1
79
return 2*y*hermite(n-1,y) - 2*(n-1)*hermite(n-2,y)
80
81
def phi(n,y):
82
return 1/(sqrt(S(2^n*factorial(n)))*pi^(1/4))*exp(-y^2/2)*hermite(n,y)
83
84
time a = phi(25,4)
85
///
86
** Hit STUB**: irem -- need to compute r!!!
87
PYTHON ERROR! error calling function
88
}}}
89
90
DONE * Control-c --> SIGBUS:
91
sage: R.<u,v> = QQ[]
92
sage: var('a,b,c', ns=1)
93
(a, b, c)
94
sage: expand((u + v + a + b + c)^2)
95
u^2 + 2*u*v + v^2 + a^2 + 2*b*a + (2*u + 2*v)*b + b^2 + 2*b*c + (2*u + 2*v)*a + c^2 + (2*u + 2*v)*c + 2*a*c
96
sage: time z = expand((u + v + a + b + c)^10)
97
CPU times: user 0.01 s, sys: 0.00 s, total: 0.01 s
98
Wall time: 0.05 s
99
sage: time z = expand((u + v + a + b + c)^100)
100
^C^C^C
101
------------------------------------------------------------
102
Unhandled SIGBUS: A bus error occured in SAGE.
103
104
done * pretty serious todo -- all predefined constants in utils.cpp get made wrong:
105
// TODO: BECAUSE of Floor divsion, this gives the wrong answer!!
106
// However, it gets called at ginac startup, so I don't yet
107
// know how to change it to make a Sage Rational. Argh.
108
value = Number_T(numer) / Number_T(denom);
109
110
done * wrap taylor series
111
done * power series print wrong -- no spaces around operators
112
113
done * figure out how to check for true or false-ness of inequalities in ginac manual.
114
sage: var('x,y,z,w',ns=1); P=x.parent();
115
sage: bool(P(2)== P(2))
116
117
done-ish * implement conversion to RealField, and more general coercions...
118
119
done * BUG:
120
sage: S(0.5).arccosh()
121
1.12762596520638 # very wrong!
122
Notes
123
(1) sage: (0.5).arccosh()
124
NaN
125
(2) but however it seems the code in pynac.pyx isn't even called.
126
127
done * make it so "make install" actually works without manual intervention, especially on osx
128
129
------------------------------------------------------------------
130
131
132
******************************************************************************
133
For PHASE II: LATER (Hopefully Burcin)
134
******************************************************************************
135
136
* genuine coercions to real field, etc.
137
138
* optimize is_even in numeric.cpp
139
140
* Support pickle via the "archive" print mode.
141
142
done * CRASH:
143
sage: f = (Mod(2,7)*x^2 + Mod(2,7))^7
144
------------------------------------------------------------
145
Unhandled SIGBUS: A bus error occured in SAGE.
146
147
It works fine with leading coefficient Mod(1,7)
148
149
done * Weird wrong answers:
150
sage: k = GF(7)
151
sage: f = expand((k(1)*x^5 + k(1)*x^2 + k(2))^7); f
152
2 + 35*x^26 + 21*x^29 + 7*x^17 + 21*x^20 + 35*x^23 + x^14 + 7*x^32 + x^35
153
sage: f * k(-1) * k(-1)
154
2
155
156
* need to be able to do this (from ginsh):
157
> collect_common_factors(x/(x^2 + x));
158
(1+x)^(-1)
159
160
161
* Maybe change SAGE's Ginac to make a call to a cython gcd function, then use
162
singular, since singular's gcd over QQ is much better than ginac's, I think,
163
and ginac *only* does GCD over QQ. Actually, just make everything in normal.cpp
164
be implemented via Singular, probably...
165
166
done * Make it so these work the same way, i.e., in second case below the Mod(1,7)
167
should also reduce. Probably in some cases ginac just doesn't bother to do
168
the multiply because Mod(1,7) == 1 is true.
169
sage: a.expand()*Mod(2,7)
170
5 + (5)*x + (2)*x^3 + (4)*x^2
171
sage: a.expand()*Mod(1,7)
172
1000 + 300*x + x^3 + 30*x^2
173
174