  We propose genetic algorithms, which are robust optimization techniques
inspired by natural selection, to enhance the versatility of digital quantum
simulations. In this sense, we show that genetic algorithms can be employed to
increase the fidelity and optimize the resource requirements of digital quantum
simulation protocols, while adapting naturally to the experimental constraints.
Furthermore, this method allows us to reduce not only digital errors, but also
experimental errors in quantum gates. Indeed, by adding ancillary qubits, we
design a modular gate made out of imperfect gates, whose fidelity is larger
than the fidelity of any of the constituent gates. Finally, we prove that the
proposed modular gates are resilient against different gate errors.
