mqt.ionshuttler.single_shuttler.compilation

Module Contents

is_qasm_file(filename: Path) bool[source]
extract_qubits_from_gate(gate_line: str) list[int][source]

Extract qubit numbers from a gate operation line.

parse_qasm(filename: str | Path) list[tuple[int, ...]][source]

Parse a QASM file and return qubits used for each gate, preserving their order.

get_front_layer(dag: DAGDependency) list[DAGDepNode][source]

Get the front layer of the DAG.

remove_node(dag: DAGDependency, node: DAGDepNode) None[source]

Execute a node and update the DAG (remove the node and its edges).

find_best_gate(front_layer: list[DAGDepNode], dist_map: dict[int, int]) DAGDepNode[source]

Find the best gate to execute based on distance.

manual_copy_dag(dag: DAGDependency) DAGDependency[source]
update_sequence(dag: DAGDependency, dist_map: dict[int, int]) tuple[list[list[int]], DAGDepNode | None][source]

Get the sequence of gates from the DAG. Creates a new DAG and removes all gates from it while creating the sequence.