On Tue, 26 Jan 2010 03:31:57 -0800 (PST), Dima Pasechnik <dimp...@gmail.com> wrote: > Which Sage are you using? (in my case it is 4.3.1, on Debian Linux > x86), > and with gap-4.4.12, as well as with the original 4.3.1's gap-4.4.10, > I get, > > sage: g=GL(2,3) > sage: sorted([x.values() for x in g.irreducible_characters()]) > [[1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, -1, -1, -1], [2, -1, 2, -1, > 2, 0, 0, 0], [2, 1, -2, -1, 0, -zeta8^3 - zeta8, zeta8^3 + zeta8, 0], > [2, 1, -2, -1, 0, zeta8^3 + zeta8, -zeta8^3 - zeta8, 0], [3, 0, 3, 0, > -1, 1, 1, -1], [3, 0, 3, 0, -1, -1, -1, 1], [4, -1, -4, 1, 0, 0, 0, > 0]]) >
So it turns out this is due to the comparison of elements of number fields (and in particular of cyclotomic fields) behaving in very strange ways. Because of that, trying to sort the lists of values of irreducible characters *as Sage objects* is pointless right now. Maybe there will be a good fix for this. In the mean time, what the patch is doing is comparing the lists of values *as GAP objects*. This actually calls GAP behind the scenes and seems to order things in a reasonably nice way. Anyway, this explains why I was getting sorted lists and you were not, even though it looked like we were doing roughly the same things. So after all this I'm still not sure what the right fix is. If GAP often gives us the characters in an order that's standard (e.g. following the Atlas), then of course it would be rather annoying for Sage to sort the list according to some other half-baked criterion. On the other hand, if there are situations where a randomised algorithm is used and the ordering is not guaranteed to always be the same, that's going to mess with our doctests. Having written this paragraph and read it a couple of times, I tend to say: (a) fix the doctest "broken" by the upgrade to gap 4.4.12 manually (no sorting, just replace the old answer by the new one) (b) don't touch irreducible_characters() and respect whatever ordering GAP gives, and (c) if/when comparison of Sage number field elements gets fixed, replace the said doctest with the one using sorted() This would my proposal for irreducible_characters(). For word_problem(), I still think that returning a sorted list is a good idea, but I'd like to know what David thinks. Best, Alex -- Alex Ghitza -- Lecturer in Mathematics -- The University of Melbourne -- Australia -- http://www.ms.unimelb.edu.au/~aghitza/ -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org