Heralded gate search with genetic algorithms for quantum computation