#!/usr/bin/env python
# coding: utf-8

# (visualize-3d-nb)=
# # Visualizing 3D tight-binding models
# 
# This example demonstrates how to visualize a 3D tight-binding model using the `TBModel.visualize_3d` function. 
# 
# :::{note}
# 
# This feature requires the `plotly` library to be installed. 
# 
# You can install it via pip:
# 
# ```bash
# pip install plotly
# ```
# or via conda:
# 
# ```bash
# conda install plotly
# ```
# :::

# In[ ]:


from pythtb.models import fu_kane_mele

# Reference Model
t = 1  # spin-independent first-neighbor hop
soc = 1  # spin-dependent second-neighbor hop
dt = [2, 0, 0, 0]  # hopping modulation along (111) direction
fkm_model = fu_kane_mele(t, soc, dt=dt)

fig = fkm_model.visualize_3d(draw_hoppings=True)
fig

