erlab.plotting.bz

Utilities for plotting Brillouin zones.

Functions

get_bz_edge(basis[, reciprocal, extend])

Calculate the edge of the first Brillouin zone (BZ) from lattice vectors.

plot_hex_bz([a, rotate, offset, reciprocal, ax])

Plot a 2D hexagonal BZ overlay on the specified axes.

erlab.plotting.bz.get_bz_edge(basis, reciprocal=True, extend=None)[source]

Calculate the edge of the first Brillouin zone (BZ) from lattice vectors.

Parameters:
  • basis (ndarray[Any, dtype[float64]]) – (N, N) numpy array where N = 2``or ``3 with each row containing the lattice vectors.

  • reciprocal (bool) – If False, the basis are given in real space lattice vectors.

  • extend (tuple[int, ...] | None) – Tuple of positive integers specifying the number of times to extend the BZ in each direction. If None, only the first BZ is returned (equivalent to (1,) * N).

Returns:

  • lines (array-like) – (M, 2, N) array that specifies the endpoints of the M lines that make up the BZ edge, where N = len(basis).

  • vertices (array-like) – Vertices of the BZ.

Return type:

tuple[ndarray[Any, dtype[float64]], ndarray[Any, dtype[float64]]]

erlab.plotting.bz.plot_hex_bz(a=3.54, rotate=0.0, offset=(0.0, 0.0), reciprocal=True, ax=None, **kwargs)[source]

Plot a 2D hexagonal BZ overlay on the specified axes.