Fermi Surface
Generate and visualize Fermi surfaces from BXSF files. The Fermi surface mesh is generated in the frontend (JavaScript marching cubes); Python prepares the volumetric data and optional Brillouin-zone mesh via seekpath.
Requires the optional fermi-surface dependencies (includes seekpath):
pip install "weas-widget[fermi-surface]"
Here’s an example of how to use the add_fermi_surface_from_bxsf method:
[1]:
from weas_widget import WeasWidget
viewer = WeasWidget()
viewer.add_fermi_surface_from_bxsf(file_path="../../examples/copper.bxsf",
clip_bz=True,
brillouin_zone_options={"opacity": 0.1,
"color": "#34ebd8"})
viewer
/home/docs/checkouts/readthedocs.org/user_builds/weas-widget/envs/latest/lib/python3.11/site-packages/seekpath/brillouinzone/brillouinzone.py:26: UserWarning: `get_BZ` is deprecated, use the `BZ` class instead, to represent a brillouine zone. The faces and triangles can be accesses as attributes.
warnings.warn(
[1]:
Parameters summary for add_fermi_surface_from_bxsf:
file_path: Path to the.bxsffile.fermi_energy: Override the Fermi energy (default: use value in file).drop_periodic: Drop the duplicated periodic end points (default:True).clip_bz: Clip to the first Brillouin zone (default:True, requiresseekpath).show_bz: Add the Brillouin zone mesh (default:True).show_reciprocal_axes: Add reciprocal axes vectors (default:True).band_index: Render a single band by index (default:None).combine_bands: Merge all Fermi-crossing bands into one mesh (default:False).name: Mesh name override.color: RGB list for the mesh color or hex color string.opacity: Alpha channel applied to the mesh.material_type: Material type for the mesh (default:"Standard").brillouin_zone_options: Extra keyword arguments forwarded toadd_brillouin_zone(e.g., custom color/opacity).reciprocal_axes_options: Extra keyword arguments forwarded toadd_reciprocal_axes.
Notes:
The Fermi surface mesh is generated in the frontend (JavaScript marching cubes).
If
band_indexisNone, all Fermi-crossing bands are used.If
combine_bands=False, each band is added as a separate mesh.A
ValueErroris raised when no Fermi-crossing bands are found.
You can customize the reciprocal axes and Brillouin-zone overlays when rendering a Fermi surface. For example, change the color and opacity of the Brillouin zone, and show the reciprocal axes with custom color and radius:
viewer.add_fermi_surface_from_bxsf(
"copper.bxsf",
clip_bz=True,
show_bz=True,
show_reciprocal_axes=True,
brillouin_zone_options={"opacity": 0.1,
"color": "#34ebd8",
"show_edges": True},
reciprocal_axes_options={"color": "#ff5733",
"radius": 0.05},
)