|View source on GitHub|
Defines primitives for common transformer patterns.
map_moments(...): Applies local transformation on moments, by calling
map_func(moment) for each moment.
map_operations(...): Applies local transformations on operations, by calling
map_func(op) for each op.
merge_k_qubit_unitaries_to_circuit_op(...): Merges connected components of operations, acting on <= k qubits, into circuit operations.
merge_moments(...): Merges adjacent moments, one by one from left to right, by calling
merge_operations(...): Merges operations in a circuit by calling
merge_func iteratively on operations.
merge_operations_to_circuit_op(...): Merges connected components of operations and wraps each component into a circuit operation.
toggle_tags(...): Toggles tags applied on each operation in the circuit, via
op.tags ^= tags