kosmos.dqc_scheduling.assignment_strategies.greedy_assignment

Classes

class GreedyAssignment(network: kosmos.topology.net.Network)[source]

Bases: kosmos.dqc_scheduling.assignment_strategies.assignment_strategy.AssignmentStrategy

Greedy assignment: assigns partition to nodes with capacity at earliest time.

Initialize with network topology.

Parameters:

network (Network) – Network containing QPU nodes with capacity info.


Methods

allocate(partition: kosmos.partitioning.partition.Partition) kosmos.dqc_scheduling.space_time_matrix.SpaceTimeMatrix[source]

Allocate partition greedily to nodes at earliest available time.

Strategy: For each qubit, assign it to nodes in ascending ID order (QPU_1, QPU_2, QPU_3).

Parameters:

partition (Partition) – Partition to allocate.

Returns:

Matrix with node assignments and timing.

Return type:

SpaceTimeMatrix