Exemplo n.º 1
0
def get_irrep_matrices(path, io):

    DG_std = path.distortion_group.std_matrices

    io.print("\n\nIrrep. #" + str(io.irr_num) + " chosen...")

    if io.irr_num != 0:
        irrep_tools = IrrepTools()
        irrep = irrep_tools.get_irrep(group_data=DG_std,
                                      stokes_number=io.irr_num,
                                      dimension=io.irr_dim,
                                      k_params=(None, None, None))

    else:
        raise ValueError("No irrep chosen.")

    io.print("\n\n")

    io.print("------- Irrep. Matrices:\n")

    for j in range(0, len(irrep)):
        irrep_matrix = irrep.irrep_matrices[j].matrix
        io.print("Symmetry Element " + str(j + 1) + " : \n" +
                 str(irrep_matrix) + "\n")

    return irrep
Exemplo n.º 2
0
def get_irrep_matrices(path, io):

    DG_std = path.distortion_group.std_matrices

    if io.irr_num != 0:
        irrep_tools = IrrepTools()
        irrep = irrep_tools.get_irrep(group_data=DG_std,
                                      stokes_number=io.irr_num,
                                      dimension=io.irr_dim,
                                      k_params=(None, None, None))

    else:
        raise ValueError("No irrep chosen.")

    return irrep
Exemplo n.º 3
0
    def test_get_irrep(self):
        stokes_number = 2857
        dimension = 1

        matrices = [[[1.0, 0.0, 0.0],
                     [0.0, 1.0, 0.0],
                     [0.0, 0.0, 1.0]],
                    [[-1.0, 0.0, 0.0],
                     [0.0, -1.0, 0.0],
                     [0.0, 0.0, 1.0]],
                    [[-1.0, 0.0, 0.0],
                     [0.0, 1.0, 0.0],
                     [0.0, 0.0, 1.0]],
                    [[1.0, 0.0, 0.0],
                     [0.0, -1.0, 0.0],
                     [0.0, 0.0, 1.0]],
                    [[1.0, 0.0, 0.0],
                     [0.0, 1.0, 0.0],
                     [0.0, 0.0, 1.0]],
                    [[-1.0, 0.0, 0.0],
                     [0.0, -1.0, 0.0],
                     [0.0, 0.0, 1.0]],
                    [[-1.0, 0.0, 0.0],
                     [0.0, 1.0, 0.0],
                     [0.0, 0.0, 1.0]],
                    [[1.0, 0.0, 0.0],
                     [0.0, -1.0, 0.0],
                     [0.0, 0.0, 1.0]],
                    [[-1.0, 0.0, 0.0],
                     [0.0, -1.0, 0.0],
                     [0.0, 0.0, -1.0]],
                    [[1.0, 0.0, 0.0],
                     [0.0, 1.0, 0.0],
                     [0.0, 0.0, -1.0]],
                    [[1.0, 0.0, 0.0],
                     [0.0, -1.0, 0.0],
                     [0.0, 0.0, -1.0]],
                    [[-1.0, 0.0, 0.0],
                     [0.0, 1.0, 0.0],
                     [0.0, 0.0, -1.0]],
                    [[-1.0, 0.0, 0.0],
                     [0.0, -1.0, 0.0],
                     [0.0, 0.0, -1.0]],
                    [[1.0, 0.0, 0.0],
                     [0.0, 1.0, 0.0],
                     [0.0, 0.0, -1.0]],
                    [[1.0, 0.0, 0.0],
                     [0.0, -1.0, 0.0],
                     [0.0, 0.0, -1.0]],
                    [[-1.0, 0.0, 0.0],
                     [0.0, 1.0, 0.0],
                     [0.0, 0.0, -1.0]]]

        vectors = [[0.0, 0.0, 0.0],
                    [1.0, 0.0, 0.5],
                    [1.0, 0.0, 0.0],
                    [0.0, 0.0, 0.5],
                    [0.5, -0.5, 0.0],
                    [1.4999999959999997, -0.4999999999999998, 0.5],
                    [1.4999999959999997, -0.5, 0.0],
                    [0.5, -0.4999999999999998, 0.5],
                    [1.0, 0.0, 0.0],
                    [0.0, 0.0, 0.4999868850768938],
                    [0.0, 0.0, 0.0],
                    [1.0, 0.0, 0.4999868850768938],
                    [1.4999998980000022, -0.5, 0.0],
                    [0.5, -0.5, 0.4999868850768938],
                    [0.5, -0.5, 0.0],
                    [1.4999998980000022, -0.5, 0.4999868850768938]]

        group_data = []
        for entry in range(len(matrices)):
            group_data.append(SymmOp.from_rotation_and_translation(rotation_matrix=matrices[entry],
                                                                      translation_vec=vectors[entry]))

        ir_mat_data = [[[1]], [[-1]], [[-1]], [[1]], [[-1]], [[1]], [[1]], [[-1]],
                       [[1]], [[-1]], [[-1]], [[1]], [[-1]], [[1]], [[1]], [[-1]]]

        irr = IrrepTools()
        irrep = irr.get_irrep(group_data=group_data, stokes_number=stokes_number,
                              dimension=dimension, k_params=(None, None, None))

        irmats = irrep.irrep_matrices
        for op_num in range(len(irmats)):
            self.assertEqual(irmats[op_num].matrix, ir_mat_data[op_num])

        self.assertEqual(irrep.label, 'Y4+')