dftlib.transformer.rewrite_rules.try_merge_identical_gates

try_merge_identical_gates(dft, gate1, gate2)

(Rule #2): Try to merge gates with the same type and identical successors. These gates surely fail simultaneously and thus, one gate can be removed. :param dft: DFT :param gate1: First gate. :param gate2: Second gate (will be removed). :return: True iff merge and removal was successful.