lattpy.disptools

Tools for dispersion computation and plotting.

lattpy.disptools.bandpath_subplots(ticks, labels, xlabel='$k$', ylabel='$E(k)$', grid='both')[source]
lattpy.disptools.plot_dispersion(disp, labels, xlabel='$k$', ylabel='$E(k)$', grid='both', color=None, alpha=0.2, lw=1.0, scales=None, fill=False, ax=None, show=True)[source]
lattpy.disptools.disp_dos_subplots(ticks, labels, xlabel='$k$', ylabel='$E(k)$', doslabel='$n(E)$', wratio=(3, 1), grid='both')[source]
lattpy.disptools.plot_disp_dos(disp, dos_data, labels, xlabel='k', ylabel='E(k)', doslabel='n(E)', wratio=(3, 1), grid='both', color=None, fill=True, disp_alpha=0.2, dos_alpha=0.2, lw=1.0, scales=None, axs=None, show=True)[source]
lattpy.disptools.plot_bands(kgrid, bands, k_label='k', disp_label='E(k)', grid='both', contour_grid=False, bz=None, pi_ticks=True, ax=None, show=True)[source]
class lattpy.disptools.DispersionPath(dim=0)[source]

Bases: object

Defines a dispersion path between high symmetry (HS) points.

Examples

Define a path using the add-method or preset points. To get the actual points the ‘build’-method is called:

>>> path = DispersionPath(dim=3).add([0, 0, 0], 'Gamma').x(a=1.0).cycle()
>>> vectors = path.build(n_sect=1000)
Attributes
dimint
labelslist of str
pointslist of array_like
n_sectint
classmethod chain_path(a=1.0)[source]
classmethod square_path(a=1.0)[source]
classmethod cubic_path(a=1.0)[source]
property num_points

int: Number of HS points in the path

add(point, name='')[source]

Adds a new HS point to the path

This method returns the instance for easier path definitions.

Parameters
point: array_like

The coordinates of the HS point. If the dimension of the point is higher than the set dimension the point will be clipped.

name: str, optional

Optional name of the point. If not specified the number of the point is used.

Returns
self: DispersionPath
add_points(points, names=None)[source]

Adds multiple HS points to the path

Parameters
points: array_like

The coordinates of the HS points.

names: list of str, optional

Optional names of the points. If not specified the number of the point is used.

Returns
self: DispersionPath
cycle()[source]

Adds the first point of the path.

This method returns the instance for easier path definitions.

Returns
self: DispersionPath
gamma()[source]

DispersionPath: Adds the .math:’Gamma=(0, 0, 0)’ point to the path

x(a=1.0)[source]

DispersionPath: Adds the .math:’X=(pi, 0, 0)’ point to the path

m(a=1.0)[source]

DispersionPath: Adds the ,math:’M=(pi, pi, 0)’ point to the path

r(a=1.0)[source]

DispersionPath: Adds the .math:’R=(pi, pi, pi)’ point to the path

build(n_sect=1000)[source]

Builds the vectors defining the path between the set HS points.

Parameters
n_sect: int, optional

Number of points between each pair of HS points.

Returns
path: (N, D) np.ndarray
get_ticks()[source]

Get the positions of the points of the last buildt path.

Mainly used for setting ticks in plot.

Returns
ticks: (N) np.ndarray
labels: (N) list
edges()[source]

Constructs the edges of the path.

distances()[source]

Computes the distances between the edges of the path.

scales()[source]

Computes the scales of the the edges of the path.

draw(ax, color=None, lw=1.0, **kwargs)[source]
subplots(xlabel='k', ylabel='E(k)', grid='both')[source]

Creates an empty matplotlib plot with configured axes for the path.

Parameters
xlabel: str, optional
ylabel: str, optional
grid: str, optional
Returns
fig: plt.Figure
ax: plt.Axis
plot_dispersion(disp, ax=None, show=True, **kwargs)[source]
plot_disp_dos(disp, dos, axs=None, show=True, **kwargs)[source]