#19481: No cardinality for virtual crystals
-------------------------------------+-------------------------------------
       Reporter:  aschilling         |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.10
      Component:  combinatorics      |   Resolution:
       Keywords:  crystals           |    Merged in:
        Authors:  Travis Scrimshaw   |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  public/crystals/morphism_virtual_cleanup-19481|  
8184b387caa77679b05608b4fb68eeed314d732f
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------
Description changed by aschilling:

Old description:

> When one slightly changes the following example in the documentation:
> {{{
>         sage: from sage.combinat.crystals.virtual_crystal import
> VirtualCrystal
>         sage: A = crystals.Tableaux(['A',3], shape=[2,1,1])
>         sage: V = VirtualCrystal(A, {1:(1,3), 2:(2,)}, {1:1, 2:2},
> cartan_type=['C',2])
>         sage: G = crystals.Tableaux(['C',2], shape=[1]).digraph()
>         sage: V.digraph().is_isomorphic(G, edge_labels=True)
>         True
> }}}
> to
> {{{
>         sage: from sage.combinat.crystals.virtual_crystal import
> VirtualCrystal
>         sage: A = crystals.Tableaux(['A',3], shape=[2,1,1])
>         sage: V = VirtualCrystal(A, {1:(1,3), 2:(2,)}, {1:1, 2:2},
> cartan_type=['C',2])
>         sage: R = RootSystem(['C',2])
>         sage: Lambda = R.weight_space()
>         sage: La=Lambda.fundamental_weights()
>         sage: G = crystals.LSPaths(La[1])
>         sage: V.digraph().is_isomorphic(G, edge_labels=True)
> ---------------------------------------------------------------------------
> AttributeError                            Traceback (most recent call
> last)
> <ipython-input-8-d91276b648e9> in <module>()
> ----> 1 V.digraph().is_isomorphic(G, edge_labels=True)
>
> /Applications/sage/local/lib/python2.7/site-
> packages/sage/graphs/generic_graph.pyc in is_isomorphic(self, other,
> certify, verbosity, edge_labels)
>   20442         """
>   20443
> > 20444         if self.order() == other.order() == 0:
>   20445             return (True, None) if certify else True
>   20446
>
> /Applications/sage/src/sage/structure/parent.pyx in
> sage.structure.parent.Parent.__getattr__
> (/Applications/sage/src/build/cythonized/sage/structure/parent.c:8095)()
>     840             return self.__cached_methods[name]
>     841         except KeyError:
> --> 842             attr = getattr_from_other_class(self,
> self._category.parent_class, name)
>     843             self.__cached_methods[name] = attr
>     844             return attr
>
> /Applications/sage/src/sage/structure/misc.pyx in
> sage.structure.misc.getattr_from_other_class
> (/Applications/sage/src/build/cythonized/sage/structure/misc.c:1667)()
>     251         dummy_error_message.cls = type(self)
>     252         dummy_error_message.name = name
> --> 253         raise dummy_attribute_error
>     254     try:
>     255         attribute = getattr(cls, name)
>
> AttributeError: 'CrystalOfLSPaths_with_category' object has no attribute
> 'order'
> }}}
> Also cardinality is not defined for virtual crystals:
> {{{
> sage: V.cardinality()
> ---------------------------------------------------------------------------
> AttributeError                            Traceback (most recent call
> last)
> <ipython-input-9-36235162fdc4> in <module>()
> ----> 1 V.cardinality()
>
> /Applications/sage/local/lib/python2.7/site-
> packages/sage/combinat/crystals/subcrystal.pyc in cardinality(self)
>     262             if self in FiniteCrystals():
>     263                 return Integer(len(self.list()))
> --> 264             card = super(Subcrystal, self).cardinality()
>     265             if card == infinity:
>     266                 self._cardinality = card
>
> AttributeError: 'super' object has no attribute 'cardinality'
> }}}

New description:

 Cardinality does not work for virtual crystals:
 {{{
         sage: from sage.combinat.crystals.virtual_crystal import
 VirtualCrystal
         sage: A = crystals.Tableaux(['A',3], shape=[2,1,1])
         sage: V = VirtualCrystal(A, {1:(1,3), 2:(2,)}, {1:1, 2:2},
 cartan_type=['C',2])
         sage: V.cardinality()
 ---------------------------------------------------------------------------
 AttributeError                            Traceback (most recent call
 last)
 <ipython-input-9-36235162fdc4> in <module>()
 ----> 1 V.cardinality()

 /Applications/sage/local/lib/python2.7/site-
 packages/sage/combinat/crystals/subcrystal.pyc in cardinality(self)
     262             if self in FiniteCrystals():
     263                 return Integer(len(self.list()))
 --> 264             card = super(Subcrystal, self).cardinality()
     265             if card == infinity:
     266                 self._cardinality = card

 AttributeError: 'super' object has no attribute 'cardinality'
 }}}

--

--
Ticket URL: <http://trac.sagemath.org/ticket/19481#comment:5>
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to