[sage-support] Re: sage-nauty-directed graphs isomorphism vs. magma -- smth is very wrong

2014-03-03 Thread Chris Godsil
I would not be surprised it it was the finite field arithmetic that is 
causing the difference.

On Friday, February 28, 2014 4:18:44 PM UTC-5, Aleksandr Kodess wrote:

 As far as I know both sage and magma utilize Brendan McKay's program nauty 
 in order to check whether two given graphs (directed or undirected) are 
 isomorphic. As is demonstrated by the following example, sage and magma 
 greatly differ in the efficiency in which this program is utilized.

 # sage code
 q = 19
 n1 = 7
 n2 = 13
 F = FiniteField(q, 'xi')
 V = [(x,y) for x in F for y in F]
 G1 = DiGraph([V, lambda x,y: x[1] + y[1] == x[0]*(y[0]**n1)])
 G2 = DiGraph([V, lambda x,y: x[1] + y[1] == x[0]*(y[0]**n2)])
 G1.is_isomorphic(G2)

 // magma code for the same operation
 q := 19;
 n1 := 7;
 n2 := 13;
 F := FiniteField(q);
 V := {[x,y] : x,y in F};
 G1 := Digraph V|{ [x,y] : x,y in V | x[2] + y[2] eq 
 ((x[1])^1)*((y[1])^n1)};
 G2 := Digraph V|{ [x,y] : x,y in V | x[2] + y[2] eq 
 ((x[1])^1)*((y[1])^n2)};
 IsIsomorphic(G1,G2);


 It takes sage forever to test whether these two directed graphs of order 
 19^2 are isomorphic (they are in fact not), while it takes magma only a 
 second. The same problem occurs for other values of q, n1 and n2. The 
 version of sage I'm running is 5.12, and the version of magma I'm running 
 is 2.19.10.

 Is this a known issue? Is this going to be fixed any time soon?



-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.


[sage-support] Re: SIGABRT in Graph.clique_number() and assertion in cliquer

2012-12-03 Thread Chris Godsil
sage: k4=graphs.CompleteGraph(4)
sage: k4.complement().line_graph().complement()
complement(): Graph on 0 vertices

clique_number() is crashing on the empty graph, 

On Saturday, December 1, 2012 9:30:27 AM UTC-5, Georgi Guninski wrote:

 for g in graphs(4): 
  g.complement().line_graph().complement().clique_number() 


 cliquer file graph.c: line 31: assertion failed: (n0) 

 Unhandled SIGABRT: An abort() occurred in Sage. 
 This probably occurred because a *compiled* component of Sage has a bug 

 On sagenb.org don't get any output, don't know how to interpret this. 



-- 
You received this message because you are subscribed to the Google Groups 
sage-support group.
To post to this group, send email to sage-support@googlegroups.com.
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support?hl=en.




[sage-support] show3d does not show (on a mac)

2009-12-28 Thread Chris Godsil
I'm running OS 10.6.2 a Mac airbook.  I had problems with the binary
sage-4.3-osx10.6-intel-64bit-i386-Darwin.dmg, so I downloaded the
source and compiled it.  I've found that show3d() does not work.
After the commands

  sage: P = graphs.PetersenGraph()
  sage: P.show3d()

I get the sage prompt and no drawing window.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] Re: show3d does not show (on a mac)

2009-12-28 Thread Chris Godsil
Under sage-4.2, the command P.show3d() works, giving a jmol drawing.
From what a very quick look
revealed, the result of P.=show3d? is the same under sage 4.2 and 4.3.

I am reporting this chiefly as a data point.

Thsnks
Chris

On Dec 28, 11:33 am, kcrisman kcris...@gmail.com wrote:
 It seems that this is poor documentation at work.

 sage: P.show3d(engine='tachyon')

 works fine, but it isn't obvious from

 sage: P.show3d?

 that one has to specify this.  Apparently jmol isn't rendering this,
 at least not on Macs.  Someone more knowledgeable about Jmol will
 hopefully reply with more details, but in the meantime the tachyon
 plotter should do at least some of what you want.

 - kcrisman

 On Dec 28, 10:53 am, Chris Godsil cgod...@uwaterloo.ca wrote:



  I'm running OS 10.6.2 a Mac airbook.  I had problems with the binary
  sage-4.3-osx10.6-intel-64bit-i386-Darwin.dmg, so I downloaded the
  source and compiled it.  I've found that show3d() does not work.
  After the commands

    sage: P = graphs.PetersenGraph()
    sage: P.show3d()

  I get the sage prompt and no drawing window.

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org


[sage-support] eigenvalue difficulties

2009-09-18 Thread Chris Godsil

I'm running Mac OS X 10.6.1.  The command matrix.eigenvalues() has
stopped working, as follows:

wombat:sgwork chris$ sage
--
| Sage Version 4.1, Release Date: 2009-07-09 |
| Type notebook() for the GUI, and license() for information.|
--
sage: C = graphs.CycleGraph(5)
sage: A = C.am()
sage: A.eigenvalues()
---
RuntimeError  Traceback (most recent call
last)

/Users/chris/Code/sgwork/ipython console in module()

/Applications/sage/local/lib/python2.6/site-packages/sage/matrix/
matrix2.so in sage.matrix.matrix2.Matrix.eigenvalues (sage/matrix/
matrix2.c:19901)()

/Applications/sage/local/lib/python2.6/site-packages/sage/matrix/
matrix2.so in sage.matrix.matrix2.Matrix.fcp (sage/matrix/matrix2.c:
8560)()

/Applications/sage/local/lib/python2.6/site-packages/sage/matrix/
matrix_integer_dense.so in
sage.matrix.matrix_integer_dense.Matrix_integer_dense.charpoly (sage/
matrix/matrix_integer_dense.c:10599)()

/Applications/sage/local/lib/python2.6/site-packages/sage/matrix/
matrix_integer_dense.so in
sage.matrix.matrix_integer_dense.Matrix_integer_dense._charpoly_linbox
(sage/matrix/matrix_integer_dense.c:11242)()

RuntimeError:

--
Thanks for any help

Chris Godsil

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: eigenvalue difficulties

2009-09-18 Thread Chris Godsil

Thanks.  I tried that but the problem remains.

Chris

On Sep 18, 11:07 pm, William Stein wst...@gmail.com wrote:
 On Fri, Sep 18, 2009 at 8:05 PM, Chris Godsil cgod...@uwaterloo.ca wrote:

  I'm running Mac OS X 10.6.1.  The command matrix.eigenvalues() has
  stopped working, as follows:

 You have to force a rebuild of linbox.  This will get fully resolved
 when Sage gets ported to OS X 10.6.

        sage -f linbox-1.1.6.p0

 William







  wombat:sgwork chris$ sage
  --
  | Sage Version 4.1, Release Date: 2009-07-09                         |
  | Type notebook() for the GUI, and license() for information.        |
  --
  sage: C = graphs.CycleGraph(5)
  sage: A = C.am()
  sage: A.eigenvalues()
  ---
  RuntimeError                              Traceback (most recent call
  last)

  /Users/chris/Code/sgwork/ipython console in module()

  /Applications/sage/local/lib/python2.6/site-packages/sage/matrix/
  matrix2.so in sage.matrix.matrix2.Matrix.eigenvalues (sage/matrix/
  matrix2.c:19901)()

  /Applications/sage/local/lib/python2.6/site-packages/sage/matrix/
  matrix2.so in sage.matrix.matrix2.Matrix.fcp (sage/matrix/matrix2.c:
  8560)()

  /Applications/sage/local/lib/python2.6/site-packages/sage/matrix/
  matrix_integer_dense.so in
  sage.matrix.matrix_integer_dense.Matrix_integer_dense.charpoly (sage/
  matrix/matrix_integer_dense.c:10599)()

  /Applications/sage/local/lib/python2.6/site-packages/sage/matrix/
  matrix_integer_dense.so in
  sage.matrix.matrix_integer_dense.Matrix_integer_dense._charpoly_linbox
  (sage/matrix/matrix_integer_dense.c:11242)()

  RuntimeError:

  --
  Thanks for any help

  Chris Godsil

 --
 William Stein
 Associate Professor of Mathematics
 University of Washingtonhttp://wstein.org
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: eigenvalue difficulties

2009-09-18 Thread Chris Godsil

Thanks again.  Tried that too, no effect - same error.

I have access to a Mac running 10.5, so it will not it be a serious
problem if I have to wait for the nest release.
And I should be writing reference letters anyway...

Chris

On Sep 18, 11:31 pm, William Stein wst...@gmail.com wrote:
 On Fri, Sep 18, 2009 at 8:25 PM, Chris Godsil cgod...@uwaterloo.ca wrote:

  Thanks.  I tried that but the problem remains.

 One other thing to try would be to rebuild the sage--linbox
 extension (which is easy). Just do the following from the root of your
 Sage install:

 flat:sage wstein$ touch devel/sage/sage/libs/linbox/*
 flat:sage wstein$ ./sage -br

 William







  Chris

  On Sep 18, 11:07 pm, William Stein wst...@gmail.com wrote:
  On Fri, Sep 18, 2009 at 8:05 PM, Chris Godsil cgod...@uwaterloo.ca wrote:

   I'm running Mac OS X 10.6.1.  The command matrix.eigenvalues() has
   stopped working, as follows:

  You have to force a rebuild of linbox.  This will get fully resolved
  when Sage gets ported to OS X 10.6.

         sage -f linbox-1.1.6.p0

  William

   wombat:sgwork chris$ sage
   --
   | Sage Version 4.1, Release Date: 2009-07-09                         |
   | Type notebook() for the GUI, and license() for information.        |
   --
   sage: C = graphs.CycleGraph(5)
   sage: A = C.am()
   sage: A.eigenvalues()
   ---
   RuntimeError                              Traceback (most recent call
   last)

   /Users/chris/Code/sgwork/ipython console in module()

   /Applications/sage/local/lib/python2.6/site-packages/sage/matrix/
   matrix2.so in sage.matrix.matrix2.Matrix.eigenvalues (sage/matrix/
   matrix2.c:19901)()

   /Applications/sage/local/lib/python2.6/site-packages/sage/matrix/
   matrix2.so in sage.matrix.matrix2.Matrix.fcp (sage/matrix/matrix2.c:
   8560)()

   /Applications/sage/local/lib/python2.6/site-packages/sage/matrix/
   matrix_integer_dense.so in
   sage.matrix.matrix_integer_dense.Matrix_integer_dense.charpoly (sage/
   matrix/matrix_integer_dense.c:10599)()

   /Applications/sage/local/lib/python2.6/site-packages/sage/matrix/
   matrix_integer_dense.so in
   sage.matrix.matrix_integer_dense.Matrix_integer_dense._charpoly_linbox
   (sage/matrix/matrix_integer_dense.c:11242)()

   RuntimeError:

   --
   Thanks for any help

   Chris Godsil

  --
  William Stein
  Associate Professor of Mathematics
  University of Washingtonhttp://wstein.org

 --
 William Stein
 Associate Professor of Mathematics
 University of Washingtonhttp://wstein.org
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] determinants of matrix polynomials

2009-03-19 Thread Chris Godsil

I want to compute determinants of matrix polynomials, for matrices up  
to 20 x 20, say.
The attached transcript seems to indicate 9 or 10 might be my limit.   
(Or it's late
and I am being stupd?)

--
| Sage Version 3.4, Release Date:  
2009-03-11 |
| Type notebook() for the GUI, and license() for information.|
--
# intel mac pro, binary distribution

sage: P = graphs.PetersenGraph()
sage: P.delete_edge([0,1])
sage: P.degree()
[2, 2, 3, 3, 3, 3, 3, 3, 3, 3]
sage: P
Petersen graph: Graph on 10 vertices ## but P is not the Petersen  
graph now
sage: A = P.am()
sage: Id = identity_matrix(10)
sage: R.t = QQ[]
sage: (t+1)^5
t^5 + 5*t^4 + 10*t^3 + 10*t^2 + 5*t + 1
sage: M = t*Id - A; M

[ t  0  0  0 -1 -1  0  0  0  0]
[ 0  t -1  0  0  0 -1  0  0  0]
[ 0 -1  t -1  0  0  0 -1  0  0]
[ 0  0 -1  t -1  0  0  0 -1  0]
[-1  0  0 -1  t  0  0  0  0 -1]
[-1  0  0  0  0  t  0 -1 -1  0]
[ 0 -1  0  0  0  0  t  0 -1 -1]
[ 0  0 -1  0  0 -1  0  t  0 -1]
[ 0  0  0 -1  0 -1 -1  0  t  0]
[ 0  0  0  0 -1  0 -1 -1  0  t]
sage: M.det()  ## and sage hangs

## but the following worked
sage: K =graphs.CompleteGraph(3)
sage: B =K.am()
sage: Id = identity_matrix(3)
sage: (t*Id-B).det()
t^3 - 3*t - 2

sage: C = graphs.CubeGraph(3)
sage: C
3-Cube: Graph on 8 vertices
sage: Id = identity_matrix(8)
sage: (t*Id-C.am()).det()
t^8 - 12*t^6 + 30*t^4 - 28*t^2 + 9

# and the cycle on 9 vertices hangs


--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: determinants of matrix polynomials

2009-03-19 Thread Chris Godsil

Thanks for your comments so far.  Please note that I want to compute
determinants of
matrices whose entries are polynomials over QQ (so performance over ZZ
is irrelevant).
For the examples I offered, the determinants were characteristic
polynomials
but this would not be true for the cases I want to study.  Also I
would be computing tens of
thousands of these determinants, ideally with matrices of orders of up
to 30 x 30.
Eventually I may want to look at cases where the entries are
polynomials
in two or three variables.

So this leads to the following questions.
What algorithm(s) does sage use to compute determinants over QQ[t] or
QQ[t,u]?
Does they work over the ring of definition, or over the field of
fractions?
Are they polynomial time?

My limited experiments seem to suggest that the default algorithm sage
uses for matrices
over QQ[t] is not polynomial time. As the Reference Manual suggests, I
entered
M.determinant? to see what algorithm was being used, but did not get
any useful information.

Thanks
Chris


On Mar 19, 4:17 am, Chris Godsil cgod...@uwaterloo.ca wrote:
 I want to compute determinants of matrix polynomials, for matrices up  
 to 20 x 20, say.
 The attached transcript seems to indicate 9 or 10 might be my limit.  
 (Or it's late
 and I am being stupd?)

 --
 | Sage Version 3.4, Release Date:  
 2009-03-11                             |
 | Type notebook() for the GUI, and license() for information.        |
 --
 # intel mac pro, binary distribution

 sage: P = graphs.PetersenGraph()
 sage: P.delete_edge([0,1])
 sage: P.degree()
 [2, 2, 3, 3, 3, 3, 3, 3, 3, 3]
 sage: P
 Petersen graph: Graph on 10 vertices ## but P is not the Petersen  
 graph now
 sage: A = P.am()
 sage: Id = identity_matrix(10)
 sage: R.t = QQ[]
 sage: (t+1)^5
 t^5 + 5*t^4 + 10*t^3 + 10*t^2 + 5*t + 1
 sage: M = t*Id - A; M

 [ t  0  0  0 -1 -1  0  0  0  0]
 [ 0  t -1  0  0  0 -1  0  0  0]
 [ 0 -1  t -1  0  0  0 -1  0  0]
 [ 0  0 -1  t -1  0  0  0 -1  0]
 [-1  0  0 -1  t  0  0  0  0 -1]
 [-1  0  0  0  0  t  0 -1 -1  0]
 [ 0 -1  0  0  0  0  t  0 -1 -1]
 [ 0  0 -1  0  0 -1  0  t  0 -1]
 [ 0  0  0 -1  0 -1 -1  0  t  0]
 [ 0  0  0  0 -1  0 -1 -1  0  t]
 sage: M.det()  ## and sage hangs

 ## but the following worked
 sage: K =graphs.CompleteGraph(3)
 sage: B =K.am()
 sage: Id = identity_matrix(3)
 sage: (t*Id-B).det()
 t^3 - 3*t - 2

 sage: C = graphs.CubeGraph(3)
 sage: C
 3-Cube: Graph on 8 vertices
 sage: Id = identity_matrix(8)
 sage: (t*Id-C.am()).det()
 t^8 - 12*t^6 + 30*t^4 - 28*t^2 + 9

 # and the cycle on 9 vertices hangs
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] quaternions

2008-03-27 Thread Chris Godsil

I want to extract the real part of a quaternion, i.e., if

  L.i,j,k = QuaternionAlgebra(QQ,-1,-1);

and a is in L, then I want the coefficient of 1 in the expansion of as
a linear
combination of 1, i, j and k.

Is there a way to do this?  A graceful way?

(I have also discovered that using quaternions in combination with
list comprehensions
which have i as the dummy variable - [i for i in range(10)] - leads to
quite unexpected
results.  But I suspect this reflects an underlying problem in
python...)

Thanks in advance for any help.

Chris

--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---



[sage-support] Re: quaternions

2008-03-27 Thread Chris Godsil

Just for reference, two comments on the documentation for quaternions:

If x is an element of L as below, then neither x? nor x?? returns any
information about methods that apply to x.

Second, in the documentation on quaternions in the reference manual,
there is no reference that
I could find to the vector() method (and I went through this carefully
a number of times).  Also there
is no indication in the reference manual that vector() applies to
quaternions, although I did not
spend much time on this search.

But x.vector() does exactly what I need, and now I am an even-more
happy customer.

Chris

On Mar 27, 6:19 pm, Justin Walker [EMAIL PROTECTED] wrote:
 On Mar 27, 2008, at 12:58 PM, Chris Godsil wrote:



  I want to extract the real part of a quaternion, i.e., if

   L.i,j,k = QuaternionAlgebra(QQ,-1,-1);

  and a is in L, then I want the coefficient of 1 in the expansion of as
  a linear combination of 1, i, j and k.

  Is there a way to do this?  A graceful way?

 One way is:
    x.reduced_trace()/2
 since you are working over QQ :-}

 Another is x.vector()[0].

 Note that, if x is a Sage (or generally, python) object, x.TAB will  
 get you a list of methods that might[*] apply to x.  Then if 'foo'  
 is one, x.foo? will get you documentation[+] on what 'foo' does.

 HTH

 Justin

 [*] Some methods are shown due to inheritance, and might actually not  
 apply in a specific situation.

 [+] Documentation: the best documentation is had with ?? we might  
 not find it in either case, if it's not in a .py file.

 --
 Justin C. Walker, Curmudgeon at Large
 Director
 Institute for the Enhancement of the Director's Income
 ---
 Nobody knows the trouble I've been
 ---
--~--~-~--~~~---~--~~
To post to this group, send email to sage-support@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-support
URLs: http://www.sagemath.org
-~--~~~~--~~--~--~---