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

How to represent that of swap(q1,q2), q1 is idling in the first cycle #488

Open
jvansomeren opened this issue May 9, 2023 · 0 comments
Open

Comments

@jvansomeren
Copy link
Collaborator

When swap(q1,q2) is implemented by a decomposition to 3 CNOTs and those are decomposed to Ym90;CZ;Y90, then q1 (or otherwise q2, this depends on the details of the decomposition) idles during the first of the 10 cycles of the effective duration of this decomposition on starmon. This means that when q1 is free earlier in the past than q2 that interchanging the operands of swap(q1,q2) to swap(q2,q1) extends the circuit less so is better.
This optimization is implemented in the generic (target independent) part of the router although it is specific to a particular target (starmon).
Adding introspection could solve this: at the first use of this optimization, it is tested by decomposing swap(q1,q2) (and also move(q1,q2)) and 'scheduling' those sequences of primitives; by inspecting the schedule one could detect this idling; and this could be indicated in an attribute of the class for later use.

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

1 participant