sf.program_utils.DAG_to_list

DAG_to_list(dag)[source]

Transforms a Command DAG to a list representation.

The list contains the Command instances in (one possible) topological order, i.e., dependants following the operations they depend on.

Parameters

dag (networkx.DiGraph[Command]) – quantum circuit

Returns

same circuit in list form

Return type

list[Command]