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

Track swap mapping permutations in Stochastic mapper #6827

Closed
wants to merge 18 commits into from
Closed

Track swap mapping permutations in Stochastic mapper #6827

wants to merge 18 commits into from

Conversation

nonhermitian
Copy link
Contributor

@nonhermitian nonhermitian commented Jul 28, 2021

Summary

Being able to determine the final qubit permutation after swap mapping has been a much needed routine for a couple of years now. It is trivial to implement and I have done so here for the Stochastic swap mapper.

Left to do before removing WIP:

  • Add tests.
  • Changelog

Details and comments

@nonhermitian nonhermitian requested a review from mtreinish July 28, 2021 14:41
@nonhermitian nonhermitian requested a review from a team as a code owner July 28, 2021 14:41
@nonhermitian nonhermitian changed the title [WIP] Track swap mapping permutations in Stochastic mapper Track swap mapping permutations in Stochastic mapper Jul 28, 2021
@nonhermitian nonhermitian changed the title Track swap mapping permutations in Stochastic mapper [WIP] Track swap mapping permutations in Stochastic mapper Jul 28, 2021
@nonhermitian
Copy link
Contributor Author

Back into WIP as there is edge cases

@nonhermitian nonhermitian changed the title [WIP] Track swap mapping permutations in Stochastic mapper Track swap mapping permutations in Stochastic mapper Jul 28, 2021
@itoko
Copy link
Contributor

itoko commented Jul 29, 2021

All the routing passes (including StochasticSwap) now seem to set the final permutation as a Layout object to property_set["final_layout"] when fake_run option is True.
Why don't we promote property_set["final_layout"] to be always set in run method (for all routing passes), instead of introducing a new property final_permutation?

@nonhermitian nonhermitian changed the title Track swap mapping permutations in Stochastic mapper [WIP] Track swap mapping permutations in Stochastic mapper Jul 29, 2021
@nonhermitian
Copy link
Contributor Author

So there are a couple of advantages here: 1) This computes without the need for a fake run. 2) This includes the initial layout in the permutation so that this tells you the full permutation details whereas the method you bring up does not. Importantly, this will allow you to put measurements and single qubit gates on a circuit AFTER compilation in the correct order.

@nonhermitian nonhermitian changed the title [WIP] Track swap mapping permutations in Stochastic mapper Track swap mapping permutations in Stochastic mapper Jul 29, 2021
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

Successfully merging this pull request may close these issues.

2 participants