Skip to content

Set coupling_map on provider configuration based on QVM/QPU topology #24

@erichulburd

Description

@erichulburd

Currently the backend provider configuration defaults to coupling_map=[].

This requires the user to manually set the coupling map when an algorithm uses it. However, coupling maps are implicit in the backend topology. We should set programmatically set the coupling map upon initialization of the backend provider.

from qiskit_rigetti import RigettiQCSProvider, RigettiQCSBackend
from qiskit.transpiler import CouplingMap
import pyquil

# get the qvm coupling map and convert to qiskit, insert into backend
qvm = pyquil.get_qc("7q-qvm")
g = qvm.quantum_processor.qubit_topology()
h = g.to_directed()
cm = h.edges()
rigprovider = RigettiQCSProvider()
backend = rigprovider.get_simulator(num_qubits=7, noisy=False)
conf = backend.configuration()
conf.coupling_map = CouplingMap(cm)
conf.simulator = True
backend._configuration = conf

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions