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 missing delay instruction to fake backends #8003

Merged
merged 7 commits into from
May 3, 2022

Conversation

mtreinish
Copy link
Member

Summary

This commit adds the delay instruction to the target for fake backends
based on BackendV2. With BackendV2 and the Target delay isn't assumed to
be present on every backend and it has to be explictly listed. This
commit fixes this so that the compiler is aware that delay is a valid
operation (without any additional constraints) on the BackendV2 based
fake backends.

Details and comments

This commit adds the delay instruction to the target for fake backends
based on BackendV2. With BackendV2 and the Target delay isn't assumed to
be present on every backend and it has to be explictly listed. This
commit fixes this so that the compiler is aware that delay is a valid
operation (without any additional constraints) on the BackendV2 based
fake backends.
@mtreinish mtreinish requested review from a team and jyu00 as code owners April 29, 2022 21:59
@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

kevinhartman
kevinhartman previously approved these changes Apr 29, 2022
Copy link
Contributor

@kevinhartman kevinhartman left a comment

Choose a reason for hiding this comment

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

LGTM

@HuangJunye HuangJunye added the mod: fake_provider Related to the fake_provider module and fake backends label May 2, 2022
HuangJunye
HuangJunye previously approved these changes May 2, 2022
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.

Looks good to me too!

If any instructions available in a target are ideal, with no qubits or
properties set, the target class assumes the backend is ideal (like in
the case of an ideal simulator where are all instructions are globally
defined and have no error or duration). To avoid this we need to define
the Delay instruction on all qubits explicitly. This commit makes this
change to ensure the target for backends still shows the qubits and
properties for the other operations. However, in adding an instruction
with no properties defined a bug in the plot gate error map function was
uncovered where it errored because it assumes all instructions have
properties defined, this was fixed at the same time.
@coveralls
Copy link

coveralls commented May 2, 2022

Pull Request Test Coverage Report for Build 2266493094

  • 4 of 4 (100.0%) changed or added relevant lines in 2 files are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.004%) to 84.349%

Files with Coverage Reduction New Missed Lines %
qiskit/pulse/library/waveform.py 3 89.36%
Totals Coverage Status
Change from base Build 2265424571: -0.004%
Covered Lines: 54467
Relevant Lines: 64573

💛 - Coveralls

jakelishman
jakelishman previously approved these changes May 3, 2022
Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

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

Is this a bug in 0.20 that needs a release note, or are we good without it?

@mtreinish
Copy link
Member Author

It is arguably a bug in 0.20.0, I was on the fence on whether to backport it or not. I'll add a release note to document it though, that was an oversight.

jakelishman
jakelishman previously approved these changes May 3, 2022
@mtreinish mtreinish added the Changelog: Bugfix Include in the "Fixed" section of the changelog label May 3, 2022
Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

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

Oh yeah, I always forget that pulse defines a bunch of objects with the same names as things in circuit.

ElePT pushed a commit to ElePT/qiskit-ibm-provider that referenced this pull request Oct 9, 2023
* Add missing delay instruction to fake backends

This commit adds the delay instruction to the target for fake backends
based on BackendV2. With BackendV2 and the Target delay isn't assumed to
be present on every backend and it has to be explictly listed. This
commit fixes this so that the compiler is aware that delay is a valid
operation (without any additional constraints) on the BackendV2 based
fake backends.

* Add qubits to Delay target entry

If any instructions available in a target are ideal, with no qubits or
properties set, the target class assumes the backend is ideal (like in
the case of an ideal simulator where are all instructions are globally
defined and have no error or duration). To avoid this we need to define
the Delay instruction on all qubits explicitly. This commit makes this
change to ensure the target for backends still shows the qubits and
properties for the other operations. However, in adding an instruction
with no properties defined a bug in the plot gate error map function was
uncovered where it errored because it assumes all instructions have
properties defined, this was fixed at the same time.

* Add release note

* Update releasenotes/notes/delay-fake-backends-3f68c074e85d531f.yaml

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Bugfix Include in the "Fixed" section of the changelog 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.

6 participants