#7922: Pickling fails in WeightRing
-----------------------------+----------------------------------------------
Reporter: nthiery | Owner: bump
Type: defect | Status: needs_review
Priority: major | Milestone: sage-4.6
Component: combinatorics | Keywords:
Author: | Upstream: N/A
Reviewer: nthiery | Merged:
Work_issues: |
-----------------------------+----------------------------------------------
Changes (by bump):
* cc: sage-combinat (added)
* reviewer: => nthiery
* status: new => needs_review
* milestone: => sage-4.6
Old description:
> First issue caught by #7921:
>
> {{{
> sage: A2 = WeylCharacterRing(['A',2])
> sage: a2 = WeightRing(A2)
> sage: TestSuite(a2).run()
> Failure in _test_element_pickling:
> Traceback (most recent call last):
> ...
> AssertionError: 2*a2(0,0,0) != 2*a2(0,0,0)
> }}}
>
> Indeed:
> {{{
> sage: x = a2.an_element()
> sage: x == loads(dumps(x))
> False
> }}}
>
> I assume that this is an issue in equality test. This should be fixed for
> free when WeighRing's will use CombinatorialFreeModules
> and categories.
New description:
First issue caught by #7921:
{{{
sage: A2 = WeylCharacterRing(['A',2])
sage: a2 = WeightRing(A2)
sage: TestSuite(a2).run()
Failure in _test_element_pickling:
Traceback (most recent call last):
...
AssertionError: 2*a2(0,0,0) != 2*a2(0,0,0)
}}}
Indeed:
{{{
sage: x = a2.an_element()
sage: x == loads(dumps(x))
False
}}}
I assume that this is an issue in equality test. This should be fixed for
free when WeightRing's will use CombinatorialFreeModules
and categories.
The patch trac_7922.patch fixes this bug by converting both
WeylCharacterRings and WeightRings to inherit from CombinatorialFreeModule
and to use the category framework, a change Nicolas Thiery has requested.
--
Comment:
Regarding speed, testing a large number of branching rules show that the
patch is a substantial speedup over the old code with a caveat: the old
code has an option cache=true for WeylCharacterRings. If this option
(which is not the default) is selected for every WeylCharacterRing, then
the old code is faster. Typical times:
||Old Code||48 seconds||
||New Code||25 seconds||
||Old Code, cache=true||18 seconds||
Since I made the method {{{_irr_weights}}} a cached method, the caching
done in the new code is approximately equivalent to the caching in the old
code, so at the moment I don't see any way to improve the situation.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7922#comment:1>
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.