radtools.Lattice#

class radtools.Lattice(*args)[source]#

General 3D lattice.

In absence of the atoms (which is always the case for the lattice) and additional lattice points. Every cell is primitive, since lattice points are constructed form the translations. Therefore, general Lattice class does not dos not distinguishes between primitive and conventional lattice as in the Bravais Lattice. Therefore only cell attribute is present and it is always interpreted as the primitive unit cell. In the case of the Bravais lattice additional attribute conv_cell appears.

Lattice can be created in a three alternative ways:

>>> import radtools as rad
>>> l = rad.Lattice([[1, 0, 0], [0, 1, 0], [0, 0, 1]])
>>> l = rad.Lattice([1,0,0], [0,1,0], [0,0,1])
>>> l = rad.Lattice(1, 1, 1, 90, 90, 90)
Parameters:
cell(3, 3) array-like

Unit cell, rows are vectors, columns are coordinates.

a1(3,) array-like

First vector of unit cell (cell[0]).

a2(3,) array-like

SEcond vector of unit cell (cell[1]).

a3(3,) array-like

Third vector of unit cell (cell[2]).

afloat, default=1

Length of the \(a_1\) vector.

bfloat, default=1

Length of the \(a_2\) vector.

cfloat, default=1

Length of the \(a_3\) vector.

alphafloat, default=90

Angle between vectors \(a_2\) and \(a_3\). In degrees.

betafloat, default=90

Angle between vectors \(a_1\) and \(a_3\). In degrees.

gammafloat, default=90

Angle between vectors \(a_1\) and \(a_2\). In degrees.

Attributes:
kpointsdist

Dictionary of the high symmetry points. Coordinates are given in relative coordinates.

kpoints = {"Name" : [k_x, k_y, k_z], ...}

Methods:

add_kpoint(name, coordinates[, plot_name])

Add named kpoint to the lattice.

clear()

Clear the axis.

get_kpoints([n])

Getter for the instance of Kpoints.

identify()

Identify the Bravais lattice type.

lattice_points([relative, reciprocal, normalize])

Compute lattice points

legend(**kwargs)

Add legend to the figure.

plot([kind, ax])

Main plotting function of the Lattice.

plot_brillouin([ax, vectors, colour, label, ...])

Plot brillouin zone.

plot_brillouin_kpath([zone_colour, path_colour])

Plot brillouin zone and kpath.

plot_conventional(**kwargs)

Plot conventional unit cell.

plot_kpath([ax, colour, label, normalize])

Plot k path in the reciprocal space.

plot_primitive(**kwargs)

Plot primitive unit cell.

plot_real_space([ax, vectors, colour, ...])

Plot real space unit cell.

plot_wigner_seitz([ax, vectors, colour, ...])

Plot Wigner-Seitz unit cell.

prepare_figure([background, focal_length])

Prepare style of the figure for the plot.

remove([kind, ax])

Remove a set of artists from the plot.

savefig([output_name, elev, azim])

Save the figure in the file

show([elev, azim])

Show the figure in the interactive matplotlib window.

voronoi_cell([reciprocal, normalize])

Computes Voronoy edges around (0,0,0) point.

Properties:

a

Length of the first lattice vector \(\vert\vec{a}_1\vert\).

a1

First lattice vector \(\vec{a}_1\).

a2

Second lattice vector \(\vec{a}_2\).

a3

Third lattice vector \(\vec{a}_3\).

alpha

Angle between second and third lattice vector.

b

Length of the second lattice vector \(\vert\vec{a}_2\vert\).

b1

First reciprocal lattice vector.

b2

Second reciprocal lattice vector.

b3

Third reciprocal lattice vector.

beta

Angle between first and third lattice vector.

c

Length of the third lattice vector \(\vert\vec{a}_3\vert\).

cell

Unit cell of the lattice.

centring_type

Centring type.

crystal_family

Crystal family.

gamma

Angle between first and second lattice vector.

k_a

Length of the first reciprocal lattice vector \(\vert\vec{b}_1\vert\).

k_alpha

Angle between second and third reciprocal lattice vector.

k_b

Length of the second reciprocal lattice vector \(\vert\vec{b}_2\vert\).

k_beta

Angle between first and third reciprocal lattice vector.

k_c

Length of the third reciprocal lattice vector \(\vert\vec{b}_3\vert\).

k_gamma

Angle between first and second reciprocal lattice vector.

parameters

Return cell parameters.

path

K-point path.

pearson_symbol

Pearson symbol.

reciprocal_cell

Reciprocal cell.

reciprocal_cell_volume

Volume of the reciprocal cell.

unit_cell_volume

Volume of the unit cell.

variation

Variation of the lattice, if any.