-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Why not Swap passes return circuit with physical qubits #2044
Comments
I found I misunderstood output of current swap passes, pointed out by @1ucian0 . |
I don't agree with this. |
@ajavadia Oh, I understand your definition of
According to your comments on #2066, I think you agreed that Swap passes should return circuit with physical qubits. So I think we can close this issue and continue discussion on how and when (your definition of) |
Ok so let's continue the discussion in #2066 |
Users are likely to expect Swap passes return physical circuit (circuit with physical qubits) as the original swap mapper was doing so. However current Swap passes [<-This was not correct. BasicSwap and LookaheadSwap return physical circuit. Only the StochasticSwap doesn't return physical circuit] return logical circuit (circuit with virtual qubits) + initial layout. Not only it different from users' expectation, but also it means users must apply the initial layout to the logical circuit in order to get physical circuit (using another pass, say ApplyLayout pass).
The problem is it must be done "before" applying Decompose(SwapGate) pass because ApplyLayout pass need to track layout change relying on swap gates. Once swap gates are decomposed, users no longer produce physical circuit. Can PassManager handle this dependency? I think manual management of this kind of dependency is not a good solution. (Note that I don't argue if ApplyLayout pass is necessary or not). This issue is created for discussing what SwapPasses should return.
Isn't "SwapPasses return physical circuit" the simplest solution?
Simple example:
The text was updated successfully, but these errors were encountered: