Tutorials#
This section contains a collection of tutorials demonstrating how to use PythTB to build and analyze tight-binding models. Each tutorial is provided as a Jupyter notebook (.ipynb) file, which includes both the code and explanatory text.
To open a live version of the content, click the launch Binder button above. This will open a JupyterLab environment in your web browser where you can interactively run and modify the tutorial notebooks without needing to install anything on your local machine. You can also launch individual tutorials on Binder by clicking on the rocket icon that appears in the upper-left corner of each tutorial. To download a local copy of the .ipynb or converted .py files, you can use the download icon in the upper-left corner of each tutorial.
If you are unfamiliar with Python or are not sure whether Python and the necessary modules are installed on your system, see our python introduction and installation instructions.
Note
There is a useful collection of PythTB sample programs
that were developed in connection with David Vanderbilt’s book Berry Phases in Electronic Structure Theory(Cambridge University Press, 2018).
v2.0 Upgrade Notice
For tips on upgrading to v2.0, see the release notes. For a full list of changes, see the changelog. Explore the new features with the New to v2.0 tutorials.
New to v2.0
- The
Latticeclass - The
Meshclass tb_modeltoTBModelin v2.0wf_arraytoWFArrayin v2.0- Parameterized
TBModel Wannierwith the trivial Haldane model- Reduced Wannier functions with
Wannier - Quantum geometric tensor
- Bianco-Resta Local Chern marker
- Axion angle of the Fu-Kane-Mele pump
- Graphene neighbor-shell hoppings
- Visualizing 3D tight-binding models
Building the TBModel
Topology and quantum geometry
- Edge modes in a Finite SSH chain
- Three-site Thouless pump
- Graphene Dirac cone Berry phase
- Berry phase and curvature in the Haldane model
- Hybrid Wannier centers in the Haldane model
- Hybrid Wannier centers in the Kane-Mele model
- Fu-Kane–Mele 3D Topological Insulator
- Boron nitride ribbon polarization
- Hybrid Wannier functions in cubic slab
Wannier90 integration