Hi Sébastien! On Thu, Jun 25, 2009 at 03:06:15PM -0700, slabbe wrote: > This weekend I was introducing Sage to a friend. To illustrate Jmol, I > showed him some 3d Cayley graphs of some finite groups : > > {{{ > sage: S = SymmetricGroup(4) > sage: S.cayley_graph() > Digraph on 24 vertices > }}} > > Then, he asked me to show the Cayley graph of some groups he often > works with : > > {{{ > sage: g = GL(2,GF(3)); g > General Linear Group of degree 2 over Finite Field of size 3 > sage: g.order() > 48 > sage: g.cayley_graph() > Traceback (most recent call last): > ... > AttributeError: 'GeneralLinearGroup_finite_field' object has no > attribute 'cayley_graph' > }}} > > > {{{ > sage: G = WeylGroup(['D',4]) > sage: G > Weyl Group of type ['D', 4] (as a matrix group acting on the ambient > space) > sage: G.order() > 192 > sage: G.cayley_graph() > Traceback (most recent call last): > ... > AttributeError: 'WeylGroup_gens' object has no attribute > 'cayley_graph' > }}} > > The reason is that cayley_graph is implemented in the class > sage.groups.group.FiniteGroup but both WeylGroup_gens and > MatrixGroup_gap_finite_field inherits only from > sage.groups.group.Group. > > I already begun a patch available in the sage-combinat tree. Mainly, > the changes are : > > -class MatrixGroup_gap_finite_field(MatrixGroup_gap): > +class MatrixGroup_gap_finite_field(MatrixGroup_gap, FiniteGroup): > > -class WeylGroup_gens(ClearCacheOnPickle, UniqueRepresentation, > MatrixGroup_gens): > +class WeylGroup_gens(ClearCacheOnPickle, UniqueRepresentation, > MatrixGroup_gens, FiniteGroup): > > My question is the following : Am I right to assume that both > WeylGroup_gens and MatrixGroup_gap_finite_field are always finite?
MatrixGroup_gap_finite_field, yes, I think so. But for WeylGroup not necessarily: this also is used to build affine Weyl groups which are infinite. On the other hand the upcoming root system patch puts Weyl groups in the appropriate category: FiniteWeylGroups() or AffineWeylGroups() or ... That's one of the point of the category stuff: to be able to customize the inheritance at run time depending on the properties of the parent one is constructing. That's not the complete end of the story though, since Cayley graphs are currently implemented at two spots: - Once in the abstract class FiniteGroup - Once in the category FiniteSemigroups This remains to be cleaned up, by merging the two implementations into the FiniteSemigroups category. If I recall correctly, there are couple things one wants to do differently for finite groups, so probably the (yet to be created) category FiniteGroups will need to further override/customize the Cayley graph method. Do you feel like doing it? That would be great! Cheers, Nicolas -- Nicolas M. Thiéry "Isil" <nthi...@users.sf.net> http://Nicolas.Thiery.name/ --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to sage-devel-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---