You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Transpile gives wrong native circuit with sx basis but correct circuit with u basis for Armonk.
Steps to reproduce the problem
We will define a 180 degree rotation about y axis (i.e. the Y gate) and about the -y axis (i.e. -Y gate) using the decomposition of an arbitrary rotation.
Notice that the sx basis gives same exact transpiled circuit whereas u basis differs in the argument of u3. If you simulate the circuit, they differ by a global phase (i.e. whether you get i|1> or -i|1>), and the phase difference between Y and -Y is important, i.e. for DD, so this isn't good.
Note: You can do the same procedure with X and -X, but you actually get a difference in both bases as expected.
What is the expected behavior?
Using the sx basis shouldn't destroy phase information that the u basis preserves, as this is important for implementing real procedures.
Suggested solutions
I'm not sure how transpile works under the hood, so it's hard to offer suggested solution. However, if it's expected that sx basis may loose phase information, it would be nice for a warning to be given.
P.S. If I specify things in u basis, are they still transpiled to sx before being run, and if so, how can I implement Y and -Y as I want?
The text was updated successfully, but these errors were encountered:
@naezzell have you tried this on qiskit 0.23.3 or 0.23.4 (which was just released a little while ago)? 0.23.3 included some fixes for the transpiler around global phase tracking (see #5618 and #5474). I haven't looked at this issue in detail yet, so I'm not sure if it will fix it, or there is something else going on.
@naezzell have you tried this on qiskit 0.23.3 or 0.23.4 (which was just released a little while ago)? 0.23.3 included some fixes for the transpiler around global phase tracking (see #5618 and #5474). I haven't looked at this issue in detail yet, so I'm not sure if it will fix it, or there is something else going on.
Things seem to work in qiskit 0.23.4. Thanks for the heads up!
Informations
What is the current behavior?
Transpile gives wrong native circuit with sx basis but correct circuit with u basis for Armonk.
Steps to reproduce the problem
We will define a 180 degree rotation about y axis (i.e. the Y gate) and about the -y axis (i.e. -Y gate) using the decomposition of an arbitrary rotation.
Now we will transpile these using Armonk as the backend (1) with the sx basis and (2) with the u basis.
Notice that the sx basis gives same exact transpiled circuit whereas u basis differs in the argument of u3. If you simulate the circuit, they differ by a global phase (i.e. whether you get i|1> or -i|1>), and the phase difference between Y and -Y is important, i.e. for DD, so this isn't good.
Note: You can do the same procedure with X and -X, but you actually get a difference in both bases as expected.
What is the expected behavior?
Using the sx basis shouldn't destroy phase information that the u basis preserves, as this is important for implementing real procedures.
Suggested solutions
I'm not sure how transpile works under the hood, so it's hard to offer suggested solution. However, if it's expected that sx basis may loose phase information, it would be nice for a warning to be given.
P.S. If I specify things in u basis, are they still transpiled to sx before being run, and if so, how can I implement Y and -Y as I want?
The text was updated successfully, but these errors were encountered: