#9880: Pynac comparison functions do not provide a SWO
-----------------------------+----------------------------------------------
       Reporter:  jpflori    |         Owner:  burcin    
           Type:  defect     |        Status:  needs_work
       Priority:  major      |     Milestone:  sage-5.10 
      Component:  symbolics  |    Resolution:            
       Keywords:  pynac      |   Work issues:            
Report Upstream:  N/A        |     Reviewers:            
        Authors:             |     Merged in:            
   Dependencies:             |      Stopgaps:            
-----------------------------+----------------------------------------------

Old description:

> Here is a short example found by Burcin and reproducing the bug:
>
> {{{
> b = [var('b_%s'%i) for i in range(4)]
>
> precomp = (2^b_2 + 2)*(2^b_1 + 2^(-b_1) + 2^b_1*2^b_0 - 2^b_1*2^(-b_0)
> - 2^(-b_1)*2^b_0 - 2^(-b_1)*2^(-b_0) + 2^b_0 + 2^(-b_0) - 9) + (2^b_1 +
> 2^(-b_1) + 2^b_1*2^b_0 - 2^b_1*2^(-b_0) - 2^(-b_1)*2^b_0 -
> 2^(-b_1)*2^(-b_0) + 2^b_0 + 2^(-b_0) - 9)/2^b_2
>
> repl_dict = {b_0: b_0, b_3: b_1, b_2: b_3, b_1: b_2}
> P = precomp.substitute(repl_dict)
> P.expand()
> }}}
> This is already being discussed here: http://groups.google.com/group
> /sage-support/browse_thread/thread/7c85f02c76012722
>
> The following patches are for the Sage library to enable access to the
> PyNaC order and randomly test that it is a SWO:
>
> First build Pynac with patches from Burcin's pynac queue
> https://bitbucket.org/burcin/pynac-patches applied and install it.
>
> Then apply
>   1. [attachment:trac_9880_pynac_order.take2.rebased-5.5.rc0.patch]
>   1. [attachment:trac_9880_randomized_testing.patch]
>   1. [attachment:trac_9880-stable_operands.rebased-5.5.rc0.patch]
>   1. [attachment:trac_9880-fix_comparison-p1.rebased-5.5.rc0.patch]
>   1. [attachment:trac_9880-fix_variables_ordering.patch]
>   1. [attachment:trac_9880-doctest_for_9046.patch]
>   1.
> [attachment:trac_9880-fix_doctests_symbolic.take2.rebased-5.5.rc0.patch]
>   1. [attachment:trac_9880-fix_doctests-be.rebased-5.5.rc0.patch]

New description:

 Here is a short example found by Burcin and reproducing the bug:

 {{{
 b = [var('b_%s'%i) for i in range(4)]

 precomp = (2^b_2 + 2)*(2^b_1 + 2^(-b_1) + 2^b_1*2^b_0 - 2^b_1*2^(-b_0)
 - 2^(-b_1)*2^b_0 - 2^(-b_1)*2^(-b_0) + 2^b_0 + 2^(-b_0) - 9) + (2^b_1 +
 2^(-b_1) + 2^b_1*2^b_0 - 2^b_1*2^(-b_0) - 2^(-b_1)*2^b_0 -
 2^(-b_1)*2^(-b_0) + 2^b_0 + 2^(-b_0) - 9)/2^b_2

 repl_dict = {b_0: b_0, b_3: b_1, b_2: b_3, b_1: b_2}
 P = precomp.substitute(repl_dict)
 P.expand()
 }}}
 This is already being discussed here: http://groups.google.com/group/sage-
 support/browse_thread/thread/7c85f02c76012722

 The following patches are for the Sage library to enable access to the
 PyNaC order and randomly test that it is a SWO:

 First build Pynac with patches from Burcin's pynac queue
 https://bitbucket.org/burcin/pynac-patches applied and install it.

 Then apply
   1. [attachment:trac_9880_pynac_order.take2.rebased-5.5.rc0.patch]
   1. [attachment:trac_9880_randomized_testing.patch]
   1. [attachment:trac_9880-stable_operands.rebased-5.5.rc0.patch]
   1. [attachment:trac_9880-fix_comparison-p1.rebased-5.5.rc0.patch]
   1. [attachment:trac_9880-fix_variables_ordering.patch]
   1. [attachment:trac_9880-doctest_for_9046-rebased-5.9.patch]
   1. [attachment:trac_9880-fix_doctests_symbolic.take2.rebased-5.9.patch]
   1. [attachment:trac_9880-fix_doctests-be.rebased-5.9.patch]

--

Comment (by burcin):

 I rebased the patches to 5.9.

 Here is an example where `minpoly()` does not terminate:

 {{{
 sage: var('x')
 x
 sage: eqn =  x^3 + sqrt(2)*x + 5 == 0
 sage: a = solve(eqn, x)[0].rhs()
 sage: a
 -1/2*(1/18*sqrt(3)*sqrt(8*sqrt(2) + 675) - 5/2)^(1/3)*(I*sqrt(3) + 1) -
 1/6*sqrt(2)*(I*sqrt(3) - 1)/(1/18*sqrt(3)*sqrt(8*sqrt(2) + 675) -
 5/2)^(1/3)
 sage: QQ[a]
 }}}
 or
 {{{
 sage: a.minpoly()
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9880#comment:70>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to