Skip to content

feat(dqc): Implement Distributed Quantum Computing plugin#2

Open
youf3 wants to merge 5 commits into
quant-net:developfrom
youf3:add_dqc_plugin
Open

feat(dqc): Implement Distributed Quantum Computing plugin#2
youf3 wants to merge 5 commits into
quant-net:developfrom
youf3:add_dqc_plugin

Conversation

@youf3

@youf3 youf3 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a new dqc plugin to the Quant-Net controller that handles distributed quantum computing workflows end-to-end: it accepts a partitioned circuit (pre-partitioned per QPU or raw source), validates and labels it via qnpack, schedules execution across hardware agents using FCFS, discovers entanglement routes, injects BSM node commands, and returns allocation and simulation payload to the caller.

Changes

plugins/schema/dqc.yaml — AsyncAPI schema (new)

Defines dqcRequest / dqcResponse (AsyncAPI 2.6.0):

  • Request payload: circuit_mode (required, cisco | tket), optional partitioned_commands (pre-parsed per-QPU dicts), or circuit_file / circuit_content for raw circuit source
  • Response: status, rid, and a data object containing startTime, allocations, routes (cross-QPU node-ID paths), and simulation result

plugins/dqc/dqc/ — Plugin package (new)

  • __init__.py (DQC(ProtocolPlugin)) — Main request handler; orchestrates the full pipeline:

    1. Resolves partitioned commands (pre-parsed or parsed from file/content via qnpack frontend)
    2. Validates and labels commands (qnpack.dqc.labeling.label_and_build_maps)
    3. Converts labeled IR to a flat timeslot schedule (ir_converter)
    4. Discovers cross-QPU routes via the topology router; injects BSM node commands for each entanglement path
    5. Builds and registers a DynamicExperiment, schedules it via RequestManager, and returns allocations + simulation payload
    • Handles proxy-object sanitisation (_to_plain) so qnpack internals receive plain Python dicts
  • logic.py (DQCLogic) — Builds DynamicExperiment definitions from flat timeslot records; implements FCFS slot allocation; provides helpers extract_qpu_pairs and extract_bsm_nodes_from_path

  • ir_converter.py (labeled_ir_to_timeslot_schedule) — Cursor-based scheduler that converts labeled per-QPU IR into a flat timeslot list, mirroring qnpack's ControllerProtocol.compute_timeslot_schedule. Advances QPUs in lock-step at sync points (entanglement gen, EJPP start/end) and in parallel for local gates

  • topology_adapter.py (get_qpu_info_from_topology) — Extracts QPU info, integer-to-label ID maps, and BSM node identities from the controller topology context

plugins/dqc/ — Tests (new)

  • test_dqc.py — Unit tests for DQCLogic: build_dynamic_experiment, extract_qpu_pairs (basic, canonical ordering, empty, multiple pairs)
  • test_dqc_rpc.py — Integration-style RPC tests for handle_dqc_request using DQCTestClient with a mock topology and router context

youf3 added 5 commits March 5, 2026 14:15
- Implemented ir_converter.py to convert labeled per-QPU IR commands into a flat timeslot record format for DQCLogic.
- Added topology_adapter.py to convert live controller topology into data structures compatible with qnpack frontends and DQC scheduling.
- Updated test_dqc.py to reflect changes in DQCLogic and removed unused agent_ids.
- Enhanced test_dqc_rpc.py to support both tket and Cisco modes for DQC requests, including synthetic test circuits.
- Updated dqc.yaml schema to version 2.0.0, adding support for circuit_mode and partitioned_commands.
@youf3
youf3 requested a review from disprosium8 July 7, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant