TreePeak

3435 days ago by chlin

def find_valley(l): ##this function already assume l is unimodal, and it has just one valley; n=len(l); valley=min(l); for i in range(n): if l[i]==valley: break; return i; def scale2(l): n=len(l); for k in range(n): l[k]=l[k]*2^(k); return l; 
       
for n in range(1,21): for g in graphs.nauty_geng("%s %s:%s -c"%(n,n-1,n-1)): p=g.distance_matrix().characteristic_polynomial(); vly=find_valley(scale2(p.coeffs())); if vly<n//2 or vly>integer_ceil(n*(1-1/sqrt(5))): print n,g.graph6_string(); print n, "done"; 
       
1 done
2 A_
2 done
3 done
4 done
5 done
6 done
7 done
8 done
9 done
10 done
11 done
12 done
13 done
14 done
15 done
16 done
17 done
18 done
Traceback (click to the left of this block for traceback)
...
sage.ext.c_lib.SignalError: Segmentation fault
1 done
2 A_
2 done
3 done
4 done
5 done
6 done
7 done
8 done
9 done
10 done
11 done
12 done
13 done
14 done
15 done
16 done
17 done
18 done
Traceback (most recent call last):        print n, "done";
  File "", line 1, in <module>
    
  File "/tmp/tmpNfgYX3/___code___.py", line 3, in <module>
    exec compile(u'for n in range(_sage_const_1 ,_sage_const_21 ):\n    for g in graphs.nauty_geng("%s %s:%s -c"%(n,n-_sage_const_1 ,n-_sage_const_1 )):\n        p=g.distance_matrix().characteristic_polynomial();\n        vly=find_valley(scale2(p.coeffs()));\n        if vly<n//_sage_const_2  or vly>integer_ceil(n*(_sage_const_1 -_sage_const_1 /sqrt(_sage_const_5 ))):\n            print n,g.graph6_string();\n    print n, "done";
  File "", line 3, in <module>
    
  File "matrix2.pyx", line 1486, in sage.matrix.matrix2.Matrix.characteristic_polynomial (sage/matrix/matrix2.c:10837)
  File "matrix_integer_dense.pyx", line 1035, in sage.matrix.matrix_integer_dense.Matrix_integer_dense.charpoly (sage/matrix/matrix_integer_dense.c:11990)
  File "matrix_integer_dense.pyx", line 1092, in sage.matrix.matrix_integer_dense.Matrix_integer_dense._charpoly_linbox (sage/matrix/matrix_integer_dense.c:12693)
  File "matrix_integer_dense.pyx", line 1114, in sage.matrix.matrix_integer_dense.Matrix_integer_dense._poly_linbox (sage/matrix/matrix_integer_dense.c:12980)
  File "c_lib.pyx", line 97, in sage.ext.c_lib.sig_raise_exception (sage/ext/c_lib.c:1208)
sage.ext.c_lib.SignalError: Segmentation fault