Optimal Subarchitectures

To compute (near-)optimal subarchitectures of quantum computing architectures with restricted connectivity as described in [13] the SubarchitectureOrder class is provided. This class has functionality to compute the quasi-order that allows for fast computation of optimal subarchitectures.

Note that the initial construction of the ordering might take a while for larger architectures.

class SubarchitectureOrder[source]

Class representing the partial order of (sub)architectures.

covering(nqubits, size)[source]

Return covering for nqubit circuits.

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

  • size (int) – limit for the size of the covering.

Returns:

list[Graph] – Subarchitecture covering for circuits of the given size.

Note

A smaller covering might be found.

draw_subarchitecture(subarchitecture)[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 (Graph | tuple[int, int]) – Subarchitecture to be drawn.

Returns:

figure.Figure – Matplotlib figure.

draw_subarchitectures(subarchitectures)[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 (list[Graph] | list[tuple[int, int]]) – Subarchitectures to be drawn.

Returns:

list[figure.Figure] – List of matplotlib figures.

classmethod from_backend(backend)[source]

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

Parameters:

backend (BackendV1) – Qiskit backend.

Returns:

SubarchitectureOrder – The resulting partial order.

classmethod from_backend_v2(backend)[source]

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

Parameters:

backend (BackendV2) – Qiskit backend.

Returns:

SubarchitectureOrder – The resulting partial order.

classmethod from_coupling_map(coupling_map)[source]

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

Parameters:

coupling_map (Iterable[tuple[int, int]]) – Iterable of tuples of connected qubits.

Returns:

SubarchitectureOrder – The resulting partial order.

classmethod from_library(lib_name)[source]

Construct the partial order from a stored library.

Parameters:

lib_name (str | Path) – Path to the library.

Returns:

SubarchitectureOrder – The resulting partial order.

classmethod from_qmap_architecture(arch)[source]

Construct the partial order from a QMAP Architecture object.

Parameters:

arch (Architecture) – QMAP architecture.

Returns:

SubarchitectureOrder – The resulting partial order.

classmethod from_retworkx_graph(graph)[source]

Construct the partial order from retworkx graph.

Parameters:

graph (Graph) – retworkx graph representing the architecture.

Returns:

SubarchitectureOrder – The resulting partial order.

classmethod from_string(name)[source]

Construct the partial order from a library name.

Parameters:

name (str) – Name of the library.

Returns:

SubarchitectureOrder – The resulting partial order.

optimal_candidates(nqubits)[source]

Return optimal subarchitecture candidate.

Parameters:

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

Returns:

list[Graph] – List of optimal subarchitecture candidates for circuits of the given size.

store_library(lib_name)[source]

Store ordering.

Parameters:

lib_name (str | Path) – Path to the library.

Return type:

None

QMAP also provides precomputed subarchitecture libraries. The available libraries are available via:

subarchitectures.precomputed_backends = ['rigetti_16', 'ibm_guadalupe_16']

Convenience methods are provided to import these precomputed orderings:

subarchitectures.ibm_guadalupe_subarchitectures()

Load the precomputed ibm guadalupe subarchitectures.

Returns:

SubarchitectureOrder – The subarchitecture order for the ibm_guadalupe architecture.

subarchitectures.rigetti_16_subarchitectures()

Load the precomputed rigetti subarchitectures.

Returns:

SubarchitectureOrder – The subarchitecture order for the 16-qubit Rigetti architecture.