#5546: jacobian fails for pynac expressions
-----------------------+----------------------------------------------------
 Reporter:  burcin     |       Owner:  burcin    
     Type:  defect     |      Status:  new       
 Priority:  major      |   Milestone:  sage-3.4.1
Component:  symbolics  |    Keywords:            
-----------------------+----------------------------------------------------
 Reported by Alex Raichev on sage-support:

 {{{
 ----------------------------------------------------------------------
 | Sage Version 3.4, Release Date: 2009-03-11                         |
 | Type notebook() for the GUI, and license() for information.        |
 ----------------------------------------------------------------------
 sage: var('x,y', ns=1)
 (x, y)
 sage: f= x+y
 sage: type(f)
 <type 'sage.symbolic.expression.Expression'>
 sage: jacobian(f,[x,y])
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)

 /Users/arai021/<ipython console> in <module>()

 /Applications/sage/local/lib/python2.5/site-packages/sage/calculus/
 functions.pyc in jacobian(functions, variables)
     136
     137     if not isinstance(variables, (tuple, list)) and not
 is_Vector(variables):
     138         variables = [variables]
     139
 --> 140     return matrix([[diff(f, v) for v in variables] for f in
 functions])

 /Applications/sage/local/lib/python2.5/site-packages/sage/calculus/
 functional.pyc in derivative(f, *args, **kwds)
     145         pass
     146     if not isinstance(f, SymbolicExpression):
 --> 147         f = SR(f)
     148     return f.derivative(*args, **kwds)
     149

 /Applications/sage/local/lib/python2.5/site-packages/sage/calculus/
 calculus.pyc in __call__(self, x)
     504                 msg, s, pos = err.args
     505                 raise TypeError, "%s: %s !!! %s" % (msg, s
 [:pos], s[pos:])
 --> 506         return self._coerce_impl(x)
     507
     508     def _coerce_impl(self, x):

 /Applications/sage/local/lib/python2.5/site-packages/sage/calculus/
 calculus.pyc in _coerce_impl(self, x)
     566             return self(x._sage_())
     567         else:
 --> 568             raise TypeError, "cannot coerce type '%s' into a
 SymbolicExpression."%type(x)
     569
     570     def _repr_(self):

 TypeError: cannot coerce type '<type
 'sage.symbolic.expression.Expression'>' into a SymbolicExpression.
 }}}

 `sage.symbolic.expression.Expression` doesn't support .derivative(), and
 the interface to .diff() doesn't match the Sage conventions.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5546>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to