#10897: better error msg in AlgebraicConverter.symbolic() and elsewhere
-----------------------------+--------------------------
       Reporter:  rbeezer    |        Owner:  robertwb
           Type:  defect     |       Status:  needs_work
       Priority:  minor      |    Milestone:  sage-6.3
      Component:  symbolics  |   Resolution:
       Keywords:             |    Merged in:
        Authors:             |    Reviewers:
Report Upstream:  N/A        |  Work issues:
         Branch:             |       Commit:
   Dependencies:             |     Stopgaps:
-----------------------------+--------------------------

Old description:

> Original summary by reporter: sqrt() as scalar multiple of QQbar vector
> {{{
> sage: QQbar(sqrt(2))*vector(QQbar, [1,2])
> (1.414213562373095?, 2.828427124746190?)
>
> sage: vector(QQbar, [sqrt(2), 2*sqrt(2)])
> (1.414213562373095?, 2.828427124746190?)
>
> sage: sqrt(2)*vector(QQbar, [1,2])
> <BOOM>
> }}}
>
> It seems sqrt() generally gets treated right as an element of QQbar, but
> as a scalar multiple of a vector over QQbar, it does not.

New description:

 Original summary by reporter: sqrt() as scalar multiple of QQbar vector
 {{{
 sage: QQbar(sqrt(2))*vector(QQbar, [1,2])
 (1.414213562373095?, 2.828427124746190?)

 sage: vector(QQbar, [sqrt(2), 2*sqrt(2)])
 (1.414213562373095?, 2.828427124746190?)

 sage: sqrt(2)*vector(QQbar, [1,2])
 ...
 NotImplementedError: symbol
 }}}

 This error is confusing: it suggests that the last example is supposed to
 work, which currently is not the case.

--

Comment (by mmezzarobba):

 Replying to [comment:4 rws]:
 > A more informative error message would be a minimum improvement.

 True.

 > I could imagine subclassing the symbolic ring e.g. by creating an
 AlgebraicSymbolicRing whose elements then could be coerced might be a way
 to improve the situation.

 Yes, perhaps. At least this is something to keep in mind if one tries to
 implement a "field of constant symbolic expression" as recently discussed
 on sage-devel. But I'm not sure it is worth the effort...

--
Ticket URL: <http://trac.sagemath.org/ticket/10897#comment:5>
Sage <http://www.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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to