Thank you for your response,
I am on sage 4.7 and I seem to get the error still with the timeit
line for easier readability (good suggestion). Do you mean that this
is a known bug in 4.7 and in 4.7.1 and later this seems to be fixed?
Or are you not getting this error in 4.7 either and maybe my download
was corrupted or something else is wrong?
Thanks again.
sage: x,y=var('x,y')
sage: timeit("(x*2+y^3+4).full_simplify()", number=5000)
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (27, 0))
ERROR: An unexpected error occurred while tokenizing input
The following traceback may be corrupted or invalid
The error message is: ('EOF in multi-line statement', (1340, 0))
---------------------------------------------------------------------------
AssertionError Traceback (most recent call
last)
/home/sage/public_html/cgi-bin/<ipython console> in <module>()
/home/sage/sage-4.7/local/lib/python2.6/site-packages/sage/misc/
sage_timeit_class.so in
sage.misc.sage_timeit_class.SageTimeit.__call__ (sage/misc/
sage_timeit_class.c:744)()
/home/sage/sage-4.7/local/lib/python2.6/site-packages/sage/misc/
sage_timeit_class.so in sage.misc.sage_timeit_class.SageTimeit.eval
(sage/misc/sage_timeit_class.c:605)()
/home/sage/sage-4.7/local/lib/python2.6/site-packages/sage/misc/
sage_timeit.pyc in sage_timeit(stmt, globals, preparse, number,
repeat, precision)
182 break
183
--> 184 best = min(timer.repeat(repeat, number)) / number
185
186 finally:
/home/sage/sage-4.7/local/lib/python/timeit.pyc in repeat(self,
repeat, number)
218 r = []
219 for i in range(repeat):
--> 220 t = self.timeit(number)
221 r.append(t)
222 return r
/home/sage/sage-4.7/local/lib/python/timeit.pyc in timeit(self,
number)
191 gcold = gc.isenabled()
192 gc.disable()
--> 193 timing = self.inner(it, self.timer)
194 if gcold:
195 gc.enable()
/home/sage/public_html/cgi-bin/<magic-timeit> in inner(_it, _timer)
/home/sage/sage-4.7/local/lib/python2.6/site-packages/sage/symbolic/
expression.so in sage.symbolic.expression.Expression.simplify_full
(sage/symbolic/expression.cpp:24511)()
/home/sage/sage-4.7/local/lib/python2.6/site-packages/sage/symbolic/
expression.so in sage.symbolic.expression.Expression.simplify_radical
(sage/symbolic/expression.cpp:25263)()
/home/sage/sage-4.7/local/lib/python2.6/site-packages/sage/structure/
parent.so in sage.structure.parent.Parent.__call__ (sage/structure/
parent.c:6820)()
/home/sage/sage-4.7/local/lib/python2.6/site-packages/sage/structure/
coerce_maps.so in sage.structure.coerce_maps.NamedConvertMap._call_
(sage/structure/coerce_maps.c:4221)()
/home/sage/sage-4.7/local/lib/python2.6/site-packages/sage/interfaces/
maxima.pyc in _symbolic_(self, R)
1841 sqrt(2)
1842 """
-> 1843 return R(self._sage_())
1844
1845 def __complex__(self):
/home/sage/sage-4.7/local/lib/python2.6/site-packages/sage/interfaces/
maxima.pyc in _sage_(self)
1822 import sage.calculus.calculus as calculus
1823 return
calculus.symbolic_expression_from_maxima_string(self.name(),
-> 1824 maxima=self.parent())
1825
1826 def _symbolic_(self, R):
/home/sage/sage-4.7/local/lib/python2.6/site-packages/sage/calculus/
calculus.pyc in symbolic_expression_from_maxima_string(x, equals_sub,
maxima)
1580 if len(x) == 0:
1581 raise RuntimeError, "invalid symbolic expression --
''"
-> 1582 maxima.set('_tmp_',x)
1583
1584 # This is inefficient since it so rarely is needed:
/home/sage/sage-4.7/local/lib/python2.6/site-packages/sage/interfaces/
maxima.pyc in set(self, var, value)
1198 self._batch(cmd, batchload=True)
1199 else:
-> 1200 self._eval_line(cmd)
1201 #self._sendline(cmd)
1202 #self._expect_expr()
/home/sage/sage-4.7/local/lib/python2.6/site-packages/sage/interfaces/
maxima.pyc in _eval_line(self, line, allow_use_file, wait_for_prompt,
reformat, error_check)
757 if not wait_for_prompt:
758 return
--> 759 assert line_echo.strip() == line.strip()
760
761 # This broke in maxima-5.22.1 as discussed in
http://trac.sagemath.org/sage_trac/ticket/10187
AssertionError:
On Aug 1, 3:05 pm, kcrisman <[email protected]> wrote:
> On Aug 1, 1:21 pm, "[email protected]"
>
> <[email protected]> wrote:
> > sage: def foo(f):
> > for i in range(6000):
> > a = sage.calculus.calculus.symbolic_expression_from_string(f)
> > a=a.full_simplify()
> > return true
> > ....:
>
> > sage: foo("x*2+y^3+4")
>
> > It does this error without the 'changing string to sage expression'
> > line and just inputting a sage expression as well. I have sage running
> > on a linux server and ran it in the terminal. I found this testing the
> > runtime of full_simplify() and to do that I made a simple loop doing
>
> You can also just use "timeit" for that.
>
> sage: timeit("(x*2+y^3+4).full_simplify()",number=5000)
> 5000 loops, best of 3: 17.7 ms per loop
>
> I also don't get the errors with your code with releases beyond 4.7.
> When 4.7.1 comes out (soon?) this shouldn't be an issue.
>
> sage: foo("2*x+y^3+4")
> True
>
> > repeated operations of full_simplify() on the same function 5000 or
> > 6000 times (see above). This happens in terminal and in the notebook.
> > Any ideas for this bug or why it occurs? I have received errors, when
> > being called repeatedly 5000-6000 times, in simplify_log,
> > simplify_trig, and simplify_factorial. I plan on testing it more and i
> > expect to get it from all of the simplify_x functions. The errors seem
> > to come from maxima as far as I can tell.
>
> Yes, our interface with Maxima probably is choking on so many inputs
> coming at it. Here is one example:
>
> TypeError: unable to make sense of Maxima expression
> '"__SAGE_SYNCHRO_MARKER_119610225"' in Sage
>
> Good luck!
>
> - kcrisman
--
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org