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

Efficiency Bug #7352

Closed
anormanhogan opened this issue Dec 3, 2021 · 5 comments
Closed

Efficiency Bug #7352

anormanhogan opened this issue Dec 3, 2021 · 5 comments
Labels
bug Something isn't working status: duplicate This issue already exists

Comments

@anormanhogan
Copy link

Environment

  • Qiskit Terra version: 0.18.3
  • Python version: 3.8
  • Operating system: Mac OS Monterey 12.0.1

What is happening?

My quantum circuit's gates are inefficiently transpiling, causing my x sx gates to become rz sx rz gates. This brings my gates from 2->3 introducing noise
image

How can we reproduce the issue?

    qc.barrier()
    qc.cx(0, 1)
    qc.barrier()

    qc.x(0)

    qc.sx(0)

    qc.barrier()
    qc.cx(0, 2)
    qc.barrier()

What should happen?

The transpiler should see if there is a more efficient way to create the circuit (if possible)

Any suggestions?

No response

@anormanhogan anormanhogan added the bug Something isn't working label Dec 3, 2021
@levbishop
Copy link
Member

Thanks for the report. In this case the warning was overzealous and we muted it with #7124
For most hardware (eg IBM platforms) rz.sx.rz is actually preferable to x.sx because rz is an instantaneous frame-update (which introduces no error) as opposed to x and sx which actually cause drive pulses to be emitted and these do introduce error.
There ongoing work to more properly handle tolerances and noise for 1-qubit gates in #7084 and once that merges we will likely re-enable a corrected version of the check that produced the warning you saw.

Closing as duplicate of #7224 but re-open if I missed something.

@levbishop levbishop added the status: duplicate This issue already exists label Dec 3, 2021
@anormanhogan
Copy link
Author

Hey! I'm following up on this since the error seems to have come back. Is there a way to mute it, as the output for long circuits greatly increases run time?

@jakelishman
Copy link
Member

Do you have a reproducer for the new error? As far as I know, nothing new should have changed in the 0.19.2 release that happened right before you wrote your comment, so it'd be good to know what's causing it. Are you using the latest version of Terra?

@jakelishman jakelishman reopened this Feb 16, 2022
@anormanhogan
Copy link
Author

anormanhogan commented Feb 17, 2022 via email

@jakelishman
Copy link
Member

Ok, in that case I think it's the same situation we were in before - Terra 0.19 should no longer be issuing those warnings, which hopefully should fix your immediate run-time issues. Please let us know if that's not the case by opening a new issue, since that would be a new bug.

What Lev said before about RZ and Z being effectively error-free on all hardware (that I can think of) still holds true - they're essentially equivalent to adding some phase offsets into the control fields, which is just a numerical trick on the classical side. In theory, the transpiler should be correct from a noise standpoint to do what it's currently doing.

I'm not certain what the status of the work on making the synthesis cleverer about noise in non-standard cases here is - #7084 seems to have stalled for the time being on performance grounds, but I don't know if there's something else in the works. For now, I'll re-close this, because we're tracking the same issue in #7033 (contains exactly the same circuit as yours) and #7042 - it's just helpful to keep stuff in fewer places.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status: duplicate This issue already exists
Projects
None yet
Development

No branches or pull requests

3 participants