Take the 2-minute tour ×

How do I form a new matrix from a given one by picking out some of its columns, using MAGMA?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Suppose you have an $m\times n$ matrix $A=[A_{i,j}]$ defined in MAGMA. Am I correct in thinking that you want to define an $m\times l$ matrix $B=[B_{r,s}]$ in MAGMA such that the columns of $B$ are all copies of columns of $A$. This is easily done using loops. First define $B$ to be the zero matrix over your chosen ring $R$:


Then suppose you want the 1st column of $B$ to be equal to the $a$-th column of $A$? Then use the following loop:

for i in {1..m} do
end for;

Repeating this for all the columns of $B$ will give you your result.

share|improve this answer

Your Answer


