Macaulay2 » Documentation
Packages » CodingTheory > LinearCode > linearCode > ParityCheck > parityCheckToGenerator
next | previous | forward | backward | up | index | toc

parityCheckToGenerator -- generator matrix given a parity check matrix

Synopsis

Description

Given parity check matrix H of a code $C$, this function recovers a generator matrix G of $C$.

i1 : F = GF 2;
i2 : H = matrix apply({{1,1,1,0}},l->apply(l,entry->sub(entry,F)))

o2 = | 1 1 1 0 |

             1      4
o2 : Matrix F  <-- F
i3 : G = parityCheckToGenerator H

o3 = | 1 1 0 0 |
     | 1 0 1 0 |
     | 0 0 0 1 |

             3      4
o3 : Matrix F  <-- F
i4 : H*(transpose G)

o4 = 0

             1      3
o4 : Matrix F  <-- F
i5 : F = GF(8,Variable => a);
i6 : H = matrix{{1,0,0,0,1,1,0,0},{0,1,0,0,0,1,1,0},{0,0,1,0,1,0,1,a^2+1}}

o6 = | 1 0 0 0 1 1 0 0    |
     | 0 1 0 0 0 1 1 0    |
     | 0 0 1 0 1 0 1 a2+1 |

             3      8
o6 : Matrix F  <-- F
i7 : G = parityCheckToGenerator H

o7 = | 0 0 0    1 0 0 0 0 |
     | 1 0 1    0 1 0 0 0 |
     | 1 1 0    0 0 1 0 0 |
     | 0 1 1    0 0 0 1 0 |
     | 0 0 a2+1 0 0 0 0 1 |

             5      8
o7 : Matrix F  <-- F
i8 : H*(transpose G)

o8 = 0

             3      5
o8 : Matrix F  <-- F

Ways to use parityCheckToGenerator :

For the programmer

The object parityCheckToGenerator is a method function.