>> From: Carl DeVore
We can easily compute the inverses, determinants, and even solve linear
systems, over finite fields by using the inert operators Inverse, Det, and
Linsolve in conjunction with mod. But how do you simply multiply two
matrices? The only way I can figure out is to perform this kludge of
operations in sequence:
1. multiply the matrices WITHOUT respect to the modulus;
2. convert to listlist form;
3. apply the modulus;
4. convert back to matrix form.
For example,
Mul:= (A,B,p) -> array(convert(evalm(A &* B), listlist) mod p);
The conversion of old-style matrices to listlist form seems like a
relatively expensive operation. If you list the code for
`convert/old_array_to_listlist` you'll see why. The conversion of rtables
to listlist form seems far more efficient, but the inert operators
Inverse, Det, etc., do not work with rtables.
Also, my Mul operator above leads to hideous looking expressions when
several matrices are multiplied together. I cannot express Mul as a
neutral binary operator because of the need for the third parameter, the
modulus.
Carl Devore
University of Delaware
|