  In this paper we present genetic algorithms based search technique for the
linear optics schemes, performing two-qubit quantum gates. We successfully
applied this technique for finding heralded two-qubit gates and obtained the
new schemes with performance parameters equal to the best currently known. The
new simple metrics is introduced which enables comparison of schemes with
different heralding mechanisms. The scheme performance degradation is discussed
for the cases when detectors in the heralding part of the scheme are not
photon-number-resolving. We propose a procedure for overcoming this drawback
which allows us to restore the reliable heralding signal even with
not-photon-number-resolving detectors.
