q-points
- dynasor.qpoints.get_spherical_qpoints(cell, q_max, max_points=None, seed=42)[source]
Generates all q-points on 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 anNx3
array.If the number of generated q-points are large, points can be removed by specifying the
max_points
. The q-points will be randomly removed in such a way that the q-points inside are roughly uniformly distributed with respect to \(|q|\). If the number of q-points are binned w.r.t. their norm the function would increase quadratically up until some distance P from which point the distribution would be constant.- Parameters
cell (
ndarray
[Any
,dtype
[float
]]) – real cell with cell vectors as rowsq_max (
float
) – maximum norm of generated q-pointsmax_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 frommax_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 labelscoordinates (
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 inpath
primitive_cell (
ndarray
[Any
,dtype
[float
]]) – cell metric of the primitive cell with lattice vectors as rowssuper_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)