pythtb.Lattice.visualize_3d#

Lattice.visualize_3d(n_cells=1, site_colors=None, site_names=None, show_lattice_info=True)[source]#

Visualize a 3D tight-binding model using Plotly.

This function creates an interactive 3D plot of your tight-binding model, showing the unit-cell origin, lattice vectors (with arrowheads), orbitals, hopping lines, and (optionally) an eigenstate overlay with marker sizes proportional to amplitude and colors reflecting the phase.

Parameters:
n_cells: int, optional

Number of unit cells to display along each lattice vector. Default is 1.

site_colors: list of str, optional

List of colors for each orbital site (e.g. ["red", "blue", "green"]). Must abide by Plotly color specifications. If not provided, default colors will be used.

site_names: list of str, optional

List of names for each orbital site (e.g. ["A", "B", "C"]). If provided, these names will be displayed next to the corresponding orbitals.

show_lattice_info: bool, optional

Whether to display lattice information (lattice vectors, orbital positions).

Returns:
plotly.graph_objs.Figure