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
- 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
- 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