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

Bugfix: missing extra in mitigated tomography analysis #1344

Merged

Conversation

nkanazawa1989
Copy link
Collaborator

@nkanazawa1989 nkanazawa1989 commented Dec 14, 2023

Summary

#1133 introduce a bug in MitigatedTomographyAnalysis that accidentally drops extra analysis metadata. This PR fixes the bug.

Details and comments

In the new data storage implementation with dataframe, ExperimentData.analysis_results returns a copy of the protected dataframe and mutating the returned object doesn't update the source. This PR introduces new option to TomographyAnalysis to inject extra metadata.

screenshot

(edit) note that reno is not necessary because 1133 is not released yet.

Copy link
Collaborator

@coruscating coruscating left a comment

Choose a reason for hiding this comment

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

Thanks, this looks good. What do you think about adding a note to the ExperimentData.analysis_results() docstring that the returned object should not be directly mutated?

@nkanazawa1989
Copy link
Collaborator Author

Thanks, updated in 82b4424

Copy link
Collaborator

@coruscating coruscating left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@coruscating coruscating added this pull request to the merge queue Jan 10, 2024
Merged via the queue into qiskit-community:main with commit 2571675 Jan 10, 2024
nkanazawa1989 added a commit to nkanazawa1989/qiskit-experiments that referenced this pull request Jan 17, 2024
…ity#1344)

### Summary

qiskit-community#1133 introduce a bug in `MitigatedTomographyAnalysis` that accidentally
drops extra analysis metadata. This PR fixes the bug.

### Details and comments

In the new data storage implementation with dataframe,
`ExperimentData.analysis_results` returns a copy of the protected
dataframe and mutating the returned object doesn't update the source.
This PR introduces new option to `TomographyAnalysis` to inject extra
metadata.

<img width="993" alt="screenshot"
src="https://github.com/Qiskit-Extensions/qiskit-experiments/assets/39517270/d8674af1-78ad-4870-bfea-d441f9dfd1e8">

(edit) note that reno is not necessary because 1133 is not released yet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants