np.matmul

np.matmul(x1, x2)[source]

Computes the matrix multiplication of two Galois field arrays.

References

Examples

In [1]: GF = galois.GF(31)

In [2]: x1 = GF.Random((3,4)); x1
Out[2]: 
GF([[28, 20, 16, 24],
    [14, 20, 17, 30],
    [ 3, 24,  0,  7]], order=31)

In [3]: x2 = GF.Random((4,5)); x2
Out[3]: 
GF([[27, 27, 10, 21, 22],
    [28, 12, 27,  5, 27],
    [ 7, 28, 28, 11, 15],
    [12,  2, 21, 29, 18]], order=31)

In [4]: np.matmul(x1, x2)
Out[4]: 
GF([[11,  4,  5, 10, 30],
    [22,  7, 19, 25,  0],
    [ 0, 11, 19, 14,  3]], order=31)

In [5]: x1 @ x2
Out[5]: 
GF([[11,  4,  5, 10, 30],
    [22,  7, 19, 25,  0],
    [ 0, 11, 19, 14,  3]], order=31)