Optimizations#

class Configuration.Optimizations#

Options that influence which circuit optimizations are applied during pre-processing.

property fix_output_permutation_mismatch#

Try to fix potential mismatches in output permutations. This is experimental and, hence, defaults to False.

property fuse_single_qubit_gates#

Fuse consecutive single-qubit gates by grouping them together. Defaults to True as this typically increases the performance of the subsequent equivalence check.

property reconstruct_swaps#

Try to reconstruct SWAP gates that have been decomposed (into a sequence of 3 CNOT gates) or optimized away (as a consequence of a SWAP preceded or followed by a CNOT on the same qubits). Defaults to True since this reconstruction enables the efficient tracking of logical to physical qubit permutations throughout circuits that have been mapped to a target architecture.

property remove_diagonal_gates_before_measure#

Remove any diagonal gates at the end of the circuit. This might be desirable since any diagonal gate in front of a measurement does not influence the probabilities of the respective states. Defaults to False since, in general, circuits differing by diagonal gates at the end should still be considered non-equivalent.

property reorder_operations#

The operations of a circuit are stored in a sequential container. This introduces some dependencies in the order of operations that are not naturally present in the quantum circuit. As a consequence, two quantum circuits that contain exactly the same operations, list their operations in different ways, also apply there operations in a different order. This optimization pass established a canonical ordering of operations by, first, constructing a directed, acyclic graph for the operations and, then, traversing it in a breadth-first fashion. Defaults to True.

property transform_dynamic_circuit#

Circuits containing dynamic circuit primitives such as mid-circuit measurements, resets, or classically-controlled operations cannot be verified in a straight-forward fashion due to the non-unitary nature of these primitives, which is why this setting defaults to False. By enabling this optimization, any dynamic circuit is first transformed to a circuit without non-unitary primitives by, first, substituting qubit resets with new qubits and, then, applying the deferred measurement principle to defer measurements to the end.