#16644: LinearCode.cardinality category breakage
-------------------------------------+-------------------------------------
       Reporter:  ppurka             |        Owner:
           Type:  enhancement        |       Status:  needs_info
       Priority:  major              |    Milestone:  sage-6.3
      Component:  coding theory      |   Resolution:
       Keywords:                     |    Merged in:
        Authors:                     |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  public/categories/new_parent_linear_codes-16644|  
b48b62702d0d4ff382111ad093ac80808aef6231
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by ppurka):

 @tscrim: there is still this problem with `element_class`. I have been
 able to get some other stuff working with your patch.
 {{{
 sage: C = codes.HammingCode(3, GF(2))
 sage: C.cardinality()
 16
 sage: C.an_element()
 (1, 0, 0, 0, 0, 1, 1)
 sage: C2 = C.cartesian_product(C)
 sage: C2.an_element()
 ((1, 0, 0, 0, 0, 1, 1), (1, 0, 0, 0, 0, 1, 1))
 sage: C.categories()
 [Category of vector spaces over Finite Field of size 2,
  Category of modules over Finite Field of size 2,
  Category of bimodules over Finite Field of size 2 on the left and Finite
 Field of size 2 on the right,
  Category of right modules over Finite Field of size 2,
  Category of left modules over Finite Field of size 2,
  Category of commutative additive groups,
  Category of additive groups,
  Category of additive inverse additive unital additive magmas,
  Category of commutative additive monoids,
  Category of additive monoids,
  Category of additive unital additive magmas,
  Category of commutative additive semigroups,
  Category of additive commutative additive magmas,
  Category of additive semigroups,
  Category of additive magmas,
  Category of sets,
  Category of sets with partial maps,
  Category of objects]
 sage: C.element_class()
 ---------------------------------------------------------------------------
 AttributeError                            Traceback (most recent call
 last)
 <ipython-input-5-66b2e3babdf7> in <module>()
 ----> 1 C.element_class()

 /home/punarbasu/Installations/sage-git/local/lib/python2.7/site-
 packages/sage/structure/parent.so in
 sage.structure.parent.Parent.__getattr__
 (build/cythonized/sage/structure/parent.c:7290)()

 /home/punarbasu/Installations/sage-git/local/lib/python2.7/site-
 packages/sage/structure/misc.so in
 sage.structure.misc.getattr_from_other_class
 (build/cythonized/sage/structure/misc.c:1687)()

 AttributeError: 'LinearCode_with_category' object has no attribute
 'element_class'
 }}}

--
Ticket URL: <http://trac.sagemath.org/ticket/16644#comment:17>
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