The callable symbolic function is a red herring. The problem arises when solving one equation for one variable and using solution_dict=True (see below).
Alex ---------------------------------------------------------------------- | Sage Version 3.4.1, Release Date: 2009-04-21 | | Type notebook() for the GUI, and license() for information. | ---------------------------------------------------------------------- sage: solve([],x) [] sage: solve([],x,solution_dict=True) [] sage: solve([x==0],x) [x == 0] sage: solve([x==0],x,solution_dict=True) --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) /Users/arai021/<ipython console> in <module>() /Applications/sage/local/lib/python2.5/site-packages/sage/calculus/ equations.pyc in solve(f, *args, **kwds) 1588 sol_list = string_to_list_of_solutions(a) 1589 if 'solution_dict' in kwds and kwds['solution_dict'] ==True: -> 1590 sol_dict=[dict([[eq.left(),eq.right()] for eq in solution]) for solution in sol_list] 1591 return sol_dict 1592 else: AttributeError: 'SymbolicVariable' object has no attribute 'left' sage: solve([x==0,x==x],x) [[x == 0]] sage: solve([x==0,x==x],x,solution_dict=True) [{x: 0}] # Interesting On May 7, 1:34 pm, Alex Raichev <tortoise.s...@gmail.com> wrote: > Hi all: > > Is this a bug in solve()? > > Alex > > ---------------------------------------------------------------------- > | Sage Version 3.4.1, Release Date: 2009-04-21 | > | Type notebook() for the GUI, and license() for information. | > ---------------------------------------------------------------------- > sage: f= function('f',x) > sage: solve([f^2==3],[f]) > [f(x) == -sqrt(3), f(x) == sqrt(3)] > sage: solve([f^2==3],[f],solution_dict=True) > --------------------------------------------------------------------------- > AttributeError Traceback (most recent call > last) > > /Users/arai021/.sage/temp/prj_567_106.cs.auckland.ac.nz/978/ > _Users_arai021_afs_sage_work_mgf_sage_3.py in <module>() > > /Applications/sage/local/lib/python2.5/site-packages/sage/calculus/ > equations.pyc in solve(f, *args, **kwds) > 1588 sol_list = string_to_list_of_solutions(a) > 1589 if 'solution_dict' in kwds and kwds['solution_dict'] > ==True: > -> 1590 sol_dict=[dict([[eq.left(),eq.right()] for eq in > solution]) for solution in sol_list] > 1591 return sol_dict > 1592 else: > > AttributeError: 'SymbolicFunctionEvaluation' object has no attribute > 'left' --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---