We investigate novel protocols for entanglement purification of qubit Bell pairs. Employing genetic algorithms for the design of the purification circuit, we obtain shorter circuits achieving higher success rates and better final fidelities than what is currently available in the literature. We provide a software tool for analytical and numerical study of the generated purification circuits, under customizable error models. These new purification protocols pave the way to practical implementations of modular quantum computers and quantum repeaters. Our approach is particularly attentive to the effects of finite resources and imperfect local operationsphenomena neglected in the usual asymptotic approach to the problem. The choice of the building blocks permitted in the construction of the circuits is based on a thorough enumeration of the local Clifford operations that act as permutations on the basis of Bell states.The eventual construction of a scalable quantum computer is bound to revolutionize both how we solve practical problems like quantum simulation, and how we approach foundational questions ranging from topics in computational complexity to quantum gravity. However, numerous engineering hurdles have to be surmounted along the way, as exemplified by today's race to implement practical quantum error-correcting codes. While great many high performing errorcorrecting codes have been constructed by theorists, only recently did experiments start approaching hardware-level error rates that are sufficiently close to the threshold at which codes actually start to help [1, 2]. A promising approach is the modular architecture [3, 4] for quantum computers with implementations based on, among others, superconducting circuits [5], trapped ions [6, 7], or NV centers [8]. The central theme is the creation of a network of small independent quantum registers of few qubits, with connections capable of distributing entangled pairs between nodes [4, 9]. Such an architecture avoids the difficulty of creating a single complex structure as described in more monolithic approaches and offers a systematic way to minimize undesired crosstalk and residual interactions while scaling the system. Moreover, the same modules might also be used for the design of quantum repeaters for use in quantum communication [10][11][12][13][14].Experimentally, there have been significant advances in creating entanglement between modules, with demonstrations in trapped ions [6, 15], NV centers [16,17], neutral atoms [18], and superconducting circuits [5]. However, the infidelity of created Bell pairs is on the order of 10%, while noise due to local gates and measurements can be much lower than 1%. Purification of the entanglement resource will be necessary before successfully employing it for fault-tolerant computation or communication. Although various purification protocols have been proposed [7, 9, 10, 14,[19][20][21][22], there is still a lack of systematic comparison and optimization of purification circuits, as the number of possible designs in...