widget-bzvisualizer: A Jupyter widget to visualize the 1st Brillouin zone and band paths

widget-bzvisualizer: A Jupyter widget to visualize the 1st Brillouin zone and band paths#

Source code: osscar-org/widget-bzvisualizer

Introduction: A Jupyter widget to plot the 1st Brillouin zone and band paths. It uses the Javascript package tools-seekpath developed by Materials Cloud.

1. Import the widget from the package#

from widget_bzvisualizer import BZVisualizer

2. Initialize the parameters for the widget#

  • cell: the cell vectors a, b, c

  • rel_coods: the coordinates of the atoms in unit vectors

  • atom_numbers: element numbers of the atoms

from widget_bzvisualizer import BZVisualizer

cell = [
    [5.0, 0.0, 0.0],
    [0.0, 5.0, 0.0],
    [0.0, 0.0, 5.0],
]
# atomic coordinates in terms of unit vectors
rel_coords = [[0.0, 0.0, 0.0]]
# element numbers of atoms
atom_numbers = [6]

bz = BZVisualizer(
    cell, rel_coords, atom_numbers,
    width="100%", height="400px",
    show_axes=True,
    show_bvectors=True,
    show_pathpoints=True,
    disable_interact_overlay=True,
)
display(bz)