Hi Aditya
MatrixForm
is not computable. Also avoid use of symbol names starting with an uppercase letter, WL built-in symbols use that convention. And using %
, especially in a function definition is asking for trouble.
m = WolframAlpha[
"matrix of the permutation (4 3 2)(1)", {{"PermutationMatrix", 1},
"ComputableData"}] // ReleaseHold
my[r_] := Block[{a, b}, a = m; b = a . r . a\[Transpose]]; (* Why do you need Block here? *)
my[{{1/2, 0, 0, -(1/2)}, {-(1/2), 1, 0, -(1/2)}, {-(1/2), 0, 1, -(1/2)}, {-(1/2), 0, 0, 1/2}}]
(* {{1/2, -(1/2), 0, 0}, {-(1/2), 1/2, 0, 0}, {-(1/2), -(1/2), 1, 0}, {-(1/2), -(1/2), 0, 1}} *)