sgtl.spectrum.adjacency_spectrum

sgtl.spectrum.adjacency_spectrum(graph: sgtl.graph.Graph, num_eigenvalues=None, plot=False) List[complex]

Return a list of the eigenvalues of the adjacency matrix of the given graph.

Computing all of the eigenvalues of the adjacency matrix is an expensive operation. You should set num_eigenvalues to control the number of eigenvalues you would like to compute.

If the plot argument is true, then the spectrum is plotted using matplotlib before being returned.

Parameters
  • graph – The SGTL graph object on which to operate.

  • num_eigenvalues – How many eigenvalues to return. If this value is not none, the method will return the eigenvalues with the maximum absolute values.

  • plot – Whether to plot the spectrum before returning it