Jason Grout wrote: > > Robert's patch on trac #1900 affords an opportunity to bring up a small > simplification of adjacency_matrix(). It seems that the over_integers > parameter over-complicates the interface. There are other more standard > ways of specifying the ring over which you would like a matrix, like: > > sage: # G is the graph > sage: matrix(GF(2),G) > > or > > sage: G.am().change_ring(GF(2)) > > Can we get rid of the over_integers parameter in favor of these two ways > of requesting a matrix over a specific ring? No functionality is lost > (since the GF(2) matrix was only returned if there were no multiple > edges). Simplicity seems to be gained, since, at least as far as I'm > aware, adjacency matrices are usually thought to be over the integers, > not over GF(2), even though we understand they are zero-one matrices. > > Of course, if I'm mistaken, let me know.
I've updated the over_integers patch to fix a call which used the parameter which threw an error in a doctest. More troubling, however, is that the characteristic polynomial of a graph (g.characteristic_polynomial()) was giving completely *wrong* output because it was calculating the polynomial with a GF(2) matrix instead of an integer matrix. Even worse, there was a doctest for the function, but the doctest also had the wrong answer! Whoever wrote the characteristic_polynomial function (or updated the doctest) was bitten by the unexpected return of a matrix over GF(2) and then did not check to make sure that the doctest was testing a correct result. I guess this makes me feel more strongly about deleting the over_integers parameter and making the adjacency matrix returned over the integers. I guess this also makes me feel more strongly about hand-checking or at least checking with another trusted system every doctest when it is written or updated. Thanks, Jason --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---