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

create_fake_backend: tool for creating fake backend files and settings #8466

Closed
wants to merge 6 commits into from

Conversation

1ucian0
Copy link
Member

@1ucian0 1ucian0 commented Aug 6, 2022

This script creates the file for setting a new fake backend, including inserting the lines around and the release note.

python ./tools/create_fake_backend.py --hub <redacted> oslo ibm_oslo
python ./tools/update_fake_backends.py --hub <redacted> ibm_oslo

@1ucian0 1ucian0 requested a review from a team as a code owner August 6, 2022 22:31
@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

@1ucian0 1ucian0 added the mod: fake_provider Related to the fake_provider module and fake backends label Aug 6, 2022
@coveralls
Copy link

coveralls commented Aug 6, 2022

Pull Request Test Coverage Report for Build 3083784995

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 40 unchanged lines in 8 files lost coverage.
  • Overall coverage decreased (-0.006%) to 84.394%

Files with Coverage Reduction New Missed Lines %
qiskit/compiler/transpiler.py 1 89.71%
qiskit/providers/fake_provider/fake_provider.py 1 70.91%
qiskit/transpiler/passes/synthesis/unitary_synthesis.py 1 93.33%
qiskit/extensions/quantum_initializer/squ.py 2 79.78%
qiskit/utils/optionals.py 2 94.74%
qiskit/circuit/init.py 5 83.33%
qiskit/circuit/library/phase_oracle.py 5 84.85%
qiskit/visualization/circuit/_utils.py 23 93.52%
Totals Coverage Status
Change from base Build 3064945915: -0.006%
Covered Lines: 59259
Relevant Lines: 70217

💛 - Coveralls

Copy link
Collaborator

@HuangJunye HuangJunye left a comment

Choose a reason for hiding this comment

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

This is really nice and handy! I left a few comments.

In addition, I think it would be great if this script also runs the update_fake_backends.py script so just one command python ./tools/create_fake_backend.py --hub <redacted> ibm_oslo to create the files and pull the system snapshots.

Comment on lines +110 to +111
parser.add_argument("backend_name", type=str, default=None)
parser.add_argument("system_name", type=str, default=None)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we pass in only the system name as argument instead of both backend name and system name? You can stripe off the leading ibm_ or ibmq_ from system name to get the backend name
python ./tools/create_fake_backend.py --hub <...> ibm_oslo instead of
python ./tools/create_fake_backend.py --hub <...> oslo ibm_oslo

vars_ = {
"HEADER": HEADER,
"backend_name": args.backend_name,
"capital_backend_name": args.backend_name.capitalize(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think there was a discussion that we don't need to add BackendV1 fake backend any more. Ideally I would like to have FakeVigo to be a backend that has the latest backend version, FakeVigoV1 and FakeVigoV2 to have explicit backend version name in the class and FakeVigo is simply FakeVigoV2 and it will be FakeVigoV3 if there is a new backend version.

But at the moment we don't have this distinction. Fake backends without explicit version like FakeVigo are all V1 backends. So I would suggest to add V2 for all the backends that are created using this script to avoid confusion. What do you think?

@HuangJunye
Copy link
Collaborator

One last thing. Can you also add documentation of how to run the script in the same file?

@1ucian0
Copy link
Member Author

1ucian0 commented Jun 27, 2023

This probably should be in the provider, once #9553 gets addressed .

@1ucian0
Copy link
Member Author

1ucian0 commented Dec 6, 2023

With moving the IBM's fake providers to qiskit-ibm-runtime, moving this PR there Qiskit/qiskit-ibm-runtime#1263

@1ucian0 1ucian0 closed this Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mod: fake_provider Related to the fake_provider module and fake backends
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants