Sum of one over - but not cospectral

3983 days ago by butler

def make_laplacian(G): L=Matrix(QQ,G.order(),G.order()) for i in range(G.order()): for j in G.neighbors(i): L[i,j]=-1/G.degree(i) L[i,i]=1 return L 
       
def are_cospectral(G,H): A=make_laplacian(G) B=make_laplacian(H) f=A.characteristic_polynomial(x) q=f.coeffs() g=B.characteristic_polynomial(x) r=g.coeffs() return q==r 
       
def one_over_graphs(n,display_graphs=True): x=var('x') print "Working on "+str(n)+" vertex graphs" one_over={} for G in graphs.nauty_geng(str(n)+" -c"): A=make_laplacian(G) #A=G.laplacian_matrix(normalized=True) f=A.characteristic_polynomial(x) q=f.coeffs() t=-1*f[2]/f[1] if t in one_over: one_over[t].append(G.graph6_string()) else: one_over[t]=[G.graph6_string()] if display_graphs: for t in one_over: if len(one_over[t])>1: print "====================================" print "The following graphs have same sum" print "of one over the eigenvalues = "+str(t) for x in one_over[t]: Graph(x).show() print "====================================" print "Qapla!" return one_over 
       
def look_for_subgraphs(n): one_over=one_over_graphs(n,display_graphs=False) for t in one_over: if len(one_over[t])>1: for x in one_over[t]: for y in one_over[t]: if not x==y: G=Graph(x) H=Graph(y) if G.subgraph_search_count(H): if not are_cospectral(G,H): print "Following have same sum of one over = "+str(t) print "And are NOT cospectral" print x,y G.show() H.show() print "====================================" 
       
look_for_subgraphs(4) 
       
Working on 4 vertex graphs
Qapla!
Working on 4 vertex graphs
Qapla!
look_for_subgraphs(5) 
       
Working on 5 vertex graphs
Qapla!
Following have same sum of one over = 7/2
And are NOT cospectral
DT{ D?{
====================================
Working on 5 vertex graphs
Qapla!
Following have same sum of one over = 7/2
And are NOT cospectral
DT{ D?{
====================================
look_for_subgraphs(6) 
       
Working on 6 vertex graphs
Qapla!
Working on 6 vertex graphs
Qapla!
look_for_subgraphs(7) 
       
Working on 7 vertex graphs
Qapla!
Following have same sum of one over = 8
And are NOT cospectral
FCQrW F?bDo
====================================
Following have same sum of one over = 13/2
And are NOT cospectral
F?zVO FCZf?
====================================
Following have same sum of one over = 17/3
And are NOT cospectral
FCqnw F?Bfw
====================================
Following have same sum of one over = 20/3
And are NOT cospectral
FCXno FCQvo
====================================
Following have same sum of one over = 191/35
And are NOT cospectral
FCf~w F?r~w
====================================
Following have same sum of one over = 187/30
And are NOT cospectral
FQjVo FCY^_
====================================
Following have same sum of one over = 38/5
And are NOT cospectral
FQinO FCXmW
====================================
Working on 7 vertex graphs
Qapla!
Following have same sum of one over = 8
And are NOT cospectral
FCQrW F?bDo
====================================
Following have same sum of one over = 13/2
And are NOT cospectral
F?zVO FCZf?
====================================
Following have same sum of one over = 17/3
And are NOT cospectral
FCqnw F?Bfw
====================================
Following have same sum of one over = 20/3
And are NOT cospectral
FCXno FCQvo
====================================
Following have same sum of one over = 191/35
And are NOT cospectral
FCf~w F?r~w
====================================
Following have same sum of one over = 187/30
And are NOT cospectral
FQjVo FCY^_
====================================
Following have same sum of one over = 38/5
And are NOT cospectral
FQinO FCXmW
====================================
html('<!--notruncate-->') look_for_subgraphs(8) 
       
Working on 8 vertex graphs
Qapla!
Following have same sum of one over = 7
And are NOT cospectral
G?`vj{ G??Fvg
====================================
Following have same sum of one over = 9
And are NOT cospectral
G?aJFo G?ABFo
====================================
Following have same sum of one over = 12
And are NOT cospectral
G?ouPw G?b@d_
====================================
Following have same sum of one over = 13/2
And are NOT cospectral
GCe^~w G??F~w
====================================
Following have same sum of one over = 13/2
And are NOT cospectral
GCvUv{ G???F{
====================================
Following have same sum of one over = 21/2
And are NOT cospectral
G?BEDo G?AEDo
====================================
Following have same sum of one over = 29/4
And are NOT cospectral
G?ott{ G?AEL{
====================================
Following have same sum of one over = 29/3
And are NOT cospectral
GCdbMw G?b@bo
====================================
Following have same sum of one over = 29/3
And are NOT cospectral
GCdbMw GCQRUw
====================================
Following have same sum of one over = 39/4
And are NOT cospectral
GCdbF_ GCQRF_
====================================
Following have same sum of one over = 63/8
And are NOT cospectral
GCQbro G?bBRo
====================================
Following have same sum of one over = 73/10
And are NOT cospectral
GCZLlk G?AFb[
====================================
Following have same sum of one over = 65/8
And are NOT cospectral
G?aJfw G?B@fw
====================================
Following have same sum of one over = 69/10
And are NOT cospectral
G?BFfw G??Ffw
====================================
Following have same sum of one over = 69/10
And are NOT cospectral
G?`vnw G??Ffw
====================================
Following have same sum of one over = 69/10
And are NOT cospectral
G?`vnw G?BFfw
====================================
Following have same sum of one over = 95/12
And are NOT cospectral
GCOefw G?`DFw
====================================
Following have same sum of one over = 93/10
And are NOT cospectral
GCdcvg G?r@f_
====================================
Following have same sum of one over = 101/12
And are NOT cospectral
GCQRFk G?ABFs
====================================
Following have same sum of one over = 147/20
And are NOT cospectral
GCXk{{ G?AFK{
====================================
Following have same sum of one over = 129/16
And are NOT cospectral
G?`cv[ G?AEFo
====================================
Following have same sum of one over = 179/24
And are NOT cospectral
GCQfVK G?BDLw
====================================
Following have same sum of one over = 203/30
And are NOT cospectral
G?aN]{ G?BFn[
====================================
Following have same sum of one over = 289/40
And are NOT cospectral
G?aK^w G?BEFw
====================================
Following have same sum of one over = 263/36
And are NOT cospectral
GQil^{ G??Fe[
====================================
Following have same sum of one over = 13
And are NOT cospectral
GCdbE_ G?B@v?
====================================
Following have same sum of one over = 583/84
And are NOT cospectral
GQinvs GCXnvs
====================================
Following have same sum of one over = 20/3
And are NOT cospectral
GQjn^w G?Bvfw
====================================
Following have same sum of one over = 181/20
And are NOT cospectral
GCQTec G?`amK
====================================
Following have same sum of one over = 167/20
And are NOT cospectral
GCQuec G?`vF?
====================================
Following have same sum of one over = 161/20
And are NOT cospectral
G?aK^o G?BENo
====================================
Following have same sum of one over = 197/24
And are NOT cospectral
GCQdbw G?bAV_
====================================
Following have same sum of one over = 281/40
And are NOT cospectral
GCQvl{ G?Bem[
====================================
Following have same sum of one over = 89/10
And are NOT cospectral
GCZUmk G?`fBk
====================================
Following have same sum of one over = 111/14
And are NOT cospectral
GCOed{ G??CFw
====================================
Following have same sum of one over = 463/60
And are NOT cospectral
GCdcv{ G?ABfw
====================================
Following have same sum of one over = 317/44
And are NOT cospectral
GCQu^W G?BDlw
====================================
Following have same sum of one over = 449/48
And are NOT cospectral
GCQrRW G?ABeS
====================================
Following have same sum of one over = 137/12
And are NOT cospectral
GCQRVS G?B@tc
====================================
Following have same sum of one over = 439/60
And are NOT cospectral
GCdffk G?AENs
====================================
Working on 8 vertex graphs
Qapla!
Following have same sum of one over = 7
And are NOT cospectral
G?`vj{ G??Fvg
====================================
Following have same sum of one over = 9
And are NOT cospectral
G?aJFo G?ABFo
====================================
Following have same sum of one over = 12
And are NOT cospectral
G?ouPw G?b@d_
====================================
Following have same sum of one over = 13/2
And are NOT cospectral
GCe^~w G??F~w
====================================
Following have same sum of one over = 13/2
And are NOT cospectral
GCvUv{ G???F{
====================================
Following have same sum of one over = 21/2
And are NOT cospectral
G?BEDo G?AEDo
====================================
Following have same sum of one over = 29/4
And are NOT cospectral
G?ott{ G?AEL{
====================================
Following have same sum of one over = 29/3
And are NOT cospectral
GCdbMw G?b@bo
====================================
Following have same sum of one over = 29/3
And are NOT cospectral
GCdbMw GCQRUw
====================================
Following have same sum of one over = 39/4
And are NOT cospectral
GCdbF_ GCQRF_
====================================
Following have same sum of one over = 63/8
And are NOT cospectral
GCQbro G?bBRo
====================================
Following have same sum of one over = 73/10
And are NOT cospectral
GCZLlk G?AFb[
====================================
Following have same sum of one over = 65/8
And are NOT cospectral
G?aJfw G?B@fw
====================================
Following have same sum of one over = 69/10
And are NOT cospectral
G?BFfw G??Ffw
====================================
Following have same sum of one over = 69/10
And are NOT cospectral
G?`vnw G??Ffw
====================================
Following have same sum of one over = 69/10
And are NOT cospectral
G?`vnw G?BFfw
====================================
Following have same sum of one over = 95/12
And are NOT cospectral
GCOefw G?`DFw
====================================
Following have same sum of one over = 93/10
And are NOT cospectral
GCdcvg G?r@f_
====================================
Following have same sum of one over = 101/12
And are NOT cospectral
GCQRFk G?ABFs
====================================
Following have same sum of one over = 147/20
And are NOT cospectral
GCXk{{ G?AFK{
====================================
Following have same sum of one over = 129/16
And are NOT cospectral
G?`cv[ G?AEFo
====================================
Following have same sum of one over = 179/24
And are NOT cospectral
GCQfVK G?BDLw
====================================
Following have same sum of one over = 203/30
And are NOT cospectral
G?aN]{ G?BFn[
====================================
Following have same sum of one over = 289/40
And are NOT cospectral
G?aK^w G?BEFw
====================================
Following have same sum of one over = 263/36
And are NOT cospectral
GQil^{ G??Fe[
====================================
Following have same sum of one over = 13
And are NOT cospectral
GCdbE_ G?B@v?
====================================
Following have same sum of one over = 583/84
And are NOT cospectral
GQinvs GCXnvs
====================================
Following have same sum of one over = 20/3
And are NOT cospectral
GQjn^w G?Bvfw
====================================
Following have same sum of one over = 181/20
And are NOT cospectral
GCQTec G?`amK
====================================
Following have same sum of one over = 167/20
And are NOT cospectral
GCQuec G?`vF?
====================================
Following have same sum of one over = 161/20
And are NOT cospectral
G?aK^o G?BENo
====================================
Following have same sum of one over = 197/24
And are NOT cospectral
GCQdbw G?bAV_
====================================
Following have same sum of one over = 281/40
And are NOT cospectral
GCQvl{ G?Bem[
====================================
Following have same sum of one over = 89/10
And are NOT cospectral
GCZUmk G?`fBk
====================================
Following have same sum of one over = 111/14
And are NOT cospectral
GCOed{ G??CFw
====================================
Following have same sum of one over = 463/60
And are NOT cospectral
GCdcv{ G?ABfw
====================================
Following have same sum of one over = 317/44
And are NOT cospectral
GCQu^W G?BDlw
====================================
Following have same sum of one over = 449/48
And are NOT cospectral
GCQrRW G?ABeS
====================================
Following have same sum of one over = 137/12
And are NOT cospectral
GCQRVS G?B@tc
====================================
Following have same sum of one over = 439/60
And are NOT cospectral
GCdffk G?AENs
====================================