-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add ability to get counts from statevectors and density matrices #3514
Conversation
Can we make this work for density matrices as well? I think a convenient function to obtain counts from states is nice, but also we need some way of getting probability of any observable, not just computational basis. @chriseclectic mentioned something along these lines exists for statevector but I couldn't really find it. Can you paste some code examples here @chriseclectic ? |
Now works for density matrix objects as well. |
…kit#3514) * add state to counts * add to result and tests * style * cleanup * add DM version and tests * lint
Summary
Adds the ability to get counts from statevectors. The counts are the numerically exact probabilities that one would expect to come from a given statevector. This is very useful in comparing theoretical bitstring output distributions verses those actually obtained in the experiment or noisy simulations.
Related to #3510
Details and comments