On Sun, Jul 25, 2010 at 8:10 PM, Carl Witty <carl.wi...@gmail.com> wrote: > You seem to want to make the vertex dictionary respect the equivalence > relation defined by Sage equality. If so, you're going to be in > trouble, since Sage equality actually is not an equivalence relation:
Is it really too much to ask? It sounds like the proper thing to do here, then, is to adjust the circulant graph constructor to use Mod(i) instead of i in the edge additions, and then profusely document this issue -- perhaps a whole chapter in the reference manual about graph gotchas... This is just really unsatisfying. I like the idea of having graphs be free enough that you can make anything you want a vertex. A mathematician would not usually say that the integer is equal to the coset. I can see why we might want > sage: 3 == Mod(7, 4) > True But this highlights yet another place where mathematics and computer science are less than perfect bedfellows. Just a day or two ago this sort of thing was discovered in another thread. In short, Python sets do not implement a total ordering (since < means inclusion), and so are not sortable... What to do, what to do? Definition: Mod(n, m, parent=None) Docstring: Return the equivalence class of n modulo m as an element of ZZ/mZZ. According to this definition, I would expect sage: Integer(7) == Mod(7,12) False Following the Python set notation, which I think is equally silly but much harder to change, we would have sage: Integer(7) < Mod(7,12) True .......... -- Robert L. Miller http://www.rlmiller.org/ -- 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