#9880: Pynac comparison functions do not provide a SWO
-------------------------+--------------------------------------------------
Reporter: jpflori | Owner: burcin
Type: defect | Status: needs_work
Priority: major | Milestone: sage-4.8
Component: symbolics | Keywords: pynac
Work_issues: | Upstream: N/A
Reviewer: | Author:
Merged: | Dependencies:
-------------------------+--------------------------------------------------
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 pynac queue
> https://bitbucket.org/burcin/pynac-patches and
> [attachment:numerics.patch] applied and install it.
>
> Then apply
> 1. [attachment:trac_9880_fix_import.patch]
> 1. [attachment:trac_9880_pynac_order.take2.patch]
> 1. [attachment:trac_9880_randomized_testing.patch]
> 1. [attachment:trac_9880-stable_operands.patch]
> 1. [attachment:trac_9880_pynac_infinities.patch]
> 1. [attachment:trac_9880-fix_comparison-p1.patch]
> 1. [attachment:trac_9880-fix_variables_ordering.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 pynac queue
https://bitbucket.org/burcin/pynac-patches and [attachment:numerics.patch]
applied and install it.
Then apply
1. [attachment:trac_9880_fix_import.patch]
1. [attachment:trac_9880_pynac_order.take2.patch]
1. [attachment:trac_9880_randomized_testing.patch]
1. [attachment:trac_9880-stable_operands.patch]
1. [attachment:trac_9880_pynac_infinities.patch]
1. [attachment:trac_9880-fix_comparison-p1.patch]
1. [attachment:trac_9880-fix_variables_ordering.patch]
1. [attachment:trac_9880-fix_doctests_symbolic.take2.patch]
1. [attachment:trac_9880-fix_doctests-be.patch]
--
Comment(by burcin):
I've just pushed updates to my pynac patch queue that include Jean-
Pierre's `numerics.patch`, a preliminary fix for `match()` and some
attempts to fix the random effects of normalization of minus signs on
printing. I don't expect all of these to be committed, they are work in
progress.
I also uploaded a slightly changed version of Volker's doctest fix patch
[attachment:trac_9880-fix_doctests_symbolic.take2.patch], and a new patch
[attachment:trac_9880-fix_doctests-be.patch] fixing many more doctests
which I believe to be correct.
Running the test suite on `sage/{symbolic,function}` directories after
these patches shows more clearly that there is still some work to be done
here. We get some random output from `.factor()` and `.numerator()` calls
(#12068), and a timeout on `sage/calculus/calculus.py` since `minpoly`
doesn't terminate.
Here is my current sage patch queue in case you decide to apply the new
patches:
{{{
trac_12068-numer_denom_ginac-fh.patch
trac_12068-denominator.patch
trac_12074-nth_root.patch
trac_9880_fix_import.patch
trac_9880_pynac_order.take2.patch
trac_9880_randomized_testing.patch
trac_9880-stable_operands.patch
trac_9880_pynac_infinities.patch
trac_9880-fix_comparison-p1.patch
trac_9880-fix_variables_ordering.patch
trac_9880-fix_doctests_symbolic.patch
trac_9880-fix_doctests-be.patch
}}}
I'll write to pynac-devel with more details of the remaining problems.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/9880#comment:64>
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 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.