SyndromeTable( C )
SyndromeTable
returns a syndrome table of a linear code C,
consisting of two columns. The first column consists of the error vectors
that correspond to the syndrome vectors in the second column. These
vectors both are of the codeword type. After calculating the syndrome of
a word c with Syndrome
(see Syndrome), the error vector needed to
correct c can be found in the syndrome table. Subtracting this vector
from c yields an element of C. To make the search for the syndrome as
fast as possible, the syndrome table is sorted according to the syndrome
vectors.
gap> H := HammingCode(2); a linear [3,1,3]1 Hamming (2,2) code over GF(2) gap> SyndromeTable(H); [ [ [ 0 0 0 ], [ 0 0 ] ], [ [ 1 0 0 ], [ 0 1 ] ], [ [ 0 1 0 ], [ 1 0 ] ], [ [ 0 0 1 ], [ 1 1 ] ] ] gap> c := Codeword("101"); [ 1 0 1 ] gap> c in H; false # c is not an element of H gap> Syndrome(H,c); [ 1 0 ] # according to the syndrome table, # the error vector [ 0 1 0 ] belongs to this syndrome gap> c - Codeword("010") in H; true # so the corrected codeword is # [ 1 0 1 ] - [ 0 1 0 ] = [ 1 1 1 ], # this is an element of H
GAP 3.4.4