create a word series with defined hamming distance among elements I want to obtain all words of specific length/alphabet which have a minimal hamming distance among themselves.
I'm not a mathematician so I try to show an example to make it clear what I need.
Word Length L = 4
Word Alphabet A = {0,1}
Word Alphabet Size |A| = 2
Word Min. Hamming Dist. H = 2

The first word is
w0 = {0,0,0,0}

Now the other words could be:
w1 = {0,0,1,1}
w2 = {1,1,0,0}

And hamming distances are
 Hamming(w0,w1) = 2 >= H
 Hamming(w0,w2) = 2 >= H
 Hamming(w1,w2) = 4 >= H

As you see, all hamming distances are equal or greater H.
For my purpose I would need L=512 and A={0,1} and |A|=2 and H=70.
How can I calculate this all without brute force / try and error?
Below is some ugly quick hack code which is ultimately slow. How to get this lightning fast?
// std header(s)
#include <array>
#include <algorithm>
#include <iostream>
#include <cmath>
#include <iterator>
#include <random>
#include <chrono>
#include <boost/iterator/zip_iterator.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/tuple/tuple_comparison.hpp>
#include <bitset>
#include <fstream>
#include <iostream>

class Hamming {
public:
  Hamming(int & _distance) : distance_(_distance) {};
  void operator() ( boost::tuple<int, int> const & words) {
      if(boost::get<0>(words)!=boost::get<1>(words)) {
            std::bitset<4> n=boost::get<0>(words);
            std::bitset<4> m=boost::get<1>(words);
            distance_+=(n ^ m).count();
        }

      }
private:
    int & distance_;
};



int main(int argc,char** argv) {
    const int arraysize=61;
    std::array<int,arraysize> a;
    int distance=0;
    int num;
    std::cout << "Input number of bag_words"<<std::endl;;
    std::cin>>num;
    std::vector<std::array<int, arraysize>> bag;
    Hamming myobject(distance);
    ////
    std::mt19937 mt(std::chrono::high_resolution_clock::now().time_since_epoch().count());
    std::uniform_int_distribution<int> d(0, 255);
    std::generate(a.begin(),a.end(),[&]{return d(mt);});
    bag.push_back(a);
    int counter=1;
    while (counter<num) {
        std::generate(a.begin(),a.end(),[&]{return d(mt);});
        int test=0;
        distance=0;
        for (int i=0 ; i<counter ; i++) {
            std::for_each(
                boost::make_zip_iterator(
            boost::make_tuple(a.begin(), bag[i].begin())
                ),
            boost::make_zip_iterator(
                boost::make_tuple(a.end(), bag[i].end())
            ),
            Hamming(distance)
            );
            if(distance>10) {
                ++test;
            }
            else break;
        }
        if (test==counter) {
            bag.push_back(a);
            ++counter;
        }
    }
    std::cout << std::endl;

    std::ofstream myfile ("example.txt");
    if (myfile.is_open()) {
        for(int i = 0; i < counter; i ++) {
            for (int j=0 ; j<arraysize ; j++) {
                myfile << bag[i][j] << " " ;
            }
            myfile << "\n";
        }
        myfile.close();
    }
    else std::cout << "Unable to open file";
}

 A: If you don't mind having regularly distributed words then you can build multi-dimensional cubic grid with an edge, equal to the threshold $H$, where each point represents one of words you need. 
I can see from your program that you actually consider tuples with elements from interval [0, 255]. So, for example, if you need pairs (L = 2) from this alphabet with minimal distance = 4 then you can build a following grid (where $240 = 11110000_2$): 

(  0,0) - (  0, 15) - (  0,240) - (  0,255)
   |          |           |           |
( 15,0) - ( 15, 15) - ( 15,240) - ( 15,255)
   |          |           |           |
(240,0) - (240, 15) - (240,240) - (240,255)
   |          |           |           |
(255,0) - (255, 15) - (255,240) - (255,255)

If you can't achieve the distance shift you need by changing only a single coordinate, then you need to group dimensions into bundles. For example, if you need to get 4-tuples on the {0,1} alphabet with minimal distance = 2, then you can merge four original positions in the 4-tuple to two bundled positions:

((00)(00)) - ((00)(11))
    |            |
((11)(00)) - ((11)(11))

(It's actually the example from your question with one additional 4-tuple.)
