Workflow & Architecture¶
DQC turns a circuit and a network into a distributed, schedulable program. This page describes the pipeline and the module layout behind it.
The pipeline¶
OpenQASM circuit + network topology
│ compile (partition across QPUs, route inter-QPU gates)
▼
distributed OpenQASM ──► verify (Hellinger-fidelity check vs. original)
│ schedule (lay operations on a hardware timeline)
▼
execution schedule (minimize makespan)
- Load — OpenQASM is loaded from disk
(
memq_dqc.preprocessing.qasm.io.load_qasm_program). - Clean — statements are cleaned into lightweight structures
(
memq_dqc.preprocessing.qasm). - Build the DAG — circuit operations are assembled into a circuit DAG
(
memq_dqc.circuit.CircuitDAG, built frommemq_dqc.circuit.Opandmemq_dqc.circuit.Layer). - Partition — the
Partitionerassigns logical qubits to QPUs; theCompilerfront end drives this for you (see Partitioning Algorithms). - Reconstruct — inter-QPU gates are routed and the distributed circuit is
extracted (
memq_dqc.builder.extract_distributed_circuit), inserting the network primitives (cat-entanglement and remote gates). - Verify — the distributed circuit is rewritten to an equivalent
monolithic circuit and both are simulated and compared
(
memq_dqc.verify.verify_distributed_circuit). - Schedule — the
Schedulerlays the distributed operations on a hardware timeline, respecting data dependencies, communication-qubit availability, and per-operation durations, aiming to minimize the makespan.
Discrete-event entanglement timing¶
The DES link schedulers model independent entanglement attempts in fixed
cycles. If one cycle succeeds with probability p, the successful cycle
number is geometrically distributed:
The scheduler samples N directly and schedules one EPR-ready event at
current_time + N * cycle_time. This is distributionally identical to
processing failed attempts one at a time, but its host runtime does not grow
with the potentially very large number of failed cycles. A seed still makes a
run deterministic; exact seeded schedules may differ across memq_dqc versions if
the random-sampling implementation changes.
The main workflow APIs can emit progress, timing, and debug diagnostics via the
verbosity controls on partitioning, extraction, and verification — see
Logging & Verbosity.
Package layout¶
| Package | Responsibility |
|---|---|
memq_dqc.preprocessing.qasm |
Load and clean OpenQASM; extraction and IO helpers. |
memq_dqc.circuit |
Circuit representation: Op (op.py), Layer (layer.py), Circuit (circuit.py), and the DAG builders in the dag/ subpackage (mono, distributed, annotated, routing, remap, entanglement, swap_builders). |
memq_dqc.network |
Network topology: NetworkGraph, PhysicalQubit, and config builders/validators. |
memq_dqc.partition |
Partitioning strategies and the Partitioner façade. |
memq_dqc.builder |
Distributed-circuit extraction (circuit_extractor.py, extract_utils.py). |
memq_dqc.verify |
Correctness checking of distributed circuits. |
memq_dqc.scheduler |
Schedulers (FIFO, discrete-event link schedulers) and scheduling-instance record types. |
memq_dqc.visualization |
SVG/matplotlib views of circuits, partitions, and schedules. |
memq_dqc.utils |
Shared circuit and partition helpers. |
Public entry points¶
memq_dqc.Compiler— recommended front end (compile → verify).memq_dqc.Scheduler— build an execution schedule from a compiler or a scheduling instance.memq_dqc.Partitioner— direct control over the partitioning step.memq_dqc.get_verification_artifacts— one call returning both circuits and their DAGs.memq_dqc.compile_scheduling_instance— a versioned, JSON-persistable scheduling instance for external schedulers (see the Scheduling-Instance API).
For the full symbol-level reference, see the API Reference.