Communications Toolbox    

Linear Algebra in Galois Fields

You can do linear algebra in a Galois field using Galois arrays. Important categories of computations are inverting matrices, computing determinants, computing ranks, factoring square matrices, and solving linear equations.

Inverting Matrices and Computing Determinants

To invert a square Galois array, use the inv function. Related is the det function, which computes the determinant of a Galois array. Both inv and det behave like their ordinary MATLAB counterparts, except that they perform computations in the Galois field instead of in the field of complex numbers.

The code below illustrates matrix inversion and determinant computation.

The output from this example is either of these two messages, depending on whether the randomly generated matrix is nonsingular or singular.

Computing Ranks

To compute the rank of a Galois array, use the rank function. It behaves like the ordinary MATLAB rank function when given exactly one input argument. The example below illustrates how to find the rank of square and nonsquare Galois arrays.

The values of r1 and r2 indicate that asquare has less than full rank but that anonsquare has full rank.

Factoring Square Matrices

To express a square Galois array (or a permutation of it) as the product of a lower triangular Galois array and an upper triangular Galois array, use the lu function. This function accepts one input argument and produces exactly two or three output arguments. It behaves like the ordinary MATLAB lu function when given the same syntax. The example below illustrates how to factor using lu.

Solving Linear Equations

To find a particular solution of a linear equation in a Galois field, use the \ or / operator on Galois arrays. The table below indicates the equation that each operator addresses, assuming that A and B are previously defined Galois arrays.


Backslash Operator (\)
Slash Operator (/)
Linear Equation
A * x = B
x * A = B
Syntax
x = A \ B
x = B / A
Equivalent Syntax Using \
Not applicable
x = (A' \ B')'

The results of the syntax in the table depend on characteristics of the Galois array A:

Example: Solving Linear Equations.   The examples below illustrate how to find particular solutions of linear equations over a Galois field.

The output from this example indicates that the validity checks are all true (1), except for ck5, which is false (0).


  Matrix Manipulation in Galois Fields Signal Processing Operations in Galois Fields