kosmos.dqc_scheduling.utils.protocol_scheduling_utils¶
Functions¶
- schedule_circuit_execution(step: kosmos.dqc_scheduling.execution_scheduler.ExecutionStep, event_queue: kosmos.dqc_scheduling.event_queue.EventQueue, network: kosmos.topology.net.Network, circuit_runner: kosmos.circuit_runner.qiskit_runner.QiskitRunner) None[source]¶
Schedule a circuit execution protocol.
- Parameters:
step (ExecutionStep) – Execution step containing circuit and dependencies.
event_queue (EventQueue) – Event queue to add the protocol to.
network (Network) – The quantum network topology.
circuit_runner (QiskitRunner) – Circuit runner for execution.
- schedule_remote_operation(step: kosmos.dqc_scheduling.execution_scheduler.ExecutionStep, event_queue: kosmos.dqc_scheduling.event_queue.EventQueue, network: kosmos.topology.net.Network, quantum_manager: kosmos.quantum_logic.quantum_register_manager.QuantumRegisterManager, eg_protocol_cls: type[kosmos.protocols.eg_protocol.EGProtocol], eg_protocol_config: kosmos.protocols.eg_protocol.EGProtocolConfig, last_remote_op_per_node_pair: dict[tuple[kosmos.topology.node.NodeId, kosmos.topology.node.NodeId], kosmos.dqc_scheduling.event.EventId], node_comm_usage: dict[kosmos.topology.node.NodeId, dict[int, list[kosmos.dqc_scheduling.event.EventId]]]) None[source]¶
Schedule entanglement generation and remote operation protocols.
- Parameters:
step (ExecutionStep) – Execution step containing remote operation info.
event_queue (EventQueue) – Event queue to add protocols to.
network (Network) – The quantum network topology.
quantum_manager (QuantumRegisterManager) – Quantum register manager reference.
eg_protocol_cls (type[EGProtocol]) – EG protocol class to instantiate.
eg_protocol_config (EGProtocolConfig) – Configuration for EG protocol.
last_remote_op_per_node_pair (dict[tuple[NodeId, NodeId], EventId]) – Tracks last remote op between each node pair.
node_comm_usage (dict[NodeId, dict[int, list[EventId]]]) – Tracks communication qubit usage per node and gate_time.
- compute_eg_dependencies(node_pair: tuple[kosmos.topology.node.QuantumNode, kosmos.topology.node.QuantumNode], gate_time: int, last_remote_op_per_node_pair: dict[tuple[kosmos.topology.node.NodeId, kosmos.topology.node.NodeId], kosmos.dqc_scheduling.event.EventId], node_comm_usage: dict[kosmos.topology.node.NodeId, dict[int, list[kosmos.dqc_scheduling.event.EventId]]]) list[kosmos.dqc_scheduling.event.EventId][source]¶
Compute dependencies for entanglement generation.
- Parameters:
node_pair (tuple[NodeId, NodeId]) – Source and target nodes.
gate_time (int) – Gate-timestep in space-time matrix.
last_remote_op_per_node_pair (dict[tuple[NodeId, NodeId], EventId]) – Last operation between each node pair.
node_comm_usage (dict[NodeId, dict[int, list[EventId]]]) – Current comm qubit usage.
- Returns:
Dependencies that must complete before EG can start.
- Return type:
- schedule_eg_protocol(node_pair: tuple[kosmos.topology.node.QuantumNode, kosmos.topology.node.QuantumNode], step_event_id: kosmos.dqc_scheduling.event.EventId, eg_dependencies: list[kosmos.dqc_scheduling.event.EventId], event_queue: kosmos.dqc_scheduling.event_queue.EventQueue, network: kosmos.topology.net.Network, quantum_manager: kosmos.quantum_logic.quantum_register_manager.QuantumRegisterManager, eg_protocol_cls: type[kosmos.protocols.eg_protocol.EGProtocol], eg_protocol_config: kosmos.protocols.eg_protocol.EGProtocolConfig) kosmos.dqc_scheduling.event.EventId[source]¶
Schedule entanglement generation protocol.
- Parameters:
node_pair (tuple[QuantumNode, QuantumNode]) – Source and target nodes.
step_event_id (EventId) – Event ID of the remote operation step.
eg_dependencies (list[EventId]) – Dependencies for the EG protocol.
event_queue (EventQueue) – Event queue to add protocol to.
network (Network) – The quantum network topology.
quantum_manager (QuantumRegisterManager) – Quantum register manager.
eg_protocol_cls (type[EGProtocol]) – EG protocol class to instantiate.
eg_protocol_config (EGProtocolConfig) – Configuration for EG protocol.
- Returns:
Event ID of the scheduled EG protocol.
- Return type:
- schedule_remote_op_protocol(step: kosmos.dqc_scheduling.execution_scheduler.ExecutionStep, eg_event_id: kosmos.dqc_scheduling.event.EventId, event_queue: kosmos.dqc_scheduling.event_queue.EventQueue, network: kosmos.topology.net.Network, quantum_manager: kosmos.quantum_logic.quantum_register_manager.QuantumRegisterManager) kosmos.dqc_scheduling.event.EventId[source]¶
Schedule remote operation protocol (gate or teleportation).
- Parameters:
step (ExecutionStep) – Execution step containing remote operation info.
eg_event_id (EventId) – Event ID of the EG protocol dependency.
event_queue (EventQueue) – Event queue to add protocol to.
network (Network) – The quantum network topology.
quantum_manager (QuantumRegisterManager) – Quantum register manager.
- Returns:
Event ID of the scheduled remote operation.
- Return type:
- get_ordered_node_pair_key(node_pair: tuple[kosmos.topology.node.QuantumNode, kosmos.topology.node.QuantumNode]) tuple[kosmos.topology.node.NodeId, kosmos.topology.node.NodeId][source]¶
Ensure consistent ordering for node pair keys.
- Parameters:
node_pair (tuple[QuantumNode, QuantumNode]) – Tuple of source_node and target_node.
- Returns:
Ordered node IDs for use as dict key.
- Return type: