def get_grid_symmetry(data): symmetry = data['symmetry'] mesh = data['mesh'] weights = data['weight'] qpoints = data['qpoint'] rotations = symmetry.get_pointgroup_operations() (ir_grid_points, weights_for_check, grid_address, grid_mapping_table) = get_ir_grid_points(mesh, rotations) np.testing.assert_array_equal(weights, weights_for_check) qpoints_for_check = grid_address[ir_grid_points] / mesh.astype('double') diff_q = qpoints - qpoints_for_check np.testing.assert_almost_equal(diff_q, np.rint(diff_q)) return ir_grid_points, grid_address, grid_mapping_table
def _get_ir_grid_points(self): if self._coarse_mesh_shifts is None: mesh_shifts = [False, False, False] else: mesh_shifts = self._coarse_mesh_shifts (coarse_grid_points, coarse_grid_weights, coarse_grid_address, _) = get_ir_grid_points(self._coarse_mesh, self._symmetry.get_pointgroup_operations(), mesh_shifts=mesh_shifts) grid_points = from_coarse_to_dense_grid_points( self._mesh, self._mesh_divisors, coarse_grid_points, coarse_grid_address, coarse_mesh_shifts=self._coarse_mesh_shifts) grid_weights = coarse_grid_weights assert grid_weights.sum() == np.prod(self._mesh // self._mesh_divisors) return grid_points, grid_weights