q-points

dynasor.qpoints.get_spherical_qpoints(cell, q_max, max_points=None, seed=42)[source]

Generates all q-points in the first octant of the reciprocal lattice inside a given radius q_max. This approach is suitable if an isotropic sampling of q-space is desired. The function returns the resulting q-points in Cartesian coordinates as an Nx3 array.

If the number of q-points generated exceeds max_points, points will be randomly pruned. If the number of generated q-points exceeds max_points, q-points will be randomly removed in such a way that the q-points inside are roughly uniformly distributed with respect to \(|q|\).

Parameters
  • cell (ndarray[Any, dtype[float]]) – real cell with cell vectors as rows

  • q_max (float) – maximum norm of generated q-points

  • max_points (Optional[int]) – Optionally limit the set to approximately max_points points by randomly removing points from a “fully populated mesh”. The points are removed in such a way that for \(q > q_\mathrm{prune}\), the points will be radially uniformly distributed. The value of \(q_\mathrm{prune}\) is calculated from max_q, max_points, and the shape of the cell.

  • seed (int) – Seed used for stochastic pruning

Return type

ndarray[Any, dtype[float]]

dynasor.qpoints.get_supercell_qpoints_along_path(path, coordinates, primitive_cell, super_cell)[source]

Returns the q-points commensurate with the given supercell along the specific path.

Parameters
  • path (List[Tuple[str, str]]) – list of pairs of q-point labels

  • coordinates (Dict[str, ndarray[Any, dtype[float]]]) – dict with q-point labels and coordinates as keys and values, respectively; there must be one entry for each q-point label used in path

  • primitive_cell (ndarray[Any, dtype[float]]) – cell metric of the primitive cell with lattice vectors as rows

  • super_cell (ndarray[Any, dtype[float]]) – cell metric of the supercell with lattice vectors as rows

Returns

A list of the accessible q-point coordinates along the specified segment

Return type

supercell_paths

Example

The following example illustrates how to retrieve the q-points that can be sampled using a supercell comprising \(6 \times 6 \times 6\) conventional (4-atom) unit cells of FCC Al along the path X-\(\Gamma\)-L.

>>> import numpy as np
>>> from ase.build import bulk
>>> from dynasor.qpoints import get_supercell_qpoints_along_path
>>> prim = bulk('Al', 'fcc', a=4.0)
>>> supercell = bulk('Al', 'fcc', a=4.0, cubic=True).repeat(6)
>>> path = [('X', 'G'), ('G', 'L'), ('L', 'W')]
>>> coordinates = dict(X=[0.5, 0.5, 0], G=[0, 0, 0],
...                    L=[0.5, 0.5, 0.5], W=[0.5, 0.25, 0.75])
>>> qpoints = get_supercell_qpoints_along_path(path, coordinates, prim.cell, supercell.cell)