mqt.qmap.plugins.qiskit.sc.subarchitectures

Functionality for computing good subarchitectures for quantum circuit mapping.

This file implements the methods presented in https://arxiv.org/abs/2210.09321.

Classes

SubarchitectureOrder

Class representing the partial order of (sub)architectures.

Functions

ibm_guadalupe_subarchitectures(→ SubarchitectureOrder)

Load the precomputed ibm guadalupe subarchitectures.

rigetti_16_subarchitectures(→ SubarchitectureOrder)

Load the precomputed rigetti subarchitectures.

Module Contents

class SubarchitectureOrder[source]

Class representing the partial order of (sub)architectures.

Initialize a partial order.

classmethod from_retworkx_graph(graph: Graph) SubarchitectureOrder[source]

Construct the partial order from retworkx graph.

Parameters:

graph – retworkx graph representing the architecture.

Returns:

The resulting partial order.

classmethod from_coupling_map(coupling_map: Iterable[tuple[int, int]]) SubarchitectureOrder[source]

Construct partial order from coupling map defined as set of tuples of connected qubits.

Parameters:

coupling_map – Iterable of tuples of connected qubits.

Returns:

The resulting partial order.

classmethod from_backend(backend: qiskit.providers.BackendV1) SubarchitectureOrder[source]

Construct the partial order from a coupling map defined as a Qiskit backend.

Parameters:

backend – Qiskit backend.

Returns:

The resulting partial order.

classmethod from_backend_v2(backend: BackendV2) SubarchitectureOrder[source]

Construct the partial order from a coupling map defined as a Qiskit backend.

Parameters:

backend – Qiskit backend.

Returns:

The resulting partial order.

classmethod from_qmap_architecture(arch: Architecture) SubarchitectureOrder[source]

Construct the partial order from a QMAP Architecture object.

Parameters:

arch – QMAP architecture.

Returns:

The resulting partial order.

classmethod from_library(lib_name: str | Path) SubarchitectureOrder[source]

Construct the partial order from a stored library.

Parameters:

lib_name – Path to the library.

Returns:

The resulting partial order.

classmethod from_string(name: str) SubarchitectureOrder[source]

Construct the partial order from a library name.

Parameters:

name – Name of the library.

Returns:

The resulting partial order.

optimal_candidates(nqubits: int) list[Graph][source]

Return optimal subarchitecture candidate.

Parameters:

nqubits – size of circuit for which the optimal candidate should be given.

Returns:

List of optimal subarchitecture candidates for circuits of the given size.

covering(nqubits: int, size: int) list[Graph][source]

Return covering for nqubit circuits.

Parameters:
  • nqubits – size of circuit for which the covering should be given.

  • size – limit for the size of the covering.

Returns:

Subarchitecture covering for circuits of the given size.

Note

A smaller covering might be found.

store_library(lib_name: str | Path) None[source]

Store ordering.

Parameters:

lib_name – Path to the library.

draw_subarchitecture(subarchitecture: Graph | tuple[int, int]) matplotlib.figure.Figure[source]

Create a matplotlib figure showing subarchitecture within the entire architecture.

Nodes that are part of the subarchitecture are drawn yellow. Nodes that are not part of the subarchitecture are drawn blue.

Parameters:

subarchitecture – Subarchitecture to be drawn.

Returns:

Matplotlib figure.

draw_subarchitectures(subarchitectures: list[Graph] | list[tuple[int, int]]) list[matplotlib.figure.Figure][source]

Create matplotlib figures showing subarchitectures within the entire architecture.

For each subarchitecture one figure is drawn. Nodes that are part of the subarchitecture are drawn yellow. Nodes that are not part of the subarchitecture are drawn blue.

Parameters:

subarchitectures – Subarchitectures to be drawn.

Returns:

List of matplotlib figures.

ibm_guadalupe_subarchitectures() SubarchitectureOrder[source]

Load the precomputed ibm guadalupe subarchitectures.

Returns:

The subarchitecture order for the ibm_guadalupe architecture.

rigetti_16_subarchitectures() SubarchitectureOrder[source]

Load the precomputed rigetti subarchitectures.

Returns:

The subarchitecture order for the 16-qubit Rigetti architecture.