Skip to content

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented May 11, 2023

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


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

### Summary

This commit updates the Qiskit marginalization function used in
qiskit-experiments. Qiskit has 2 different function available for
marginalizing counts: `marginal_counts()` [1] which is designed to work
with `Counts` or `Result` objects and does **not** respect ordering of
the indices passed in. The other is `marginal_distribution()` [2] which
is designed to work with `Counts`, `Probabilities`,
`QuasiProbabilities`, or a dictionary with string keys and integer or
float values that respects the order of the indices passed in (so it can
be used to permute the bits). In general if you're not working with a
`Result` object it is better to use `marginal_distribution()` because it
is written primarily in Rust and 10-100x faster than
`marginal_counts()`.

### Details and comments

[1]
https://qiskit.org/documentation/stubs/qiskit.result.marginal_counts.html
[2]
https://qiskit.org/documentation/stubs/qiskit.result.marginal_distribution.html

(cherry picked from commit 10b6182)
@coruscating coruscating merged commit 66d9041 into stable/0.5 May 11, 2023
@mergify mergify bot deleted the mergify/bp/stable/0.5/pr-1144 branch May 11, 2023 14:55
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