#12489: Fix equality of combinatorial free module on non totally ordered basis
------------------------------+---------------------------------------------
Reporter: hivert | Owner: sage-combinat
Type: defect | Status: needs_review
Priority: critical | Milestone: sage-5.0
Component: combinatorics | Keywords: CombinatorialFreeModule,
equality, Cernay2012
Work_issues: | Upstream: N/A
Reviewer: Florent Hivert | Author: Nicolas M. ThiƩry
Merged: | Dependencies: #12490
------------------------------+---------------------------------------------
Description changed by nthiery:
Old description:
> The following is obviously wrong:
> {{{
> sage: F = CombinatorialFreeModule(QQ, Subsets([1,2,3]))
> sage: x = F.an_element()
> sage: x+0 == x
> False
> sage: x+F.zero() == x
> False
> }}}
> The reason is
> {{{
> sage: (x+F.zero()).terms() # random
> [2*B[{1}], 3*B[{2}], B[{}]]
> sage: x.terms() # random
> [2*B[{1}], B[{}], 3*B[{2}]]
> }}}
New description:
The following is obviously wrong:
{{{
sage: F = CombinatorialFreeModule(QQ, Subsets([1,2,3]))
sage: x = F.an_element()
sage: x+0 == x
False
sage: x+F.zero() == x
False
}}}
The reason is
{{{
sage: (x+F.zero()).terms() # random
[2*B[{1}], 3*B[{2}], B[{}]]
sage: x.terms() # random
[2*B[{1}], B[{}], 3*B[{2}]]
}}}
Fixing equality testing also revealed a bug in sage.combinat.sf.dual: the
conversion back from the dual basis did not strip cancelled terms from the
dictionary. This conversion now uses dict_linear_combination which fixes
the bug, factors out code and should be faster.
--
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12489#comment:8>
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.