def get_ir_grid_points(mesh, rotations, mesh_shifts=[False, False, False]): grid_mapping_table, grid_address = spg.get_stabilized_reciprocal_mesh( mesh, rotations, is_shift=np.where(mesh_shifts, 1, 0)) (ir_grid_points, ir_grid_weights) = extract_ir_grid_points(grid_mapping_table) return ir_grid_points, ir_grid_weights, grid_address
def get_ir_grid_points(bz_grid: BZGrid): """Return ir-grid-points in generalized regular grid. bz_grid : BZGrid Data structure to represent BZ grid. Returns ------- ir_grid_points : ndarray Irreducible grid point indices in GR-grid. shape=(num_ir_grid_points, ), dtype='int_' ir_grid_weights : ndarray Weights of irreducible grid points. Its sum is the number of grid points in GR-grid (prod(D_diag)). shape=(num_ir_grid_points, ), dtype='int_' ir_grid_map : ndarray Index mapping table to irreducible grid points from all grid points such as, [0, 0, 2, 3, 3, ...]. shape=(prod(D_diag), ), dtype='int_' """ ir_grid_map = _get_ir_grid_map(bz_grid.D_diag, bz_grid.rotations, PS=bz_grid.PS) (ir_grid_points, ir_grid_weights) = extract_ir_grid_points(ir_grid_map) return ir_grid_points, ir_grid_weights, ir_grid_map
def get_ir_grid_points(mesh, rotations, mesh_shifts=None): if mesh_shifts is None: mesh_shifts = [False, False, False] grid_mapping_table, grid_address = spglib.get_stabilized_reciprocal_mesh( mesh, rotations, is_shift=np.where(mesh_shifts, 1, 0), is_dense=True) (ir_grid_points, ir_grid_weights) = extract_ir_grid_points(grid_mapping_table) return ir_grid_points, ir_grid_weights, grid_address, grid_mapping_table
def _prepare(self): (self._ir_grid_points, ir_grid_weights) = extract_ir_grid_points(self._grid_mapping_table) ir_gp_indices = {} for i, gp in enumerate(self._ir_grid_points): ir_gp_indices[gp] = i self._gp_ir_index = np.zeros_like(self._grid_mapping_table) for i, gp in enumerate(self._grid_mapping_table): self._gp_ir_index[i] = ir_gp_indices[gp]