Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
erichulburd opened this issue Feb 10, 2022 · 1 comment
Open

Comments

@erichulburd
Copy link
Contributor

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
@j4ustin
Copy link
Contributor

j4ustin commented Feb 11, 2022

Hey @erichulburd this PR should resolve this issue: #26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants