erlab.plotting.bz¶
Utilities for plotting Brillouin zones.
Functions
|
Calculate the edge of the first Brillouin zone (BZ) from lattice vectors. |
|
Plot a Brillouin zone, given the basis vectors. |
|
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[tuple[int,...],dtype[floating]]) –(N, N)numpy array whereN = 2``or ``3with each row containing the lattice vectors.reciprocal (
bool, default:True) – IfFalse, thebasisare given in real space lattice vectors.extend (
tuple[int,...] |None, default:None) – Tuple of positive integers specifying the number of times to extend the BZ in each direction. IfNone, only the first BZ is returned (equivalent to(1,) * N).
- Returns:
lines (
array-like) –(M, 2, N)array that specifies the endpoints of theMlines that make up the BZ edge, whereN = len(basis).vertices (
array-like) – Vertices of the BZ.
- Return type:
tuple[ndarray[tuple[int, …], dtype[floating]], ndarray[tuple[int, …], dtype[floating]]]
- erlab.plotting.bz.plot_bz(basis, *, reciprocal=False, rotate=0.0, offset=(0.0, 0.0), ax=None, **kwargs)[source]¶
Plot a Brillouin zone, given the basis vectors.
- Parameters:
basis (
ndarray[tuple[int,...],dtype[floating]]) – A 2D or 3D numpy array with shape(N, N)whereN = 2or3, containing the basis vectors of the lattice. If N is 3, only the upper left 2x2 submatrix is used.reciprocal (
bool, default:False) – IfTrue, the basis vectors are interpreted as reciprocal lattice vectors.rotate (
float, default:0.0) – Rotation angle in degrees to apply to the BZ.offset (
tuple[float,float], default:(0.0, 0.0)) – Offset for the Brillouin zone center in the form of a tuple(x, y).ax (
Axes|None, default:None) – The axes to plot the BZ on. IfNone, the current axes are used.**kwargs – Additional keyword arguments passed to
matplotlib.patches.Polygon.
- erlab.plotting.bz.plot_hex_bz(a=3.54, *, reciprocal=False, rotate=0.0, offset=(0.0, 0.0), ax=None, **kwargs)[source]¶
Plot a 2D hexagonal BZ overlay on the specified axes.
- Parameters:
a (
float, default:3.54) – Lattice constant of the hexagonal lattice.reciprocal (
bool, default:False) – IfTrue,ais interpreted as the periodicity of the reciprocal lattice.rotate (
float, default:0.0) – Rotation angle in degrees to apply to the BZ.offset (
tuple[float,float], default:(0.0, 0.0)) – Offset for the Brillouin zone center in the form of a tuple(x, y).ax (
Axes|None, default:None) – The axes to plot the BZ on. IfNone, the current axes are used.**kwargs – Additional keyword arguments passed to
matplotlib.patches.RegularPolygon.