Hello!

On Mon, Feb 01, 2010 at 09:24:05AM -0800, Anne Schilling wrote:
> You say this since the elements in the direct sum will have different
> parents depending in which B_i they sit in? I guess turning
> facade = False should fix this problem.

Indeed. But there will be a price to pay: method calls on the elements
of the direct sum are not delegated automatically to the underlying
crystal elements. So this will need to be implemented.

        sage: U1 = DisjointUnionEnumeratedSets((
        ...         FiniteEnumeratedSet([1,2,3]),
        ...         FiniteEnumeratedSet([4,5,6])), facade = False)
        sage: f = U1.first()
        sage: f.parent()
        Disjoint union of Family ({1, 2, 3}, {4, 5, 6})
        sage: f.factor()
        ...
        AttributeError: 
'DisjointUnionEnumeratedSets_with_category.element_class' object has no 
attribute 'factor'
        sage: f.value.factor()
        1


> Some other questions I had last night which I forgot to ask:
> (1) With facade = True it does not seem to use the methods in
>     self.Element, but rather the methods of each object itself.

Indeed. With facade = True, the returned objects are really plain
objects from the underlying crystal.

> (2) Since DirectSumOfCrystals inherits both from Crystal and
>     DisjointUnionEnumeratedSets, which iterator does it use?
>     It seems to use the one from Crystal, but how could I change
>     this in principle?

You can play around with Inheritance order. Or put explicitly the
following in the code of your class:

        __iter__ = Crystal.__iter__

or:

        __iter__ = DisjointUnionEnumeratedSets.__iter__

Note that, for technical reasons, this won't work for methods defined
in categories, which is a bummer:

        __iter__ = EnumeratedSets.ParentMethods.__iter__

We will need to add a short mantra for this, similar to the
"getMethodFromCategory" we had in MuPAD.


> OK, putting **options in the argument fixes the test failures.

In the game of the 7 differences (actually 4), you found one so far.
Please look again :-)

In particular, see how the actual equality tests are handled.

> But where are the options documented? I cannot really find
> satisfactory answers in TestSuite??

Look for `elements` and `verbose`. However, unless you want to provide
specific options to your test, you don't have to worry about
those. They are handled by the tester gadget.

Do you have suggestions for improving the current blurb:

------------------------------------------------------------------------------
    When meaningful, one can further customize on which elements
    the tests are run. Here, we use it to *prove* that the
    multiplication is indeed associative, by running the test on
    all the elements::

        sage: S._test_associativity(elements = S)

    Adding a new test boils down to adding a new method in the class
    of the object or any super class (e.g. in a category). This method
    should use the utility :meth:`._tester` to handle standard options
    and report test failures. See the code of
    :meth:`._test_an_element` for an example.
------------------------------------------------------------------------------

> Where should the method for weight.highest_weight_crystal() go? In
> weight_lattice_realization.py?

Ideally yes. Do the various crystal accept as well weights in the
weight lattice and in the ambient space?

Cheers,
                                Nicolas
--
Nicolas M. ThiƩry "Isil" <nthi...@users.sf.net>
http://Nicolas.Thiery.name/

-- 
You received this message because you are subscribed to the Google Groups 
"sage-combinat-devel" group.
To post to this group, send email to sage-combinat-de...@googlegroups.com.
To unsubscribe from this group, send email to 
sage-combinat-devel+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sage-combinat-devel?hl=en.

Reply via email to