dqcnac.mapping.circuit_partitioning module

Circuit partitioning with metis.

dqcnac.mapping.circuit_partitioning.circuit_partitioning(network: Network, circuit: qiskit.QuantumCircuit | qiskit.dagcircuit.DAGCircuit, graph: networkx.Graph | None = None, use_pre_pass=False, max_gates_in_a_group: int = 1) → dict[int, int][source]

Compute unequal partitions of circuit over the network to minimize communication between different nodes

Parameters:
  • network – the network

  • circuit – the circuit to partition

  • graph – a weighted graph representing the circuit

  • use_pre_pass – a boolean, it should be True if using pre-pass optimizations

  • max_gates_in_a_group – the maximum number of gates to consider when computing the partitions

Returns:

A dictionary of qubits to partitions

dqcnac.mapping.circuit_partitioning.equal_partitions(graph: networkx.Graph, n_parts: int) → dict[int, set][source]

Use pymetis to compute equal partitions.

Parameters:
  • graph – a graph representing the circuit

  • n_parts – the number of target partitions

Returns:

A dictionary of partitions to qubits