#9466: square root with all=True should not return ValueError but empty list
--------------------------------------+---------------------------
       Reporter:  mstreng             |         Owner:  AlexGhitza
           Type:  defect              |        Status:  new
       Priority:  major               |     Milestone:  sage-5.11
      Component:  algebra             |    Resolution:
       Keywords:  sd23 sd51 sqrt all  |     Merged in:
        Authors:  Marco Streng        |     Reviewers:
Report Upstream:  N/A                 |   Work issues:
         Branch:                      |  Dependencies:
       Stopgaps:                      |
--------------------------------------+---------------------------
Changes (by {'newvalue': u'Marco Streng', 'oldvalue': ''}):

 * keywords:   => sd23 sd51 sqrt all
 * cc: ruckers (added)
 * author:   => Marco Streng


Old description:

> With Sage 4.4.4 and no relevant patches, I got the following:
> {{{
> sage: FiniteField(3)(2).sqrt(all = True)
> []
>
> sage: 2.sqrt(extend = False, all = True)
> ValueError: square root of 2 not an integer
>
> sage: FiniteField(next_prime(2^100))(2).sqrt(extend = False, all = True)
> ValueError: self must be a square
>
> sage: _.<a>=FiniteField(9)
> sage: a.sqrt(extend = False, all = True)
> ValueError: must be a perfect square.
> }}}
>
> At sage days 23 we agreed that square root with all=True should not raise
> an error. If no square roots exist, then it should return an empty list.
>
> Right now, it returns an empty list for elements of small prime finite
> fields, but raises an error for integers, elements of large prime finite
> fields, and elements of non-prime finite fields.

New description:

 With Sage 4.4.4 and no relevant patches, I got the following:
 {{{
 sage: FiniteField(3)(2).sqrt(all = True)
 []

 sage: 2.sqrt(extend = False, all = True)
 ValueError: square root of 2 not an integer

 sage: FiniteField(next_prime(2^100))(2).sqrt(extend = False, all = True)
 ValueError: self must be a square

 sage: _.<a>=FiniteField(9)
 sage: a.sqrt(extend = False, all = True)
 ValueError: must be a perfect square.
 }}}

 At sage days 23 we agreed that square root with all=True should not raise
 an error. If no square roots exist, then it should return an empty list.

 Right now, it returns an empty list for elements of small prime finite
 fields, but raises an error for integers, elements of large prime finite
 fields, and elements of non-prime finite fields.

 apply

 * [attachment:9466.patch]

--

Comment:

 Does anyone know who user "ruckers" is? (s)he should be added to the list
 of authors

 apply 9466.patch

--
Ticket URL: <http://trac.sagemath.org/ticket/9466#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/groups/opt_out.


Reply via email to