#6243: add support for arbitrary parents in pynac's evalf
-----------------------+----------------------------------------------------
Reporter: burcin | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-4.0.2
Component: symbolics | Keywords:
Reviewer: | Author:
Merged: |
-----------------------+----------------------------------------------------
From Alex Raichev on sage-support:
{{{
Hi all:
Upon upgrading to Sage 4.0, i can no longer make a dictionary with
derivatives as keys (see below). Can someone please fix this?
Alex
----------------------------------------------------------------------
| Sage Version 4.0, Release Date: 2009-05-29 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
sage: X= var('x,y')
sage: f= function('f',*X); f
f(x, y)
sage: for x in X:
....: diff(f,x)
....:
D[0](f)(x, y)
D[1](f)(x, y)
sage: d= {}
sage: for x in X:
....: d[diff(f,x)] = 1
....:
---------------------------------------------------------------------------
NotImplementedError Traceback (most recent call
last)
/Users/raichev/<ipython console> in <module>()
/Applications/sage/local/lib/python2.5/site-packages/sage/symbolic/
expression.so in sage.symbolic.expression.Expression.__nonzero__ (sage/
symbolic/expression.cpp:7814)()
/Applications/sage/local/lib/python2.5/site-packages/sage/symbolic/
expression.so in sage.symbolic.expression.Expression.test_relation
(sage/symbolic/expression.cpp:9187)()
/Applications/sage/local/lib/python2.5/site-packages/sage/rings/
complex_interval_field.pyc in __call__(self, x, im)
286
287 try:
--> 288 return x._complex_mpfi_( self )
289 except AttributeError:
290 pass
/Applications/sage/local/lib/python2.5/site-packages/sage/symbolic/
expression.so in sage.symbolic.expression.Expression._complex_mpfi_
(sage/symbolic/expression.cpp:5484)()
/Applications/sage/local/lib/python2.5/site-packages/sage/symbolic/
expression_conversions.pyc in __call__(self, ex)
212 div = self.get_fake_div(ex)
213 return self.arithmetic(div, div.operator())
--> 214 return self.arithmetic(ex, operator)
215 elif operator in relation_operators:
216 return self.relation(ex, operator)
/Applications/sage/local/lib/python2.5/site-packages/sage/symbolic/
expression_conversions.pyc in arithmetic(self, ex, operator)
1424 return base ** expt
1425 else:
-> 1426 return reduce(operator, map(self, operands))
1427
1428 def composition(self, ex, operator):
/Applications/sage/local/lib/python2.5/site-packages/sage/symbolic/
expression_conversions.pyc in __call__(self, ex)
216 return self.relation(ex, operator)
217 elif isinstance(operator, FDerivativeOperator):
--> 218 return self.derivative(ex, operator)
219 else:
220 return self.composition(ex, operator)
/Applications/sage/local/lib/python2.5/site-packages/sage/symbolic/
expression_conversions.pyc in derivative(self, ex, operator)
344 NotImplementedError: derivative
345 """
--> 346 raise NotImplementedError, "derivative"
347
348 def arithmetic(self, ex, operator):
NotImplementedError: derivative
}}}
I suppose an immediate fix is to implement the derivative method in
`sage.symbolic.expression_conversions.Converter`. I believe the right fix
is to change pynac to pass on the parent for numerical approximation
instead of just the precision. I'll work on making the necessary changes
in pynac.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6243>
Sage <http://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
-~----------~----~----~----~------~----~------~--~---