# Orthogonalize method, keeping to binary vectors

The built in function:

Orthogonalize[m]

where m is a list of vectors returns a orthogonal basis for m. However, I want to stick to the binary field. However, I tried this:

Orthogonalize[m,Mod[#1.#2,2]&]

But this just still gives a set of vectors with negative coordinates.

Thanks.

-
Can you give an example of a set of vectors where your proposal fails, and what the answer ought to be? –  Ｊ. Ｍ. Aug 14 '12 at 5:29
Will vectors that are self-orthogonal be problrmatic for your purposes? if not, could just do Gram-Schmidt without the normalization part. –  Daniel Lichtblau Aug 14 '12 at 15:33

Define the inner product modulo $2$:

orthogonalize[a_] := Mod[Orthogonalize[a, Mod[#1.#2, 2] &], 2]


Example:

(m = Union[orthogonalize[RandomInteger[{0, 1}, {500, 64}]] ]) // ArrayPlot


Check orthogonality:

Mod[m . Transpose[m], 2] // ArrayPlot


-