[sage-devel] Re: abs() for (very) long integers?

2010-02-02 Thread Dima Pasechnik
David, I am trying the fix the doctests bug in sage/graphs/generic_graph.py where M is assigned the character table of a group. Obviously det(M) can only be correct up to a sign, as we have no control over the order of rows and/or columns of M. So this is actually a doctests-specific probem: if I

[sage-devel] Re: abs() for (very) long integers?

2010-02-02 Thread Dima Pasechnik
Robert, I don't understand what you suggest. Try the following: replace the line 10222 of sage/graphs/generic_graph.py with sage: abs(M.determinant()) (the original line does not have abs()) and run sage -t -long devel/sage/sage/graphs/generic_graph.py You should see the result above.

[sage-devel] Re: abs() for (very) long integers?

2010-02-02 Thread John H Palmieri
On Feb 2, 7:03 pm, Dima Pasechnik dimp...@gmail.com wrote: Robert, I don't understand what you suggest. Try the following: replace the line 10222 of sage/graphs/generic_graph.py with     sage: abs(M.determinant()) (the original line does not have abs()) and run sage -t -long

Re: [sage-devel] Re: abs() for (very) long integers?

2010-02-02 Thread Alex Ghitza
On Tue, 2 Feb 2010 19:40:11 -0800 (PST), John H Palmieri jhpalmier...@gmail.com wrote: sage: C = graphs.CubeGraph(4) sage: G = C.automorphism_group() sage: M = G.character_table() sage: M.determinant() -712483534798848 sage: parent(M.determinant()) Cyclotomic Field of order 1 and degree 1

Re: [sage-devel] Re: abs() for (very) long integers?

2010-02-02 Thread Robert Bradshaw
On Feb 2, 2010, at 7:40 PM, John H Palmieri wrote: On Feb 2, 7:03 pm, Dima Pasechnik dimp...@gmail.com wrote: Robert, I don't understand what you suggest. Try the following: replace the line 10222 of sage/graphs/generic_graph.py with sage: abs(M.determinant()) (the original line does not

Re: [sage-devel] Re: abs() for (very) long integers?

2010-02-02 Thread Nick Alexander
sage: d = M.determinant() sage: d.norm().abs() # take norm to get an integer 712483534798848 I thought of this as well, but it could be wrong since there might be an element of the appropriate norm in the cyclotomic field that is erroneously returned! I suggest QQ(d).abs() :) Nick

[sage-devel] Re: abs() for (very) long integers?

2010-02-02 Thread Dima Pasechnik
it looks OK just to coerse to integer and then do the python's abs: ZZ(d).abs() By the way, the determinant of a character table is either in Z or in sqrt(-1)Z DIma On Feb 3, 12:34 pm, Nick Alexander ncalexan...@gmail.com wrote: sage: d = M.determinant() sage: d.norm().abs()       # take

Re: [sage-devel] Re: abs() for (very) long integers?

2010-02-02 Thread Alex Ghitza
On Tue, 2 Feb 2010 20:34:58 -0800, Nick Alexander ncalexan...@gmail.com wrote: sage: d = M.determinant() sage: d.norm().abs() # take norm to get an integer 712483534798848 I thought of this as well, but it could be wrong since there might be an element of the appropriate norm in

[sage-devel] Re: abs() for (very) long integers?

2010-02-02 Thread Dima Pasechnik
By the way, the determinant of a character table is either in Z or in sqrt(-1)Z oops, I meant to say that the square of the determinant of a character table is a positive integer (namely, the sum of the orders of the centralisers of representatives of conjugacy classes) Dima -- To post to