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

Add transpile option to disable routing #4053

Closed
kdk opened this issue Mar 30, 2020 · 5 comments · Fixed by #5274
Closed

Add transpile option to disable routing #4053

kdk opened this issue Mar 30, 2020 · 5 comments · Fixed by #5274
Labels
type: enhancement It's working, but needs polishing

Comments

@kdk
Copy link
Member

kdk commented Mar 30, 2020

What is the expected enhancement?

In some contexts, users want to manually route their circuits. If a circuit is already routed, the default transpile levels will skip running the router, but a) this is not publicly documented and b) if a user makes a mistake in their routing, the routing stage will still run (and the user will likely not immediately notice their error).

#3999 added routing_method as a keyword argument to transpile. We should add an argument like routing_method='none' to allow users to specify that the routing should not be run.

@kdk kdk added the type: enhancement It's working, but needs polishing label Mar 30, 2020
@ajavadia
Copy link
Member

ajavadia commented Apr 1, 2020

I gave an example in #3999, which you rightly pointed out won't work.

transpile(circuit, backend, coupling_map=None)

Instead, I think the correct way to this is actually:

transpile(circuit, backend, coupling_map=CouplingMap.from_full(backend.num_qubits+1))

This means assume all the characteristics of that device, just override its coupling map to be fully connected.

@kdk
Copy link
Member Author

kdk commented Apr 1, 2020

Why backend.num_qubits+1? Would this remove our ability to run CXDirection, or raise early if a user mis-routes their circuit?

@1ucian0
Copy link
Member

1ucian0 commented Apr 1, 2020

I like routing_method='none'.

@ajavadia
Copy link
Member

ajavadia commented Apr 1, 2020 via email

@kdk
Copy link
Member Author

kdk commented Apr 1, 2020

If a user selects routing_method='none', we still have a coupling map so we can still run the equivalent of CheckMap as a constraint check or validation pass.

@kdk kdk linked a pull request Oct 27, 2020 that will close this issue
@mergify mergify bot closed this as completed in #5274 Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement It's working, but needs polishing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants