[sage-release] Re: square root very strange in 8.5.beta3
On Thursday, November 15, 2018 at 7:06:50 AM UTC-5, Simon King wrote: > > Hi! > > On 2018-11-15, Erik Bray > wrote: > > Perhaps there should be a common suite of unit tests applicable to > > symbolic functions / functions that can return symbolic expressions in > > order to help ensure a consistent interface. This is all pretty > > embarrassing :( > > Could that be a use case of our category framework? I.e., have a > "category of symbolic expressions", whose only object is SR and whose > morphisms are symbolic functions? There was a fair amount of work done around this a number of years ago, but it was not fully completed (as noted). There is still (I think) a Trac ticket regarding making a "hold" context which would be great, but I think it also would require some meddling in Pynac again to fully implement them. See https://trac.sagemath.org/ticket/24861 for hold of derivatives. Or for limit: https://trac.sagemath.org/ticket/19203 As to the integral of piecewise, that is probably just continuing the previous long-ago piecewise implementation behavior - the notion being that we probably didn't have a way to even use "integrate" before the new piecewise symbolic functions were implemented. Hopefully this would be pretty easy to do by an alias. And the derivatives are similar - when the D[0] notation was implemented there wasn't really a unified interface with the symbolic functions. And that documentation isn't well understood - see https://trac.sagemath.org/ticket/17445 -- You received this message because you are subscribed to the Google Groups "sage-release" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-release+unsubscr...@googlegroups.com. To post to this group, send email to sage-release@googlegroups.com. Visit this group at https://groups.google.com/group/sage-release. For more options, visit https://groups.google.com/d/optout.
[sage-release] Re: square root very strange in 8.5.beta3
Hi! On 2018-11-15, Erik Bray wrote: > Perhaps there should be a common suite of unit tests applicable to > symbolic functions / functions that can return symbolic expressions in > order to help ensure a consistent interface. This is all pretty > embarrassing :( Could that be a use case of our category framework? I.e., have a "category of symbolic expressions", whose only object is SR and whose morphisms are symbolic functions? The category framework might be able to provide a unified interface. Disclaimer: It's just an idea, I didn't study any detail. Best regards, Simon -- You received this message because you are subscribed to the Google Groups "sage-release" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-release+unsubscr...@googlegroups.com. To post to this group, send email to sage-release@googlegroups.com. Visit this group at https://groups.google.com/group/sage-release. For more options, visit https://groups.google.com/d/optout.
Re: [sage-release] square root very strange in 8.5.beta3
On Thu, Nov 15, 2018 at 11:46 AM Erik Bray wrote: > > On Thu, Nov 15, 2018 at 8:39 AM Emmanuel Charpentier > wrote: > > > > > > > > Le mercredi 14 novembre 2018 12:29:36 UTC+1, Erik Bray a écrit : > > > >> > >> However, one thing I do find surprising about the global sqrt > >> function, which is different from some other global functions (I > >> think, needlessly) is that it does not work as a symbolic function. > >> By contrast, the exp function also exhibits the above behavior, in > >> that it will reduce to an exact (integer) value where possible: > > > > > > This is more general than that : the support for "hold" argument is > > inconstant. Compare : > > sage: sin(x).integrate(x,hold=True) > > integrate(sin(x), x) > > sage: sin(x).diff(x,hold=True) > > --- > > TypeError Traceback (most recent call last) > > in () > > > 1 sin(x).diff(x,hold=True) > > > > TypeError: derivative() got an unexpected keyword argument 'hold' > > > > Sage has some analogous inconsistencies : > > > > sage: f(x)=piecewise([((-oo,-1),x^3),([-1,1],x),((1,oo),x^2)],var=x); f > > x |--> piecewise(x|-->x^3 on (-oo, -1), x|-->x on [-1, 1], x|-->x^2 on (1, > > +oo); x) > > sage: f(x).integral(x) > > piecewise(x|-->1/4*x^4 - 1/4 on (-oo, -1), x|-->1/2*x^2 - 1/2 on [-1, 1], > > x|-->1/3*x^3 - 1/3 on (1, +oo); x) > > sage: f(x).integrate(x) > > --- > > TypeError Traceback (most recent call last) > > in () > > > 1 f(x).integrate(x) > > > > /usr/local/sage-8/local/lib/python2.7/site-packages/sage/symbolic/expression.pyx > > in sage.symbolic.expression.Expression.integral > > (build/cythonized/sage/symbolic/expression.cpp:69368)() > > 12399 R = ring.SR > > 12400 return R(integral(f, v, a, b, **kwds)) > > > 12401 return integral(self, *args, **kwds) > > 12402 > > 12403 integrate = integral > > > > /usr/local/sage-8/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.pyc > > in integrate(expression, v, a, b, algorithm, hold) > > 816 return integrator(expression, v, a, b) > > 817 if a is None: > > --> 818 return indefinite_integral(expression, v, hold=hold) > > 819 else: > > 820 return definite_integral(expression, v, a, b, hold=hold) > > > > /usr/local/sage-8/local/lib/python2.7/site-packages/sage/symbolic/function.pyx > > in sage.symbolic.function.BuiltinFunction.__call__ > > (build/cythonized/sage/symbolic/function.cpp:11950)() > > 996 res = self._evalf_try_(*args) > > 997 if res is None: > > --> 998 res = super(BuiltinFunction, self).__call__( > > 999 *args, coerce=coerce, hold=hold) > >1000 > > > > /usr/local/sage-8/local/lib/python2.7/site-packages/sage/symbolic/function.pyx > > in sage.symbolic.function.Function.__call__ > > (build/cythonized/sage/symbolic/function.cpp:6977)() > > 490 (args[0])._gobj, hold) > > 491 elif self._nargs == 2: > > --> 492 res = g_function_eval2(self._serial, > > (args[0])._gobj, > > 493 (args[1])._gobj, hold) > > 494 elif self._nargs == 3: > > > > /usr/local/sage-8/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.pyc > > in _eval_(self, f, x) > > 88 for integrator in self.integrators: > > 89 try: > > ---> 90 return integrator(f, x) > > 91 except NotImplementedError: > > 92 pass > > > > /usr/local/sage-8/local/lib/python2.7/site-packages/sage/symbolic/integration/external.pyc > > in maxima_integrator(expression, v, a, b) > > 30 expression = SR(expression) > > 31 if a is None: > > ---> 32 result = maxima.sr_integral(expression,v) > > 33 else: > > 34 result = maxima.sr_integral(expression, v, a, b) > > > > /usr/local/sage-8/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.pyc > > in sr_integral(self, *args) > > 807 """ > > 808 try: > > --> 809 return > > max_to_sr(maxima_eval(([max_integrate],[sr_to_max(SR(a)) for a in args]))) > > 810 except RuntimeError as error: > > 811 s = str(error) > > > > /usr/local/sage-8/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.pyc > > in max_to_sr(expr) > >1684 op_max=caar(expr) > >1685 if op_max in special_max_to_sage: > > -> 1686 return special_max_to_sage[op_max](expr) > >1687 if not(op_max in max_op_dict): > >1688 op_max_str=maxprint(op_max).python()[1:-1] > > > > /usr/local/sage-8/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.pyc > > in
Re: [sage-release] square root very strange in 8.5.beta3
On Thu, Nov 15, 2018 at 8:39 AM Emmanuel Charpentier wrote: > > > > Le mercredi 14 novembre 2018 12:29:36 UTC+1, Erik Bray a écrit : > >> >> However, one thing I do find surprising about the global sqrt >> function, which is different from some other global functions (I >> think, needlessly) is that it does not work as a symbolic function. >> By contrast, the exp function also exhibits the above behavior, in >> that it will reduce to an exact (integer) value where possible: > > > This is more general than that : the support for "hold" argument is > inconstant. Compare : > sage: sin(x).integrate(x,hold=True) > integrate(sin(x), x) > sage: sin(x).diff(x,hold=True) > --- > TypeError Traceback (most recent call last) > in () > > 1 sin(x).diff(x,hold=True) > > TypeError: derivative() got an unexpected keyword argument 'hold' > > Sage has some analogous inconsistencies : > > sage: f(x)=piecewise([((-oo,-1),x^3),([-1,1],x),((1,oo),x^2)],var=x); f > x |--> piecewise(x|-->x^3 on (-oo, -1), x|-->x on [-1, 1], x|-->x^2 on (1, > +oo); x) > sage: f(x).integral(x) > piecewise(x|-->1/4*x^4 - 1/4 on (-oo, -1), x|-->1/2*x^2 - 1/2 on [-1, 1], > x|-->1/3*x^3 - 1/3 on (1, +oo); x) > sage: f(x).integrate(x) > --- > TypeError Traceback (most recent call last) > in () > > 1 f(x).integrate(x) > > /usr/local/sage-8/local/lib/python2.7/site-packages/sage/symbolic/expression.pyx > in sage.symbolic.expression.Expression.integral > (build/cythonized/sage/symbolic/expression.cpp:69368)() > 12399 R = ring.SR > 12400 return R(integral(f, v, a, b, **kwds)) > > 12401 return integral(self, *args, **kwds) > 12402 > 12403 integrate = integral > > /usr/local/sage-8/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.pyc > in integrate(expression, v, a, b, algorithm, hold) > 816 return integrator(expression, v, a, b) > 817 if a is None: > --> 818 return indefinite_integral(expression, v, hold=hold) > 819 else: > 820 return definite_integral(expression, v, a, b, hold=hold) > > /usr/local/sage-8/local/lib/python2.7/site-packages/sage/symbolic/function.pyx > in sage.symbolic.function.BuiltinFunction.__call__ > (build/cythonized/sage/symbolic/function.cpp:11950)() > 996 res = self._evalf_try_(*args) > 997 if res is None: > --> 998 res = super(BuiltinFunction, self).__call__( > 999 *args, coerce=coerce, hold=hold) >1000 > > /usr/local/sage-8/local/lib/python2.7/site-packages/sage/symbolic/function.pyx > in sage.symbolic.function.Function.__call__ > (build/cythonized/sage/symbolic/function.cpp:6977)() > 490 (args[0])._gobj, hold) > 491 elif self._nargs == 2: > --> 492 res = g_function_eval2(self._serial, > (args[0])._gobj, > 493 (args[1])._gobj, hold) > 494 elif self._nargs == 3: > > /usr/local/sage-8/local/lib/python2.7/site-packages/sage/symbolic/integration/integral.pyc > in _eval_(self, f, x) > 88 for integrator in self.integrators: > 89 try: > ---> 90 return integrator(f, x) > 91 except NotImplementedError: > 92 pass > > /usr/local/sage-8/local/lib/python2.7/site-packages/sage/symbolic/integration/external.pyc > in maxima_integrator(expression, v, a, b) > 30 expression = SR(expression) > 31 if a is None: > ---> 32 result = maxima.sr_integral(expression,v) > 33 else: > 34 result = maxima.sr_integral(expression, v, a, b) > > /usr/local/sage-8/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.pyc > in sr_integral(self, *args) > 807 """ > 808 try: > --> 809 return > max_to_sr(maxima_eval(([max_integrate],[sr_to_max(SR(a)) for a in args]))) > 810 except RuntimeError as error: > 811 s = str(error) > > /usr/local/sage-8/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.pyc > in max_to_sr(expr) >1684 op_max=caar(expr) >1685 if op_max in special_max_to_sage: > -> 1686 return special_max_to_sage[op_max](expr) >1687 if not(op_max in max_op_dict): >1688 op_max_str=maxprint(op_max).python()[1:-1] > > /usr/local/sage-8/local/lib/python2.7/site-packages/sage/interfaces/maxima_lib.pyc > in dummy_integrate(expr) >1461 integrate(f(x), x, 0, 10) >1462 """ > -> 1463 args=[max_to_sr(a) for a in cdr(expr)] >1464 if len(args) == 4 : >1465 return > sage.symbolic.integration.integral.definite_integral(*args, > >
Re: [sage-release] Sage 8.5.beta2 released
Whoops! I made a mistake regarding one of the test failures below... > On Nov 15, 2018, at 00:36 , 'Justin C. Walker' via sage-release > wrote: > > > >> On Nov 1, 2018, at 13:26 , Volker Braun wrote: >> >> As always, you can get the latest beta version from the "develop" git >> branch. Alternatively, the self-contained source tarball is at >> http://www.sagemath.org/download-latest.html > > Built from fresh clone of the develop tree on two macOS systems: > > 10.11.6 (mid-2015 MBP, Quad-core Core i7): built w/o problems, and all tests > passed. > > 10.13.6 (2017 iMac Pro, 18-core Xeon W): first build blew up on the gcc > build; I did a “make distclean” and reran it. The build completed w/o > problems. > > Anyone know why GCC is being built again? This did not happen with > 8.5.beta2. It was built on both systems. > > Testing (‘ptestlong’) yielded three failures, reported with the 8.5.beta0 > build on this system: > > sage -t --long --warn-long 59.7 src/sage/combinat/designs/ext_rep.py # > Killed due to abort > sage -t --long --warn-long 59.7 src/sage/doctest/external.py # Killed due to > abort > sage -t --long --warn-long 59.7 src/sage/libs/singular/polynomial.pyx # 1 > doctest failed > > All three failed when run singly. The first two appear known. The last > (also seen earlier) showed these failures: Actually, only the first two failed; all tests for the third passed. I was in the wrong directory (8.5.beta0) when looking at the install log. Forgive the noise. The question about GCC still stands. -- Justin C. Walker, Curmudgeon at Large Director Institute for the Enhancement of the Director's Income --- Nobody knows the trouble I've been --- -- You received this message because you are subscribed to the Google Groups "sage-release" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-release+unsubscr...@googlegroups.com. To post to this group, send email to sage-release@googlegroups.com. Visit this group at https://groups.google.com/group/sage-release. For more options, visit https://groups.google.com/d/optout.
Re: [sage-release] Sage 8.5.beta2 released
> On Nov 1, 2018, at 13:26 , Volker Braun wrote: > > As always, you can get the latest beta version from the "develop" git branch. > Alternatively, the self-contained source tarball is at > http://www.sagemath.org/download-latest.html Built from fresh clone of the develop tree on two macOS systems: 10.11.6 (mid-2015 MBP, Quad-core Core i7): built w/o problems, and all tests passed. 10.13.6 (2017 iMac Pro, 18-core Xeon W): first build blew up on the gcc build; I did a “make distclean” and reran it. The build completed w/o problems. Anyone know why GCC is being built again? This did not happen with 8.5.beta2. It was built on both systems. Testing (‘ptestlong’) yielded three failures, reported with the 8.5.beta0 build on this system: sage -t --long --warn-long 59.7 src/sage/combinat/designs/ext_rep.py # Killed due to abort sage -t --long --warn-long 59.7 src/sage/doctest/external.py # Killed due to abort sage -t --long --warn-long 59.7 src/sage/libs/singular/polynomial.pyx # 1 doctest failed All three failed when run singly. The first two appear known. The last (also seen earlier) showed these failures: sage -t --long --warn-long 59.7 src/sage/libs/singular/polynomial.pyx ** File "src/sage/libs/singular/polynomial.pyx", line 184, in sage.libs.singular.po lynomial.singular_polynomial_call Failed example: for i in range(30): # long time n = leak(1) print("Leaked {} bytes".format(n)) if n == 0: zeros += 1 if zeros >= 6: break else: zeros = 0 Expected: Leaked... Leaked 0 bytes Leaked 0 bytes Leaked 0 bytes Leaked 0 bytes Leaked 0 bytes Got: Leaked 125921394688 bytes Leaked 339738624 bytes Leaked 348127232 bytes Leaked 331350016 bytes Leaked 327155712 bytes Leaked 327155712 bytes Leaked 155189248 bytes Leaked 348127232 bytes Leaked 327155712 bytes Leaked 289406976 bytes Leaked 0 bytes Leaked 318767104 bytes Leaked 327155712 bytes Leaked 0 bytes Leaked 339738624 bytes Leaked 92274688 bytes Leaked 0 bytes Leaked 0 bytes Leaked 327155712 bytes Leaked 352321536 bytes Leaked 0 bytes Leaked 0 bytes Leaked 0 bytes Leaked 0 bytes Leaked 335544320 bytes Leaked 0 bytes Leaked 0 bytes Leaked 188743680 bytes Leaked 0 bytes Leaked 327155712 bytes ** 1 item had failures: 1 of 12 in sage.libs.singular.polynomial.singular_polynomial_call [51 tests, 1 failure, 601.73 s] -- Justin C. Walker, Curmudgeon at Large Director Institute for the Enhancement of the Director's income --- Question 43: What if the hokey pokey really *is* what it’s all about? -- -- You received this message because you are subscribed to the Google Groups "sage-release" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-release+unsubscr...@googlegroups.com. To post to this group, send email to sage-release@googlegroups.com. Visit this group at https://groups.google.com/group/sage-release. For more options, visit https://groups.google.com/d/optout.