Skip to content

Add missing delay instruction to fake backends#8003

Merged
mergify[bot] merged 7 commits into
Qiskit:mainfrom
mtreinish:add-target-v2-fake-backend
May 3, 2022
Merged

Add missing delay instruction to fake backends#8003
mergify[bot] merged 7 commits into
Qiskit:mainfrom
mtreinish:add-target-v2-fake-backend

Conversation

@mtreinish
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 previously approved these changes May 2, 2022
Copy link
Copy Markdown
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!

mtreinish added 2 commits May 2, 2022 08:05
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
Copy Markdown

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

Comment thread qiskit/test/mock/utils/backend_converter.py
jakelishman
jakelishman previously approved these changes May 3, 2022
Copy link
Copy Markdown
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
Copy Markdown
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: Fixed Add a "Fixed" entry in the GitHub Release changelog. label May 3, 2022
Comment thread releasenotes/notes/delay-fake-backends-3f68c074e85d531f.yaml
Copy link
Copy Markdown
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: Fixed Add a "Fixed" entry in the GitHub Release changelog.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants