| 1 | initial version |
instead of .eigenvalues() use .charpoly().roots(ZZ).
| 2 | No.2 Revision |
Integer eigen values can be obtained with .charpoly().roots(ZZ) instead of .eigenvalues() use . Correspondingly, the graphs you look for, can be obtained as.charpoly().roots(ZZ).
n = 8
for G in graphs.nauty_geng(f"{n} -c"):
if sum(m for _,m in G.adjacency_matrix().charpoly().roots(ZZ))==n and sum(m for _,m in G.laplacian_matrix().charpoly().roots(ZZ))==n:
G.show()
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.