# How can the Hamming (7,4) code be self dual?

While reading about the Hamming (7,4) code, I saw that it was self dual. After looking up the definition, the dual code has a generator matrix equal to $H^T$, where $H$ is the parity check matrix of the original code.

But these two matrices are of different dimension! How can they be equal to each other?

Also, using the definitions for $G$ and $H$ from the wiki article, they are quite different (after transposing). I'm guessing that there is a large amount of non-uniqueness in these matrices, perhaps even when it comes to their dimensions. What would be the cleanest way to check that it is self-dual?

• Where did you see it was self-dual. It is not.
– quid
Commented Jul 6, 2016 at 20:19
• en.wikipedia.org/wiki/Steane_code - "...using the classical binary self-dual [7,4,3] Hamming code..." Commented Jul 6, 2016 at 20:20
• I think that's just not true then.
– quid
Commented Jul 6, 2016 at 20:23
• How to see that it isn't self dual then? What's the smartest way to approach this sort of problem? I mean other than calculating all the codewords for both codes. Commented Jul 6, 2016 at 20:24
• Is it possible that your source was confusing this with the extended $(8,4,4)$ Hamming code? That code is self-dual. The dual of the $(7,4,3)$ Hamming code is a $(7,3,4)$ code $C$ gotten by shortening the extended Hamming code at some position. The code $C$ is self-orthogonal, in other words it is a subcode of its dual code. As quid pointed out (+1), a self-dual code necessarily has even length. Commented Jul 6, 2016 at 20:34

Yet, the length of the code is $7$.
• So a self dual code would always be of the form $(2n,n)$, is that correct? Commented Jul 6, 2016 at 20:30