Skip to content

Package of (Cayley) tree generators and numerical algorithms for solving tight-binding models on these trees

License

Notifications You must be signed in to change notification settings

wandafulworld/cayleytree

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Logo

cayleytree

A package to create and solve large Cayley trees!
View Demo

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. License
  5. Acknowledgments

About The Project

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.

(back to top)

Built With

This project was partially built on top of networkx

(back to top)

Getting Started

Coming soon...

Usage

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()
example_draw_cayleytree

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()
Logo

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

(back to top)

License

Distributed under the CC BY-NC-SA 4.0 License. See LICENSE for more information.

(back to top)

Acknowledgments

Coming soon....

(back to top)

About

Package of (Cayley) tree generators and numerical algorithms for solving tight-binding models on these trees

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages