sf.program_utils.list_to_grid

list_to_grid(ls)[source]

Transforms a list of Commands to a grid representation.

The grid is a mapping from subsystem indices to lists of Command instances touching that subsystem, in temporal order. The same Command instance will appear in each list that corresponds to one of its subsystems.

Parameters

ls (Iterable[Command]) – quantum circuit

Returns

same circuit in grid form

Return type

dict[int, list[Command]]