mqt.ionshuttler.linear.parser¶
Read supported circuits and prepare their gates for scheduling.
Module Contents¶
- DependencyMap¶
- ParsedCircuit¶
- GateDurationMap¶
- CircuitInput¶
- parse_circuit(circuit: CircuitInput, *, use_dependencies: bool = True, gate_timing: GateTiming | None = None, gate_durations: GateDurationMap | None = None, gate_types: Sequence[type[GateAction]] | None = None) ParsedCircuit[source]¶
Prepare a Qiskit circuit or QASM circuit for scheduling.
Strings are interpreted as QASM text, while
pathlib.Pathinputs are read as UTF-8 files. When dependency analysis is disabled, the final two return values areNone.- Parameters:
circuit – Circuit to prepare.
use_dependencies – Whether to identify which gates must precede others.
gate_timing – Hardware durations and virtual gate implementations.
gate_durations – Optional duration overrides. This compact form cannot be combined with
gate_timing.gate_types – Gate classes understood by the circuit frontend.
- Returns:
The qubit count, gates ready to schedule, and optional maps of which gates directly precede and follow one another.
- Raises:
TypeError – If
circuithas an unsupported type.
- parse_quantum_circuit(circuit: qiskit.QuantumCircuit, *, use_dependencies: bool = True, gate_timing: GateTiming | None = None, gate_types: Sequence[type[GateAction]] | None = None) ParsedCircuit[source]¶
Prepare a Qiskit circuit for scheduling.
- Returns:
The qubit count, gates ready to schedule, and maps of which gates directly precede and follow one another.
- parse_qasm_to_gate_sequence(qasm: str, *, gate_timing: GateTiming | None = None, gate_durations: GateDurationMap | None = None, gate_types: Sequence[type[GateAction]] | None = None) tuple[int, list[GateAction]][source]¶
Read the supported gates from QASM text.
- Returns:
The qubit count and ordered gate actions.
- compute_gate_dependencies_from_qasm(qasm: str, *, gate_types: Sequence[type[GateAction]] | None = None) tuple[DependencyMap, DependencyMap][source]¶
Return the gates that directly precede and follow each QASM gate.
- parse_qasm_to_gate_sequence_with_dependencies(qasm: str, *, gate_timing: GateTiming | None = None, gate_durations: GateDurationMap | None = None, gate_types: Sequence[type[GateAction]] | None = None) tuple[int, list[GateAction], DependencyMap, DependencyMap][source]¶
Read QASM gates together with their direct dependencies.
- Returns:
The qubit count, gates in circuit order, and maps of which gates directly precede and follow one another.
- parse_qasm(qasm: str, *, use_dependencies: bool = True, gate_timing: GateTiming | None = None, gate_durations: GateDurationMap | None = None, gate_types: Sequence[type[GateAction]] | None = None) ParsedCircuit[source]¶
Prepare supported QASM text for scheduling.
- Returns:
The qubit count, gates ready to schedule, and optional maps of which gates directly precede and follow one another.
- parse_qasm_file(path: Path, *, use_dependencies: bool = True, gate_timing: GateTiming | None = None, gate_durations: GateDurationMap | None = None, gate_types: Sequence[type[GateAction]] | None = None) ParsedCircuit[source]¶
Prepare a UTF-8 QASM file for scheduling.
- Returns:
The qubit count, gates ready to schedule, and optional maps of which gates directly precede and follow one another.
- parse_qasm_file_with_dependencies(path: Path, *, gate_timing: GateTiming | None = None, gate_durations: GateDurationMap | None = None, gate_types: Sequence[type[GateAction]] | None = None) tuple[int, list[GateAction], DependencyMap, DependencyMap][source]¶
Read a UTF-8 QASM file together with its direct dependencies.
- Returns:
The qubit count, gates in circuit order, and maps of which gates directly precede and follow one another.