So let's assume I am working with $n$-dimensional functions. In Magma I have a code that goes like this:
n:=4;
function fun(x1,x2,x3,x4)
return (x1*x2+x3*x4) mod 2;
end function;
Now, if I want to increase $n$, I have to manually write all the variables from $x_1$ to $x_8$. Is there a more convenient way to do this, by saying that $x$ is in some Vector space $GF(2)^8$ or something similar, to avoid this manual writing.
You can do this several ways.
If $x$ is a vector in $V = {GF(2)}^{n}$, then you can define
and call through
but this is a pain if you want to use different vectors of different lengths. You might as well just have $x$ be a sequence of $GF(2)$ elements, so you can define
and call through
A third option is to use a variadic function, that can take varying number of inputs and stores them all as a list. Here you would define
This is nicest in terms of calling since these will all work: