#9706: New Version of orthogonal Polynomials
-------------------------------+--------------------------------------------
Reporter: maldun | Owner: burcin, maldun
Type: enhancement | Status: needs_review
Priority: minor | Milestone: sage-4.5.3
Component: symbolics | Keywords: orthogonal polynomials, symbolics
Author: Stefan Reiterer | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
-------------------------------+--------------------------------------------
Comment(by maldun):
Since it seems that numpy-1.4.1, and scipy 0.8 should work now (see #9808)
I programmed a version which uses scipy itself to evaluate the orthogonal
polys for numpy arrays.
When the new versions of numpy/scipy become merged into sage I will
provide a patch for these.
Another thing I have to mention are these 2 failde doctests:
* sage -t -long "devel/sage/sage/symbolic/random_tests.py"
* sage -t -long "devel/sage/sage/symbolic/pynac.pyx"
{{{
sage -t -long "devel/sage/sage/symbolic/random_tests.py"
**********************************************************************
File
"/home/maldun/sage/sage-4.5.2/devel/sage/sage/symbolic/random_tests.py",
line 17:
sage: [f for (one,f,arity) in _mk_full_functions()]
Expected:
[Ei, abs, arccos, arccosh, arccot, arccoth, arccsc, arccsch,
arcsec, arcsech, arcsin, arcsinh, arctan, arctan2, arctanh,
binomial, ceil, conjugate, cos, cosh, cot, coth, csc, csch,
dickman_rho, dilog, dirac_delta, elliptic_e, elliptic_ec,
elliptic_eu, elliptic_f, elliptic_kc, elliptic_pi, erf, exp,
factorial, floor, heaviside, imag_part, integrate,
kronecker_delta, log, polylog, real_part, sec, sech, sgn, sin,
sinh, tan, tanh, unit_step, zeta, zetaderiv]
Got:
[Ei, abs, arccos, arccosh, arccot, arccoth, arccsc, arccsch, arcsec,
arcsech, arcsin, arcsinh, arctan, arctan2, arctanh, binomial, ceil,
chebyshev_T, chebyshev_U, conjugate, cos, cosh, cot, coth, csc, csch,
dickman_rho, dilog, dirac_delta, elliptic_e, elliptic_ec, elliptic_eu,
elliptic_f, elliptic_kc, elliptic_pi, erf, exp, factorial, floor,
gegenbauer, gen_laguerre, gen_legendre_P, gen_legendre_Q, heaviside,
hermite, imag_part, integrate, jacobi_P, kronecker_delta, laguerre,
legendre_P, legendre_Q, log, polylog, real_part, sec, sech, sgn, sin,
sinh, tan, tanh, unit_step, zeta, zetaderiv]
**********************************************************************
File
"/home/maldun/sage/sage-4.5.2/devel/sage/sage/symbolic/random_tests.py",
line 237:
sage: random_expr(50, nvars=3, coeff_generator=CDF.random_element)
Expected:
(euler_gamma - v3^(-e) + (v2 - factorial(-e/v2))^(((2.85879036573 -
1.18163393202*I)*v2 + (2.85879036573 - 1.18163393202*I)*v3)*pi -
0.247786879678 + 0.931826724898*I)*arccsc((0.891138386848 -
0.0936820840629*I)/v1) + (-0.553423153995 + 0.5481180572*I)*v3 +
0.149683576515 - 0.155746451854*I)*v1 + arccsch(pi +
e)*elliptic_f(khinchin*v2, 1.4656989704 + 0.863754357069*I)
Got:
-v1*e^((0.0666829501658 + 0.206976992303*I)/(v3 + e))/v3 +
hermite(-(v3^(-0.48519994364 - 0.485764091302*I) - log((1.21734510331 -
1.22580558833*I)*pi*v1 + zeta((0.781366128261 + 0.957400336147*I)*v1*e +
(-1.8919687109 + 0.753422167447*I)*elliptic_f(v1, v1))*arccsch(v3)))*v1,
(-0.647983235144 + 1.20665952957*I)*v1 + (0.0909404921682 +
0.281538203756*I)/v3)
**********************************************************************
File
"/home/maldun/sage/sage-4.5.2/devel/sage/sage/symbolic/random_tests.py",
line 239:
sage: random_expr(5, verbose=True)
Exception raised:
Traceback (most recent call last):
File "/home/maldun/sage/sage-4.5.2/local/bin/ncadoctest.py", line
1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/home/maldun/sage/sage-4.5.2/local/bin/sagedoctest.py", line
38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/home/maldun/sage/sage-4.5.2/local/bin/ncadoctest.py", line
1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_5[5]>", line 1, in <module>
random_expr(Integer(5), verbose=True)###line 239:
sage: random_expr(5, verbose=True)
File "/home/maldun/sage/sage-4.5.2/local/lib/python/site-
packages/sage/symbolic/random_tests.py", line 254, in random_expr
return random_expr_helper(size, internal, leaves, verbose)
File "/home/maldun/sage/sage-4.5.2/local/lib/python/site-
packages/sage/symbolic/random_tests.py", line 210, in random_expr_helper
return r[1](*children)
File "element.pyx", line 1529, in
sage.structure.element.RingElement.__div__
(sage/structure/element.c:11992)
File "coerce.pyx", line 713, in
sage.structure.coerce.CoercionModel_cache_maps.bin_op
(sage/structure/coerce.c:6126)
File "element.pyx", line 1527, in
sage.structure.element.RingElement.__div__
(sage/structure/element.c:11973)
File "expression.pyx", line 2269, in
sage.symbolic.expression.Expression._div_
(sage/symbolic/expression.cpp:11444)
ZeroDivisionError: Symbolic division by zero
**********************************************************************
2 items had failures:
1 of 4 in __main__.example_0
2 of 6 in __main__.example_5
***Test Failed*** 3 failures.
For whitespace errors, see the file
/home/maldun/.sage//tmp/.doctest_random_tests.py
[7.7 s]
----------------------------------------------------------------------
The following tests failed:
sage -t -long "devel/sage/sage/symbolic/random_tests.py"
Total time for all tests: 7.8 seconds
}}}
I quite understand these, because we have introduced new functions, but I
don't understand the exception in the last one
{{{
sage -t -long "devel/sage/sage/symbolic/pynac.pyx"
**********************************************************************
File "/home/maldun/sage/sage-4.5.2/devel/sage/sage/symbolic/pynac.pyx",
line 386:
sage: get_sfunction_from_serial(i) == foo
Expected:
True
Got:
False
**********************************************************************
File "/home/maldun/sage/sage-4.5.2/devel/sage/sage/symbolic/pynac.pyx",
line 388:
sage: py_latex_function_pystring(i, (x,y^z))
Expected:
'my args are: x, y^z'
Got:
'\\mathrm{bar}\\left(x, y^{z}\\right)'
**********************************************************************
File "/home/maldun/sage/sage-4.5.2/devel/sage/sage/symbolic/pynac.pyx",
line 478:
sage: get_sfunction_from_serial(i) == foo
Expected:
True
Got:
False
**********************************************************************
File "/home/maldun/sage/sage-4.5.2/devel/sage/sage/symbolic/pynac.pyx",
line 480:
sage: py_print_fderivative(i, (0, 1, 0, 1), (x, y^z))
Expected:
D[0, 1, 0, 1]func_with_args(x, y^z)
Got:
D[0, 1, 0, 1](foo)(x, y^z)
**********************************************************************
File "/home/maldun/sage/sage-4.5.2/devel/sage/sage/symbolic/pynac.pyx",
line 540:
sage: get_sfunction_from_serial(i) == foo
Expected:
True
Got:
False
**********************************************************************
File "/home/maldun/sage/sage-4.5.2/devel/sage/sage/symbolic/pynac.pyx",
line 542:
sage: py_latex_fderivative(i, (0, 1, 0, 1), (x, y^z))
Expected:
D[0, 1, 0, 1]func_with_args(x, y^z)
Got:
D[0, 1, 0, 1]\left(\mathrm{bar}\right)\left(x, y^{z}\right)
**********************************************************************
3 items had failures:
2 of 19 in __main__.example_14
2 of 14 in __main__.example_16
2 of 18 in __main__.example_18
***Test Failed*** 6 failures.
For whitespace errors, see the file
/home/maldun/.sage//tmp/.doctest_pynac.py
[7.3 s]
----------------------------------------------------------------------
The following tests failed:
sage -t -long "devel/sage/sage/symbolic/pynac.pyx"
Total time for all tests: 7.3 seconds
}}}
And these are really strange, because when I type then into sage by hand
everything works. wtf??
Can anyone have a look at these?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9706#comment:25>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.