Skip to content

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)
  1. Load — OpenQASM is loaded from disk (memq_dqc.preprocessing.qasm.io.load_qasm_program).
  2. Clean — statements are cleaned into lightweight structures (memq_dqc.preprocessing.qasm).
  3. Build the DAG — circuit operations are assembled into a circuit DAG (memq_dqc.circuit.CircuitDAG, built from memq_dqc.circuit.Op and memq_dqc.circuit.Layer).
  4. Partition — the Partitioner assigns logical qubits to QPUs; the Compiler front end drives this for you (see Partitioning Algorithms).
  5. 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).
  6. Verify — the distributed circuit is rewritten to an equivalent monolithic circuit and both are simulated and compared (memq_dqc.verify.verify_distributed_circuit).
  7. Schedule — the Scheduler lays 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:

P(N = n) = (1 - p)^(n - 1) p

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.