For example, binary codes from $[(-1, -1, -1, -1, -1, -1, -1, -1), \cdots , (+1, +1, +1, +1, +1, +1, +1, +1)]$, constraint is that the distance (inner product) between any pair of codes must be less than $2$. There should be many. Example: $$ (-1, -1, -1, -1, -1, -1, -1, -1) \\ (-1, -1, -1, -1, -1, -1, -1, +1) \\ (-1, -1, -1, -1, -1, -1, +1, +1) \\ (-1, -1, -1, -1, -1, +1, -1, +1) \\ (-1, -1, -1, -1, +1, -1, -1, -1) \\ \cdots $$
I am looking for something like code dimension can be large such as $256$ bits, and their distance can be within $16$. How many such codes are there ?
Refer to
"Codes on Euclidean Spheres", Front Cover, T. Ericson, V. Zinoviev
How many vectors can be "close to mutual orthogonal like 80 degrees" in a high dimensional space?
I'm fairly sure that for the choice of parameters: length $256$, max absolute value of a non-trivial inner product $16$, the answer is $4096$ achieved by the so called small Kasami code (I used to know such facts by heart, but I need to check what the bounds say about codes with these parameters).
Let's begin by abbreviating $K=\Bbb{F}_{2^4}$ and $L=\Bbb{F}_{2^8}$.
Let $$tr_8:L\to\Bbb{F}_2$$ and
$$tr_4:K\to\Bbb{F}_2$$
be the trace maps. I will also be needing the fact that for all $x\in L$ the power $N(x)=x^{17}\in K$. This follows from the fact that $N$ is the relative norm.
Let $a\in L$ and $b\in K$ be arbitrary. We use them to define a function $f_{a,b}:L \to\{\pm1\}$ by the formula $$ f_{a,b}(x)=(-1)^{tr_8(ax)+tr_4(b N(x))}. $$ With $x$ ranging over $L$ in some fixed order, we can identify $f_{a,b}$ with a vector in $\{-1,+1\}^{256}$. The small Kasami code $S$ then consists of the vectors $$ S=\{f(a,b)\mid a\in L,b\in K\}\subset\{\pm1\}^{256}. $$ By additivity of the trace functions we see that the inner product $$ \langle f_{a,b},f_{a',b'}\rangle=\sum_{x\in L}(-1)^{tr_8([a+a']x)+tr_4([b+b']N(x))}=\sum_{x\in L}f_{a+a',b+b'}(x). $$
Therefore it suffices to prove that unless $a=b=0$ the sum $$ S(a,b)=\sum_{x\in L}(-1)^{tr_8(ax)+tr_4(b N(x))} $$ has absolute value at most $16$. Let us first introduce an element $\epsilon\in L$ with the property $\epsilon^{16}+\epsilon=1$. Such an element exists by surjectivity of the relative trace $tr_{8/4}:L\to K, tr_{8/4}(x)=x^{16}+x$. By transitivity of trace $tr_8=tr_4\circ tr_{8/4}$ and $K$-linearity of $tr_{8/4}$ we can write everything using the additive character $e:L\to\{\pm1\},x\mapsto (-1)^{tr_8(x)}$ as $$ S(a,b)=\sum_{x\in L}e(ax+b\epsilon N(x)). $$
Squaring this gives $$ S(a,b)^2=\sum_{x\in L, y\in L}e(a[x+y]+b\epsilon[N(x)+N(y)]).\tag{1} $$ Here we make the substitution $y=x+z$. Using the Freshman's dream we calculate $$ \begin{aligned} N(x+z)&=(x+z)^{16}(x+z)\\ &=(x^{16}+z^{16})(x+z)\\ &=x^{17}+[x^{16}z+xz^{16}]+z^{17}\\ &=N(x)+[x^{16}z+xz^{16}]+N(z). \end{aligned} $$
Plugging this into $(1)$ gives $$ S(a,b)^2=\sum_{z\in L}e(az+b\epsilon N(z))\sum_{x\in L}e(b\epsilon[x^{16}z+xz^{16}]).\tag{2} $$ Let's look at the inner sum (over $x$). Because conjugate elements share the same trace $$ \begin{aligned} e(b\epsilon x^{16}z)&=e((b\epsilon x^{16}z)^{16})\\ &=e(b^{16}\epsilon^{16}x^{256}z^{16})\\ &=e(b\epsilon^{16}xz^{16}) \end{aligned} $$ as $b\in K\implies b^{16}=b$ and $x\in L\implies x^{256}=x$.
Taking into account the equation $\epsilon^{16}+\epsilon=1$ we have arrived at the form $$ S(a,b)^2=\sum_{z\in L}e(az+bN(z))\sum_{x\in L}e(bz^{16}x).\tag{3} $$ By orthogonality of characters the inner sum vanishes unless $bz^{16}=0$ in which case it is equal to $|L|=256$.
If $b=0$, we thus have $$S(a,0)^2=256\sum_{z\in L}e(az).$$ Another application of the orthogonality of characters tells us that this sum vanishes unless we also have $a=0$. But in that case we have the trivial inner product $S(0,0)=256$.
If $b\neq0$ the inner sum in $(3)$ vanishes except when $z=0$ implying $$ S(a,b)^2=256e(a\cdot 0+b N(0))=256 $$ proving that in the non-trivial cases we either have $S(a,b)=0$ or $S(a,b)=\pm16$. QED.