def get_triplets_reciprocal_mesh_at_q(fixed_grid_number, mesh, rotations, is_time_reversal=True, is_return_map=False, is_return_rot_map=False): weights = np.zeros(np.prod(mesh), dtype='intc') third_q = np.zeros(np.prod(mesh), dtype='intc') mesh_points = np.zeros((np.prod(mesh), 3), dtype='intc') mapping = np.zeros(np.prod(mesh), dtype='intc') rot_mapping = np.zeros(np.prod(mesh), dtype='intc') spg.triplets_reciprocal_mesh_at_q(weights, mesh_points, third_q, mapping, rot_mapping, fixed_grid_number, np.intc(mesh).copy(), is_time_reversal * 1, np.intc(rotations).copy()) assert len(mapping[np.unique(mapping)]) == len(weights[np.nonzero(weights)]), \ "At grid %d, number of irreducible mapping: %d is not equal to the number of irreducible triplets%d"%\ (fixed_grid_number, len(mapping[np.unique(mapping)]), len(weights[np.nonzero(weights)])) if not is_return_map and not is_return_rot_map: return weights, third_q, mesh_points elif not is_return_rot_map: return weights, third_q,mesh_points, mapping else: return weights, third_q,mesh_points, mapping, rot_mapping
def get_triplets_reciprocal_mesh_at_q(fixed_grid_number, mesh, rotations, is_time_reversal=True, is_return_map=False, is_return_rot_map=False): weights = np.zeros(np.prod(mesh), dtype='intc') third_q = np.zeros(np.prod(mesh), dtype='intc') mesh_points = np.zeros((np.prod(mesh), 3), dtype='intc') mapping = np.zeros(np.prod(mesh), dtype='intc') rot_mapping = np.zeros(np.prod(mesh), dtype='intc') spg.triplets_reciprocal_mesh_at_q(weights, mesh_points, third_q, mapping, rot_mapping, fixed_grid_number, np.intc(mesh).copy(), is_time_reversal * 1, np.intc(rotations).copy()) assert len(mapping[np.unique(mapping)]) == len(weights[np.nonzero(weights)]), \ "At grid %d, number of irreducible mapping: %d is not equal to the number of irreducible triplets%d"%\ (fixed_grid_number, len(mapping[np.unique(mapping)]), len(weights[np.nonzero(weights)])) if not is_return_map and not is_return_rot_map: return weights, third_q, mesh_points elif not is_return_rot_map: return weights, third_q, mesh_points, mapping else: return weights, third_q, mesh_points, mapping, rot_mapping
def get_triplets_reciprocal_mesh_at_q(fixed_grid_number, mesh, rotations, is_time_reversal=True): map_triplets = np.zeros(np.prod(mesh), dtype='intc') map_q = np.zeros(np.prod(mesh), dtype='intc') mesh_points = np.zeros((np.prod(mesh), 3), dtype='intc') spg.triplets_reciprocal_mesh_at_q( map_triplets, map_q, mesh_points, fixed_grid_number, np.array(mesh, dtype='intc'), is_time_reversal * 1, np.array(rotations, dtype='intc', order='C')) return map_triplets, map_q, mesh_points
def get_triplets_reciprocal_mesh_at_q(fixed_grid_number, mesh, rotations, is_time_reversal=True): map_triplets = np.zeros(np.prod(mesh), dtype='intc') map_q = np.zeros(np.prod(mesh), dtype='intc') mesh_points = np.zeros((np.prod(mesh), 3), dtype='intc') spg.triplets_reciprocal_mesh_at_q( map_triplets, map_q, mesh_points, fixed_grid_number, np.array(mesh, dtype='intc'), is_time_reversal * 1, np.array(rotations, dtype='intc', order='C')) return map_triplets, map_q, mesh_points
def get_triplets_reciprocal_mesh_at_q( fixed_grid_number, mesh, lattice, rotations, is_time_reversal=True, symprec=1e-5 ): weights = np.zeros( np.prod( mesh ), dtype=int ) third_q = np.zeros( np.prod( mesh ), dtype=int ) mesh_points = np.zeros( ( np.prod( mesh ), 3 ), dtype=int ) spg.triplets_reciprocal_mesh_at_q( weights, mesh_points, third_q, fixed_grid_number, np.array( mesh, dtype=int ), is_time_reversal * 1, lattice.T.copy(), rotations.copy(), symprec ) return weights, third_q, mesh_points