# Given the permutation, permute the indices a function

How can we permute the indices of a function? Like in my case I have the permutation of three indices and I am using this code but it isn't working. I have to permute the indices of a. Thanks in advance

• I don't understand the question (the code shown doesn't really make sense). Is Permutations[a[1, 2, 3]] what you want? If not, please clarify by providing an example input and the corresponding desired output. – Szabolcs May 14 '18 at 10:27
• Yes, I denote 1,2,3 by i,j,k. I need to permute 1,2,3 in a[1,2,3] – Mahnoor May 14 '18 at 10:31

l = a[i, j, k];
permutations = Permutations[Range[3]];
l[[permutations[[2]]]]


a[i, k, j]