:py:mod:`kosmos.partitioning.algorithms.capacity_partitioner` ============================================================= .. py:module:: kosmos.partitioning.algorithms.capacity_partitioner Classes ------- .. py:class:: CapacityBasedPartitioner(network: kosmos.topology.net.Network | None, num_partitions: int | None) Bases: :py:class:`kosmos.partitioning.algorithms.partitioning_algorithm.PartitioningAlgorithm` Naive capacity-based partitioner. Distributes nodes evenly across partitions, ignoring connectivity. Initialize the partitioning algorithm. :param network: The network topology. Required if num_partitions is None. :type network: Network | None :param num_partitions: Number of partitions to create. If None, the number of quantum nodes in the network is used. :type num_partitions: int | None | .. rubric:: Methods .. py:method:: partition(circuit: kosmos.partitioning.graph.Graph | qiskit.QuantumCircuit) -> dict[int, int] Compute a partitioning for the given circuit. :param circuit: Circuit to partition. :type circuit: Graph | QuantumCircuit :returns: A mapping from each node index to the partition identifier it is assigned to. :rtype: dict[int, int]