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

Add qubit count and basis gate checks to fake_backend #10961

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

JustinWoodring
Copy link
Contributor

@JustinWoodring JustinWoodring commented Oct 3, 2023

Fixes #8509

  • I have added the tests to cover my changes.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.

Summary

This PR adds sanity checks to the fake_backend provider to ensure that it does not run tasks using a greater than supported qubit count or unsupported basis gate for a given provider e.g. FakeLima()

…e gates and qubit count required by a mimicked machine e.g. FakeLima()
@JustinWoodring JustinWoodring requested review from jyu00 and a team as code owners October 3, 2023 22:20
@qiskit-bot qiskit-bot added the Community PR PRs from contributors that are not 'members' of the Qiskit repo label Oct 3, 2023
@qiskit-bot
Copy link
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the the following people are requested to review this:

  • @Qiskit/terra-core

@CLAassistant
Copy link

CLAassistant commented Oct 3, 2023

CLA assistant check
All committers have signed the CLA.

@JustinWoodring
Copy link
Contributor Author

@AngeloDanducci tagging you so this issue doesn't slip through the cracks again 😄.

Copy link
Contributor

@ElePT ElePT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @JustinWoodring, thanks for catching this behavior :). I agree that fake backends should be respect the num_qubits and basis_gates specified in their description. However, I wonder if we could find a more efficient way to implement this. Iterating over all of the circuits and all of the instructions within the circuits can be costly, and hinder the performance of the fake backends. I think that we should be able to set these options directly at the simulator level, it might be worth giving it a try.

I also wanted to give you some context about the fake provider module: we are currently working on migrating the IBM-specific fake backends out of the main qiskit repo, as explained in #9553. Until the migration is finalized, we will not focus on merging new fixes to these classes. Once it is complete, we'll likely transfer all relevant issues and PRs to the new location of the module (including this one), which is now planned to be https://github.com/Qiskit/qiskit-ibm-runtime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community PR PRs from contributors that are not 'members' of the Qiskit repo
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

Fake backends ignore errors related to basis gates or number of qubits
4 participants