-
Notifications
You must be signed in to change notification settings - Fork 73
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
quilc charges double for RY(pi)
#829
Comments
Just a couple of notes from inspection of
Here are three ways to get the shorter decomposition (there may be more):
will allow the addresser to emit better code for the chip. The compressor will subsequently respect this, since it only uses decompiled code if it's no worse than the original.
|
For what it's worth, I don't view the current behavior as being a real problem, in the sense that I know that on typical programs the overhead will not be a big deal (I nice guarantee from any flavor of Euler decompilation). However, it's a special enough case that people will naturally try it, so it would be nice for quilc to get it right. I think the way in which things go awry in the above example is interesting in the sense that it's a reminder of how some of this machinery fits together, and where things can get lost at the seams. |
I ultimately agree that it doesn't seem to be a major issue -- usually the ZXZ decomposition is not applicable. |
For anyone interested in how the compiler chooses which Euler decompositions to support: At the time the chip-spec is constructed, the compiler tries to find the best way to compile an arbitrary gate down to native gates (see |
After thinking more, adding a (define-compiler FOO-to-BAR
((my-gate ("FOO" (theta) q))
:specialize '((FOO-to-BAR-2pi (("FOO" (#.2pi) q)))
(FOO-to-BAR-pi (("FOO" (#.pi) q)))))
(inst "BAR" (/ theta 2) q)) Would also define compilers Then one could specialize the Euler compilers to add special cases for RY(pi) and similar. The nativization will pick up the specialized compilers because their output may lie in the target gateset even when the more generic compiler's output does not. Any thoughts? |
A single
RY
gate translates to twoRX
gates, when we could get away with just one.The text was updated successfully, but these errors were encountered: