Dual code

In coding theory, the dual code of a linear code

C⊂𝔽qn

is the linear code defined by

C⊥={x∈𝔽qn∣⟨x,c⟩=0∀c∈C}

where

⟨x,c⟩=∑i=1nxici

is a scalar product. In linear algebra terms, the dual code is the annihilator of C with respect to the bilinear form ⟨⋅⟩. The dimension of C and its dual always add up to the length n:

dim⁡C+dim⁡C⊥=n.

A generator matrix for the dual code is the parity-check matrix for the original code and vice versa. The dual of the dual code is always the original code.

Self-dual codes

A self-dual code is one which is its own dual. This implies that n is even and dim C = n/2. If a self-dual code is such that each codeword's weight is a multiple of some constant c>1, then it is of one of the following four types:

Codes of types I, II, III, or IV exist only if the length n is a multiple of 2, 8, 4, or 2 respectively.

If a self-dual code has a generator matrix of the form G=[Ik|A], then the dual code C⊥ has generator matrix [−A¯T|Ik], where Ik is the (n/2)×(n/2) identity matrix and a¯=aq∈𝔽q.