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

Fix type of basis_gates in BasicSimulator configuration (backport #13385) #13386

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Oct 31, 2024

basis_gates was getting set to Target.operation_names, which is a dict_keys instance (maybe that should be changed to a more basic type?), while typically basis_gates is a list. dict_keys instances can not be deep copied, so code that usually deep copies a backend's configuration could not work. Deep copying the configuration can happen for example when using the BasicSimulator with sampler class like qiskit_ibm_runtime.SamplerV2 that puts the backend into its options and then tries to deep copy the options.


This is an automatic backport of pull request #13385 done by Mergify.

`basis_gates` was getting set to `Target.operation_names`, which is a
`dict_keys` instance (maybe that should be changed to a more basic
type?), while typically `basis_gates` is a list. `dict_keys` instances
can not be deep copied, so code that usually deep copies a backend's
configuration could not work. Deep copying the configuration can happen
for example when using the `BasicSimulator` with sampler class like
`qiskit_ibm_runtime.SamplerV2` that puts the backend into its options
and then tries to deep copy the options.

(cherry picked from commit 09d1006)
@mergify mergify bot requested review from jyu00 and a team as code owners October 31, 2024 17:29
@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 following people are relevant to this code:

  • @Qiskit/terra-core

@github-actions github-actions bot added Changelog: Bugfix Include in the "Fixed" section of the changelog mod: fake_provider Related to the fake_provider module and fake backends labels Oct 31, 2024
@github-actions github-actions bot added this to the 1.2.5 milestone Oct 31, 2024
@jakelishman jakelishman enabled auto-merge October 31, 2024 17:39
@coveralls
Copy link

Pull Request Test Coverage Report for Build 11616880125

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 3 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.03%) to 89.765%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 3 93.48%
Totals Coverage Status
Change from base Build 11584485967: 0.03%
Covered Lines: 66899
Relevant Lines: 74527

💛 - Coveralls

@jakelishman jakelishman added this pull request to the merge queue Oct 31, 2024
Merged via the queue into stable/1.2 with commit 1c684f2 Oct 31, 2024
19 checks passed
@jakelishman jakelishman modified the milestones: 1.2.5, 1.3.0 Nov 15, 2024
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.

4 participants