np.linalg.inv

np.linalg.inv(A)[source]

Computes the inverse of the matrix.

References

Examples

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

In [2]: A = GF.Random((3,3)); A
Out[2]: 
GF([[15, 14, 30],
    [13, 30, 30],
    [ 0, 22, 24]], order=31)

In [3]: A_inv = np.linalg.inv(A); A_inv
Out[3]: 
GF([[11, 16,  5],
    [11,  4, 20],
    [ 8, 17, 14]], order=31)

In [4]: A_inv @ A
Out[4]: 
GF([[1, 0, 0],
    [0, 1, 0],
    [0, 0, 1]], order=31)