Table of Contents
This package provides a flexible framework to experiment with Cayley trees and variations thereof up to enourmous sizes, by using recent advances in our understanding of Cayley trees. This has been developed as part of the research of Prof. Tomáš Bzdušek team on the topological order of hyperbolic lattices.
Core functionalities:
- Seven Cayley tree variations have been implemented, whereof five can be solved for their adjacency spectrum to almost arbitrary sizes using what is called "Mahan's approach".
- Each tree has been built on a networkx graph object, allowing to experiment on it with the full power of the graph theoretical tools implemented in networkx
- Each tree comes with out-of-the-box adjacency spectrum solvers and plotting options.
This project was partially built on top of networkx
Coming soon...
cayleytree comes with some simple, out-of-the box functions to plot graphs and their respective adjacency spectrum. To plot the chosen tree, simply use the draw() method:
import matplotlib.pyplot as plt
from cayleytree.IsotropicTrees import CayleyTree
fig, ax_list = plt.subplots(1,1,sharex=True,figsize=(5,5))
C = CayleyTree(4,3)
C.draw(ax_list)
plt.show()
To plot the spectrum of the tree, use the plot_spectrum() method. For isotropic trees (invariant under permutation of branches) it is possible to plot extremely large trees
import matplotlib.pyplot as plt
from decimal import Decimal
from cayleytree.IsotropicTrees import CayleyTree
from cayleytree.IsotropicTrees import LiebCayley
fig, ax_list = plt.subplots(2,1,sharex=True,figsize=(8,5))
C = CayleyTree(200,3)
LC = LiebCayley(200,3)
C.plot_spectrum(ax_list[0],nbins=400)
ax_list[0].set_title('Cayley Tree Spectrum, N = ' + "{:.2E}".format(Decimal(str(C.N))))
LC.plot_spectrum(ax_list[1],nbins=400)
ax_list[1].set_title('Lieb-Cayley Tree Spectrum, N = ' + "{:.2E}".format(Decimal(str(LC.N))))
for ax in ax_list:
ax.semilogy()
plt.tight_layout()
plt.show()
It is generally recommended to use a semilog plot for large trees, due to the high degeneracy of some eigenvalues.
Finally, if you want to work with the underlying graph object, use the "G" attribute of the tree. Note that if the tree has more than 4000 nodes, the tree will not instantiate the graph object unless you force it by setting force_graph_object_creation = True. Be aware, that large trees can easily kill your RAM.
import networkx as nx
from cayleytree.IsotropicTrees import LiebCayley
LC = LiebCayley(20,2,force_graph_object_creation = True)
nx.diameter(LC.G)
>>> 40
Distributed under the CC BY-NC-SA 4.0 License. See LICENSE for more information.
Coming soon....

