Visualizing tight-binding models#

from pythtb import TBModel, Lattice
import numpy as np
import matplotlib.pyplot as plt

Graphene model#

lat = [[1, 0], [1 / 2, np.sqrt(3) / 2]]
orb = [[1 / 3, 1 / 3], [2 / 3, 2 / 3]]
lattice = Lattice(lat, orb, periodic_dirs=[0, 1])

# make two dimensional tight-binding graphene model
my_model = TBModel(lattice)

# set model parameters
delta = 0
t = -1

# set on-site energies
my_model.set_onsite([-delta, delta])
# set hoppings (one for each connected pair of orbitals)
# (amplitude, i, j, [lattice vector to cell containing j])
my_model.set_hop(t, 0, 1, [0, 0])
my_model.set_hop(t, 1, 0, [1, 0])
my_model.set_hop(t, 1, 0, [0, 1])

TBModel.visualize()#

Periodic in both directions#

fig, ax = my_model.visualize()
ax.set_title("Graphene, bulk")
ax.set_xlabel("x coordinate")
ax.set_ylabel("y coordinate")
plt.show()
../_images/d45b855ab920daf502cdf1ef6b3c613c3b52f48cee660faa2dbf4a2ea99826bc.png

Finite along direction 0#

cut_one = my_model.cut_piece(8, 0, glue_edges=False)

fig, ax = cut_one.visualize()
ax.set_title("Graphene, ribbon")
ax.set_xlabel("x coordinate")
ax.set_ylabel("y coordinate")
plt.show()
../_images/293574853cfb0909570e3c3141a7ef90142e96931b17cf574dd51e8b7e5f6bb0.png

Finite in both directions#

cut_two = cut_one.cut_piece(8, 1, glue_edges=False)

fig, ax = cut_two.visualize()
ax.set_title("Graphene, finite")
ax.set_xlabel("x coordinate")
ax.set_ylabel("y coordinate")
plt.show()
../_images/174b111bd724b60863f44974c612b96ce9629acd53bcf68ba155bea5e7f2df35.png

Finite flake with periodic boundary conditions along direction 1#

cut_two = cut_one.cut_piece(8, 1, glue_edges=True)

fig, ax = cut_two.visualize()
ax.set_title("Graphene, finite")
ax.set_xlabel("x coordinate")
ax.set_ylabel("y coordinate")
plt.show()
../_images/6955ffabf1343b55fe10bec30c04afdd136f9bcc6f5f2ec3c186d12085da3186.png