Hi all:
I ran into an error trying to evaluate the exponential function at an
algebraic number. Looks like there's a bug in substituting algebraic
numbers for variables; see below. While i was at it, i tried creating
the expression QQbar(sqrt(2))*x and got a not implemented error.
Wasn't symbolics with QQbar working in previous versions of Sage, or
am i mistaken?
Alex
----------------------------------------------------------------------
| Sage Version 4.3.5, Release Date: 2010-03-28 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
sage: exp(QQbar(sqrt(2)))
4.11325037878293
sage: exp(x).subs({x:QQbar(sqrt(2))})
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
/Users/arai021/Dropbox/sage_work/<ipython console> in <module>()
/Applications/sage/local/lib/python2.6/site-packages/sage/symbolic/
expression.so in sage.symbolic.expression.Expression.substitute (sage/
symbolic/expression.cpp:14851)()
/Applications/sage/local/lib/python2.6/site-packages/sage/symbolic/
expression.so in sage.symbolic.expression.Expression.coerce_in (sage/
symbolic/expression.cpp:10246)()
/Applications/sage/local/lib/python2.6/site-packages/sage/structure/
parent_old.so in sage.structure.parent_old.Parent._coerce_ (sage/
structure/parent_old.c:3289)()
/Applications/sage/local/lib/python2.6/site-packages/sage/structure/
parent.so in sage.structure.parent.Parent.coerce (sage/structure/
parent.c:6826)()
TypeError: no canonical coercion from Algebraic Field to Symbolic Ring
sage: x.subs({x:QQbar(sqrt(2))})
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
/Users/arai021/Dropbox/sage_work/<ipython console> in <module>()
/Applications/sage/local/lib/python2.6/site-packages/sage/symbolic/
expression.so in sage.symbolic.expression.Expression.substitute (sage/
symbolic/expression.cpp:14851)()
/Applications/sage/local/lib/python2.6/site-packages/sage/symbolic/
expression.so in sage.symbolic.expression.Expression.coerce_in (sage/
symbolic/expression.cpp:10246)()
/Applications/sage/local/lib/python2.6/site-packages/sage/structure/
parent_old.so in sage.structure.parent_old.Parent._coerce_ (sage/
structure/parent_old.c:3289)()
/Applications/sage/local/lib/python2.6/site-packages/sage/structure/
parent.so in sage.structure.parent.Parent.coerce (sage/structure/
parent.c:6826)()
TypeError: no canonical coercion from Algebraic Field to Symbolic Ring
sage: QQbar(sqrt(2))*x
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call
last)
/Users/arai021/Dropbox/sage_work/<ipython console> in <module>()
/Applications/sage/local/lib/python2.6/site-packages/sage/structure/
element.so in sage.structure.element.RingElement.__mul__ (sage/
structure/element.c:11337)()
/Applications/sage/local/lib/python2.6/site-packages/sage/structure/
coerce.so in sage.structure.coerce.CoercionModel_cache_maps.bin_op
(sage/structure/coerce.c:6137)()
/Applications/sage/local/lib/python2.6/site-packages/sage/structure/
coerce.so in
sage.structure.coerce.CoercionModel_cache_maps.canonical_coercion
(sage/structure/coerce.c:7358)()
/Applications/sage/local/lib/python2.6/site-packages/sage/categories/
morphism.so in sage.categories.morphism.CallMorphism._call_ (sage/
categories/morphism.c:2758)()
/Applications/sage/local/lib/python2.6/site-packages/sage/rings/
qqbar.pyc in __call__(self, x)
779 return AlgebraicNumber(x._descr)
780 elif hasattr(x, '_algebraic_'):
--> 781 return x._algebraic_(QQbar)
782 return AlgebraicNumber(x)
783
/Applications/sage/local/lib/python2.6/site-packages/sage/symbolic/
expression.so in sage.symbolic.expression.Expression._algebraic_ (sage/
symbolic/expression.cpp:5544)()
/Applications/sage/local/lib/python2.6/site-packages/sage/symbolic/
expression_conversions.pyc in algebraic(ex, field)
807 0
808 """
--> 809 return AlgebraicConverter(field)(ex)
810
811 ##############
/Applications/sage/local/lib/python2.6/site-packages/sage/symbolic/
expression_conversions.pyc in __call__(self, ex)
206 operator = ex.operator()
207 if operator is None:
--> 208 return self.symbol(ex)
209
210 if operator in arithmetic_operators:
/Applications/sage/local/lib/python2.6/site-packages/sage/symbolic/
expression_conversions.pyc in symbol(self, ex)
312 NotImplementedError: symbol
313 """
--> 314 raise NotImplementedError, "symbol"
315
316 def relation(self, ex, operator):
NotImplementedError: symbol
--
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-support
URL: http://www.sagemath.org
To unsubscribe, reply using "remove me" as the subject.