surface_sim.util.merge_operation_layers#
- merge_operation_layers(*operation_layers)[source]#
Merges operation layers acting on different qubits to simplify the final circuit. It tries to merge the different blocks if they have the same sequence of operations and noise channels, if not, blocks are stacked together. This ensures that the output circuit has the same effect as the stacking of all blocks.
- Parameters:
- operation_layers
Each operation layer is a
stim.Circuitacting on different qubits. A valid operation layer is astim.Circuitin which the qubits perform exactly one operation (without including noise channels).
- Returns:
- merged_blocks
A
stim.Circuithaving the same effect as stacking all the given operation layers.
Notes
The instructions in
merged_blockshave been (correctly) merged so that the lenght of the output circuit is minimal. Correctly means that the order of the instructions has not been changed in a way that changes the output of the circuit.