I'm having the following problem with basic symbolics in Sage 4.3.2.
I create some variables with "var", combine them into rational
functions, then take their numerator and denominator and coerce them
into a PolynomialRing. This works fine most of the time, but very
occasionally (every few 10000 usages) it chokes with following error
message:
TypeError: unable to make sense of Maxima expression
'"__SAGE_SYNCHRO_MARKER_202188656"' in Sage
If I use "pdb" to go up to frame at the top of the traceback, and
rerun the offending line, it works, as you can see below.
Sometimes it dies with other message complaining about the syntax of
seeming correct expressions, e.g.
TypeError: Error executing code in Maxima
CODE:
_tmp_ : -(a0-1)*a1^2*a3$
Maxima ERROR:
_tmp_ : -(a0-1)*a1^2*a3$
stdin:57338284:Incorrect syntax: Illegal use of delimiter )
(%i832002)
stdin:57338357:Incorrect syntax: Premature termination of input at ;.
(%i832003)
Any ideas of what's going on here?
Thanks,
Nathan
----------------------------------------------------------------------
| Sage Version 4.3.2, Release Date: 2010-02-06 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
sage: attach stavros/__init__.py
sage: %pdb
Automatic pdb calling has been turned ON
sage: test()
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
/Users/dunfield/work/stavros3/<ipython console> in <module>()
/Users/dunfield/work/stavros3/stavros/__init__.py in test()
226 N = OneCuspedManifold(M)
227 for S in N.NormalSurfaces:
--> 228 info = N.vertex_surface_info(S)
229 if info [:-3] == (True, False, False):
230 print M, N.NormalSurfaces.index(S), info
/Users/dunfield/work/stavros3/stavros/__init__.py in
vertex_surface_info(self, surface)
132 n = len(surface.Coefficients)
133 is_kabaya = min(surface.Coefficients) > 0
--> 134 is_ideal = self.comes_from_an_ideal_point(surface)
135 is_isolated = self.vertex_surface_is_isolated(surface)
136 return surface.BoundarySlope, is_isolated, is_kabaya,
is_ideal
/Users/dunfield/work/stavros3/stavros/__init__.py in
comes_from_an_ideal_point(self, surface)
121 R = PolynomialRing(QQ, ['a%d' % i for i in range(0,n)]
+ ['b%d' % i for i in range(0,n)])
122 eqns = self.first_order_equations(surface)
--> 123 poly_eqns = [ R(e.numerator() - e.denominator()) for e
in eqns]
124 gens = R.gens_dict()
125 blow_up_eqns = [ gens["a%d" % i] * gens["b%d" % i] - 1
for i in range(0, n)]
/pkgs/sage-4.3.2/local/lib/python2.6/site-packages/sage/symbolic/
expression.so in sage.symbolic.expression.Expression.denominator (sage/
symbolic/expression.cpp:20432)()
/pkgs/sage-4.3.2/local/lib/python2.6/site-packages/sage/structure/
parent.so in sage.structure.parent.Parent.__call__ (sage/structure/
parent.c:6206)()
/pkgs/sage-4.3.2/local/lib/python2.6/site-packages/sage/structure/
coerce_maps.so in sage.structure.coerce_maps.NamedConvertMap._call_
(sage/structure/coerce_maps.c:4098)()
/pkgs/sage-4.3.2/local/lib/python2.6/site-packages/sage/interfaces/
maxima.pyc in _symbolic_(self, R)
1792 sqrt(2)
1793 """
-> 1794 return R(self._sage_())
1795
1796 def __complex__(self):
/pkgs/sage-4.3.2/local/lib/python2.6/site-packages/sage/interfaces/
maxima.pyc in _sage_(self)
1773 from sage.calculus.calculus import
symbolic_expression_from_maxima_string
1774 #return
symbolic_expression_from_maxima_string(self.name(),
maxima=self.parent())
-> 1775 return
symbolic_expression_from_maxima_string(repr(self))
1776
1777 def _symbolic_(self, R):
/pkgs/sage-4.3.2/local/lib/python2.6/site-packages/sage/calculus/
calculus.pyc in symbolic_expression_from_maxima_string(x, equals_sub,
maxima)
1964 return symbolic_expression_from_string(s, syms,
accept_sequence=True)
1965 except SyntaxError:
-> 1966 raise TypeError, "unable to make sense of Maxima
expression '%s' in Sage"%s
1967 finally:
1968 is_simplified = False
TypeError: unable to make sense of Maxima expression
'"__SAGE_SYNCHRO_MARKER_202188656"' in Sage
> /pkgs/sage-4.3.2/local/lib/python2.6/site-packages/sage/calculus/calculus.py(1968)symbolic_expression_from_maxima_string()
1967 finally:
-> 1968 is_simplified = False
1969
ipdb> up
> /pkgs/sage-4.3.2/local/lib/python2.6/site-packages/sage/interfaces/maxima.py(1775)_sage_()
1774 #return
symbolic_expression_from_maxima_string(self.name(),
maxima=self.parent())
-> 1775 return
symbolic_expression_from_maxima_string(repr(self))
1776
ipdb> up
> /pkgs/sage-4.3.2/local/lib/python2.6/site-packages/sage/interfaces/maxima.py(1794)_symbolic_()
1793 """
-> 1794 return R(self._sage_())
1795
ipdb> up
> /Users/dunfield/work/stavros3/stavros/__init__.py(123)comes_from_an_ideal_point()
122 eqns = self.first_order_equations(surface)
--> 123 poly_eqns = [ R(e.numerator() - e.denominator()) for e
in eqns]
124 gens = R.gens_dict()
ipdb> eqns
[-(a2 - 1)*(a1 - 1)*(a0 - 1)^2*a3/(a0^2*a1*a2*a5), a0*a4/(a1 - 1)^2, -
(a2 - 1)*a1^2*a3*a4/((a4 - 1)^2*(a0 - 1)^2*a5), a0*a5^2/((a2 -
1)^2*a3^2), (a4 - 1)^2*(a1 - 1)/(a1*a4^2), a2]
ipdb> [ R(e.numerator() - e.denominator()) for e in eqns]
[-a0^2*a1*a2*a3 - a0^2*a1*a2*a5 + a0^2*a1*a3 + a0^2*a2*a3 +
2*a0*a1*a2*a3 - a0^2*a3 - 2*a0*a1*a3 - 2*a0*a2*a3 - a1*a2*a3 + 2*a0*a3
+ a1*a3 + a2*a3 - a3, -a1^2 + a0*a4 + 2*a1 - 1, -a1^2*a2*a3*a4 -
a0^2*a4^2*a5 + a1^2*a3*a4 + 2*a0^2*a4*a5 + 2*a0*a4^2*a5 - a0^2*a5 -
4*a0*a4*a5 - a4^2*a5 + 2*a0*a5 + 2*a4*a5 - a5, -a2^2*a3^2 + 2*a2*a3^2
+ a0*a5^2 - a3^2, -2*a1*a4 - a4^2 + a1 + 2*a4 - 1, a2 - 1]
ipdb>
--
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
To unsubscribe, reply using "remove me" as the subject.