# Problem with AbelianGroup.cayley_graph ()

Am I misunderstanding something here? AbelianGroup.cayley_graph() fails with the default generators and but is ok if generators=AbelianGroup.gens(). It also fails with .gens_small().
We have:
sage: ag2=(AbelianGroup([3,3])) sage: ag2.cayley_graph(generators=ag2.gens())) Digraph on 9 vertices

While:

sage: ag2.cayley_graph() --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) <ipython-input-42-b5555c6dc56f> in <module>() ----> 1 ag2.cayley_graph()

/home/martin/sage-5.9/local/lib/python2.7/site-packages/sage/categories/semigroups.pyc in cayley_graph(self, side, simple, elements, generators, connecting_set) 283 generators = connecting_set 284 if generators is None: --> 285 generators = self.semigroup_generators() 286 if isinstance(generators, (list, tuple)): 287 generators = dict((self(g), self(g)) for g in generators)

/home/martin/sage-5.9/local/lib/python2.7/site-packages/sage/structure/parent.so in sage.structure.parent.Parent.__getattr__ (sage/structure/parent.c:6585)()

/home/martin/sage-5.9/local/lib/python2.7/site-packages/sage/structure/misc.so in sage.structure.misc.getattr_from_other_class (sage/structure/misc.c:1606)()

AttributeError: 'AbelianGroup_class_with_category' object has no attribute 'semigroup_generators'

But ag2 is a semi_group:

sage: ag2.categories() [Category of groups, Category of monoids, Category of semigroups, Category of magmas, Category of sets, Category of sets with partial maps, Category of objects]

edit retag close merge delete

Sort by » oldest newest most voted

Thanks for the report! That's a trivial not implemented feature: this abelian group should be in the finite group category. It would then take advantage of the "semigroup_genrators" implemented there which uses the fact that, for a finite group, the group generators are also semigroup generators.

In the mean time, you can do:

ag2.semigroup_generators = ag2.group_generators
ag2.cayley_graph()

more

Thanks for the tip Nicolas. Regards Martin

( 2013-09-02 13:25:49 +0200 )edit