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

plot_error_map fails #7879

Closed
nonhermitian opened this issue Apr 4, 2022 · 2 comments · Fixed by #7880
Closed

plot_error_map fails #7879

nonhermitian opened this issue Apr 4, 2022 · 2 comments · Fixed by #7880
Labels
bug Something isn't working stable backport potential The bug might be minimal and/or import enough to be port to stable
Milestone

Comments

@nonhermitian
Copy link
Contributor

Environment

  • Qiskit Terra version: 0.20
  • Python version: 3.10
  • Operating system:
backend = provider.backend.ibmq_kolkata
plot_error_map(backend)

gives

ValueError: shape mismatch: objects cannot be broadcast to a single shape

What is happening?

fails for some reason in the measurement bar plots

How can we reproduce the issue?

run above

What should happen?

works

Any suggestions?

No response

@nonhermitian nonhermitian added the bug Something isn't working label Apr 4, 2022
@mtreinish
Copy link
Member

Yeah, it looks like a bug I inadvertently added in #7814 (there are also bugs with the V2 path too). I'll prep a fix and tag it for 0.20.1.

@mtreinish mtreinish added this to the 0.20.1 milestone Apr 4, 2022
@mtreinish mtreinish added the stable backport potential The bug might be minimal and/or import enough to be port to stable label Apr 4, 2022
mtreinish added a commit to mtreinish/qiskit-core that referenced this issue Apr 4, 2022
In Qiskit#7814 we updated the plot_error_map() error to be more general and
also work with BackendV2 instead of assuming it's a BaseBackend or
BackendV1 backend. However, as part of that refactor 2 errors were
accidently introduced preventing the function from being used. First in
the BackendV2 path we were incorrectly handling the backend name to use
for the plot title. Secondly, in the BaseBackend/BackendV1 path the
readout error array loop was incorrectly constructed resulting in the
array being larger than expected causing an error. This commit fixes
both conditions so that we can correctly plot the result.

Fixes Qiskit#7879
@mtreinish
Copy link
Member

#7879 should fix this, the error was pretty obvious with fresh eyes (#7814 was doing append() when it should have been err_arr[i] = err)

@mergify mergify bot closed this as completed in #7880 Apr 4, 2022
mergify bot pushed a commit that referenced this issue Apr 4, 2022
* Fix plot_error_map

In #7814 we updated the plot_error_map() error to be more general and
also work with BackendV2 instead of assuming it's a BaseBackend or
BackendV1 backend. However, as part of that refactor 2 errors were
accidently introduced preventing the function from being used. First in
the BackendV2 path we were incorrectly handling the backend name to use
for the plot title. Secondly, in the BaseBackend/BackendV1 path the
readout error array loop was incorrectly constructed resulting in the
array being larger than expected causing an error. This commit fixes
both conditions so that we can correctly plot the result.

Fixes #7879

* Add tests for plot_error_map

This commit adds test coverage for plot_error_map. The reason the issues
around this function slipped in was a complete lack of test coverage.
This adds some basic tests with both the BackendV1 and BackendV2 test
paths to ensure we have some coverage for the function.

* Add release note
mergify bot pushed a commit that referenced this issue Apr 4, 2022
* Fix plot_error_map

In #7814 we updated the plot_error_map() error to be more general and
also work with BackendV2 instead of assuming it's a BaseBackend or
BackendV1 backend. However, as part of that refactor 2 errors were
accidently introduced preventing the function from being used. First in
the BackendV2 path we were incorrectly handling the backend name to use
for the plot title. Secondly, in the BaseBackend/BackendV1 path the
readout error array loop was incorrectly constructed resulting in the
array being larger than expected causing an error. This commit fixes
both conditions so that we can correctly plot the result.

Fixes #7879

* Add tests for plot_error_map

This commit adds test coverage for plot_error_map. The reason the issues
around this function slipped in was a complete lack of test coverage.
This adds some basic tests with both the BackendV1 and BackendV2 test
paths to ensure we have some coverage for the function.

* Add release note

(cherry picked from commit d430e4d)
mergify bot added a commit that referenced this issue Apr 4, 2022
…7887)

* Fix plot_error_map

In #7814 we updated the plot_error_map() error to be more general and
also work with BackendV2 instead of assuming it's a BaseBackend or
BackendV1 backend. However, as part of that refactor 2 errors were
accidently introduced preventing the function from being used. First in
the BackendV2 path we were incorrectly handling the backend name to use
for the plot title. Secondly, in the BaseBackend/BackendV1 path the
readout error array loop was incorrectly constructed resulting in the
array being larger than expected causing an error. This commit fixes
both conditions so that we can correctly plot the result.

Fixes #7879

* Add tests for plot_error_map

This commit adds test coverage for plot_error_map. The reason the issues
around this function slipped in was a complete lack of test coverage.
This adds some basic tests with both the BackendV1 and BackendV2 test
paths to ensure we have some coverage for the function.

* Add release note

(cherry picked from commit d430e4d)

Co-authored-by: Matthew Treinish <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants