wulfric.cell.get_lattice_points#

wulfric.cell.get_lattice_points(cell, range=(1, 1, 1), relative=False, flat=True)[source]#

Compute lattice points for the given cell.

Assumes that cell contains one lattice point.

Parameters:
cell(3, 3) array-like

Matrix of a cell, rows are interpreted as vectors.

range(3, ) list or tuple of int, default (1, 1, 1)

How many lattice points to return. All lattice points with relative coordinates r_1, r_2, r_3, that fulfil

  • -range[0] <= r_1 <= range[0]

  • -range[1] <= r_2 <= range[1]

  • -range[2] <= r_3 <= range[2]

relativebool, default False

Whether to return relative coordinates.

flatbool, default False
Returns:
lattice_points(N1, N2, N3, 3) or (N, 3) numpy.ndarray

N lattice points. Each element is a vector \(v = (v_x, v_y, v_z)\).

  • N = N1 * N2 * N3

  • N1 = 2 * range[0] + 1

  • N2 = 2 * range[1] + 1

  • N3 = 2 * range[2] + 1

The shape of the returned array is

  • (N, 3) if flat=True

  • (N1, N2, N3, 3) if flat=False