Lattices (erlab.lattice)¶
Tools related to the real and reciprocal lattice.
Functions
|
Return the angle between two vectors. |
|
Construct lattice vectors from lattice parameters. |
|
Determine lattice parameters from lattice vectors. |
|
Construct the reciprocal lattice vectors from real lattice vectors. |
|
Construct the real lattice vectors from reciprocal lattice vectors. |
- erlab.lattice.abc2avec(a, b, c, alpha, beta, gamma)[source]¶
Construct lattice vectors from lattice parameters.
- Parameters:
- Returns:
avec– Real lattice vectors, given as a 3 by 3 numpy array with each basis vector given in each row.- Return type:
- erlab.lattice.angle_between(v1, v2)[source]¶
Return the angle between two vectors.
- Parameters:
v1 (
array-like) – 1D array of length 3, specifying a vector.v2 (
array-like) – 1D array of length 3, specifying a vector.
- Returns:
float– The angle in degrees.- Return type:
- erlab.lattice.get_2d_vertices(basis, *, reciprocal=True, rotate=0.0, offset=(0.0, 0.0))[source]¶
Get the vertices of a 2D Brillouin zone.
Unlike
get_bz_edge(), this function only returns the vertices of the BZ. The vertices are ordered such that they can be used to create a polygon. Also, this function allows for rotation and offset of the BZ.- 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:True) – IfTrue, thebasisare treated as reciprocal lattice vectors. IfFalse, thebasisare treated as real space 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).
- Returns:
vertices (
array-like) – Vertices of the BZ.- Return type:
- erlab.lattice.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 = 2or3with 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.lattice.to_real(bvec)[source]¶
Construct the real lattice vectors from reciprocal lattice vectors.