changing the column order of a matrix using MAGMA (software)

214 Views Asked by At

I've just begun to use Magma (software). I have several questions.

I am trying to change the columns of a 9x18 matrix according to Random(Sym18). the Random gives me a permutation like p=(1,2,3)(6,9,12,11,7)(8,17)(15,13,4). and I want this permutation act on my matrix. How can I do this?

1

There are 1 best solutions below

1
On BEST ANSWER

I find the magma documentation to be thorough but hard to search. Google usually does a good job:

https://www.google.com/search?q=site%3Amagma.maths.usyd.edu.au+permutation+matrix

http://magma.maths.usyd.edu.au/magma/handbook/text/1705

If m is your matrix and p is your permutation, then m^p is the result of applying p to m. However, there is a catch. If m is an $r \times c$ matrix, then p restricted to $\{1,\ldots,r\}$ permutes the rows, and p restricted to $\{r+1,\ldots,r+c\}$ permutes the columns.

> m:=RandomMatrix(GF(2),9,18);
> symc:=Sym({NumberOfRows(m)+1..NumberOfRows(m)+NumberOfColumns(m)});
> p:=Random(symc);
> p,m,m^p;
(10, 18, 15, 24, 22, 14, 12, 25, 13, 20, 23, 19, 17, 27, 21, 26, 11, 16)

[1 0 0 0 0 1 1 0 1 1 0 0 1 1 0 0 0 1]
[1 0 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 0]
[0 0 1 0 0 0 1 0 0 1 0 1 0 1 1 1 1 1]
[1 1 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0]
[0 0 1 0 0 1 1 1 0 1 1 0 1 0 0 0 1 0]
[0 1 0 0 0 0 1 1 0 0 1 1 1 0 0 1 1 1]
[1 0 1 1 1 1 1 1 0 1 0 1 0 1 0 1 0 0]
[0 0 1 1 1 1 1 1 0 1 1 1 0 0 0 0 0 0]
[1 0 0 1 1 0 1 1 0 0 0 0 0 0 1 0 1 1]

[1 0 0 0 1 1 0 1 1 1 0 1 0 0 1 0 0 0]
[0 0 1 0 1 0 0 1 1 1 1 0 0 1 1 1 1 0]
[1 1 0 1 0 0 0 1 0 1 0 1 1 0 0 1 1 0]
[0 0 0 0 0 0 1 1 1 0 0 0 0 1 1 0 0 0]
[1 1 0 0 1 0 0 1 0 0 0 0 0 1 1 1 0 1]
[1 1 0 1 1 0 1 0 0 0 0 1 0 1 0 0 1 1]
[1 0 1 1 0 0 0 1 1 1 1 0 0 0 1 1 1 1]
[1 0 1 0 0 0 0 1 0 0 1 0 0 1 1 1 1 1]
[1 1 1 0 0 0 0 0 1 0 1 1 1 0 0 0 0 1]