merge_parallel_block_layers#
- tqec.compile.blocks.merge_parallel_block_layers(blocks_in_parallel, scalable_qubit_shape)[source]#
Merge several stacks of layers executed in parallel into one stack of larger layers.
- Parameters:
blocks_in_parallel (Mapping[LayoutPosition2D, Block]) – a 2-dimensional arrangement of blocks. Each of the provided block MUST have the exact same duration (also called “temporal footprint”, or number of atomic layers).
scalable_qubit_shape (PhysicalQubitScalable2D) – scalable shape of a scalable qubit. Considered valid across the whole domain.
- Returns:
a stack of layers representing the same slice of computation as the provided
blocks_in_parallel
.- Raises:
TQECException – if two items from the provided
blocks_in_parallel
do not have the same temporal footprint.NotImplementedError – if the provided blocks cannot be merged due to a code branch not being implemented yet (and not due to a logical error making the blocks unmergeable).
- Return type:
list[LayoutLayer | BaseComposedLayer]