kosmos.partitioning.partition¶
Classes¶
- class Partition[source]¶
Circuit partition with QPU assignment.
- circuit¶
Quantum circuit assigned to this partition.
- Type:
QuantumCircuit
- original_gate_indices¶
Indices of gates from the original circuit that are in this partition.
- node¶
The quantum node this partition is allocated to, if single-node partition.
- Type:
QuantumNode | None
- qubit_to_node_mapping¶
Mapping from physical qubits to nodes for multi-node partitions.
- Type:
Properties
- property min_gate_index¶
Get earliest gate index from original circuit.
- Returns:
Minimum gate index, or infinity if no gates.
- Return type:
- property physical_qubits_used¶
Get set of physical qubits used by this partition.
- property is_multi_node¶
Check if partition is allocated acress multiple nodes.
- Returns:
True if partitions spans mutliple nodes.
- Return type:
- property allocated_nodes¶
Get all nodes this partition is allocated to.
- Returns:
Set of nodes hosting qubits from this partition.
- Return type:
- property end_time¶
Calculate end time based on start time and circuit depth.
- Returns:
Time the partition finishes, if a start time is given.
- Return type:
int | None
Methods
- get_node_for_qubit(physical_qubit: int) kosmos.topology.node.QuantumNode | None[source]¶
Get the node hosting a specific physical qubit.
- Parameters:
physical_qubit (int) – Physical qubit index.
- Returns:
Node hosting the qubit, or None if not allocated.
- Return type:
QuantumNode | None
Functions¶
- create_subcircuit_from_gates(gate_list: list[dict]) tuple[qiskit.QuantumCircuit, dict[int, int]][source]¶
Create a subcircuit from a list of gates.