device_builder.utils.band_structure

Helper functions for generating band structures.

Copyright © 2023-2025 HQS Quantum Simulations GmbH. All Rights Reserved.

def get_band_path( structure: device_builder.models.periodic_structure.PeriodicStructure, number_of_k_points: int = 20, custom_band_path_string: Optional[str] = None) -> tuple[numpy.ndarray, numpy.ndarray, dict[int, str]]:

Get band path parameters from lattice vectors and (optional) path.

Arguments:
  • structure (PeriodicStructure): Periodic structure to generate band path for.
  • number_of_k_points (int]): Number of k-points in path (guideline, no strictly enforced!).
  • custom_band_path_string (Optional[str]): String representing band path. Format must be high-symmetry point labels separated by "-", e.g., "X-GAMMA-W". Defaults to None, which implies that the path recommended by crystal tools is used.
Returns:

tuple[np.ndarray, np.ndarray, dict[int, str],]: np.ndarray: Array of k-points along the k-point path. np.ndarray: Unit interval parametrizing k-point path. dict[int, str]: Map from k-point index to high-symmetry point label.

def generate_band_structure_plot_svg( spectrum: numpy.ndarray, band_path_parameter: numpy.ndarray, high_symmetry_points_index_to_label: dict[int, str], chemical_potential: float, energy_window: Optional[tuple[float, float]] = None, figure_size: tuple[float, float] = (4.0, 3.0), file_label: str = 'band_structure') -> sk_builder.fileref.FileRef:

Generate SVG string representing band structure plot.

The band_path_parameter and high_symmetry_points_index_to_label are generate when using the get_band_path() function. The chemical_potential argument specifies an energy offset of all bands and the optional energy_window argument can be used to restrict the band structure plot to a given energy range.

Arguments:
  • spectrum (np.ndarray): Spectrum at k-point.
  • band_path_parameter (np.ndarray): Band path parameters.
  • high_symmetry_points_index_to_label (dict[int, str]): Map from (band-path) index to label for high-symmetry points along the k-point band path.
  • chemical_potential (float): Chemical potential.
  • energy_window (Optional[tuple[float, float]]): Energy window for band structure plot. None implies that all bands are shown. Defaults to None.
  • figure_size (tuple[float, float]): Plot size in inches. Defaults to (4.0, 3.0).
  • file_label (str): Human-readable label as prefix for the filename for the plot. Defaults "band_structure".
Returns:

FileRef: Reference to an SVG file with the band structure plot.