def as_group_action_matrices(F, space, list_of_group_elements, basis, info = 0): n = len(list_of_group_elements) d = len(space) A = [matrix(F, d, d) for i in range(n)] for i, g in enumerate(list_of_group_elements): if info: print("Matrix for group elt", g) for j, omega in enumerate(space): if info: print("coordinates of element " + str(j+1)+" out of " + str(len(space))) omega1 = omega.group_action(g) v1 = omega1.coordinates(basis = basis) A[i][:, j] = vector(v1) return A