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

Prob with shots-noise #568

Merged
merged 123 commits into from
Dec 4, 2023
Merged

Prob with shots-noise #568

merged 123 commits into from
Dec 4, 2023

Conversation

multiphaseCFD
Copy link
Member

@multiphaseCFD multiphaseCFD commented Nov 28, 2023

Before submitting

Please complete the following checklist when submitting a PR:

  • All new features must include a unit test.
    If you've fixed a bug or added code that should be tested, add a test to the
    tests directory!

  • All new functions and code must be clearly commented and documented.
    If you do make documentation changes, make sure that the docs build and
    render correctly by running make docs.

  • Ensure that the test suite passes, by running make test.

  • Add a new entry to the .github/CHANGELOG.md file, summarizing the
    change, and including a link back to the PR.

  • Ensure that code is properly formatted by running make format.

When all the above are checked, delete everything above the dashed
line and fill in the pull request template.


Context:

Add shots-noise to prob() in the C++ layer.

Description of the Change:

prob(Observable<StateVectorT> &obs, size_t number_shots), prob(size_t number_shots) and prob(const std::vector<size_t> wires, size_t number_shots) were added for the probabilities of a full system and sub-system.

Benefits:

Possible Drawbacks:

Related GitHub Issues:

@multiphaseCFD multiphaseCFD requested a review from a team December 1, 2023 14:43
Copy link
Member

@maliasadi maliasadi left a comment

Choose a reason for hiding this comment

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

Thanks @multiphaseCFD! 💯 Looking forward to see this support in Catalyst :)

Copy link
Contributor

@AmintorDusko AmintorDusko left a comment

Choose a reason for hiding this comment

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

I have just a super small suggestion. Happy to approve!

Copy link
Contributor

@dime10 dime10 left a comment

Choose a reason for hiding this comment

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

Thanks @multiphaseCFD, looks great 💯 The only thing I'm wondering, shouldn't there be a function with an observable and shot argument?

@multiphaseCFD
Copy link
Member Author

Thanks @multiphaseCFD, looks great 💯 The only thing I'm wondering, shouldn't there be a function with an observable and shot argument?

Thanks @dime10 ! probs(obs, num_shots) added.

Copy link
Contributor

@dime10 dime10 left a comment

Choose a reason for hiding this comment

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

Looks great 💯

The only thing that I find a bit confusing is the large amount of variations that exist for different measurement processes, and that don't always seem consistent or consistently available. For example, expval and var provide separate functions for:

  • mp(obs)
  • mp(obs, shots)

But probs combines them into one:

  • mp(obs, shots=0)

And that's on top of other variations like probs()/probs(shots), and probs(wires)/probs(wires, shots), where they are separate as well 😅

But it's not a blocker :)

.github/CHANGELOG.md Outdated Show resolved Hide resolved
@multiphaseCFD
Copy link
Member Author

multiphaseCFD commented Dec 4, 2023

Looks great 💯

The only thing that I find a bit confusing is the large amount of variations that exist for different measurement processes, and that don't always seem consistent or consistently available. For example, expval and var provide separate functions for:

  • mp(obs)
  • mp(obs, shots)

But probs combines them into one:

  • mp(obs, shots=0)

And that's on top of other variations like probs()/probs(shots), and probs(wires)/probs(wires, shots), where they are separate as well 😅

But it's not a blocker :)

Thanks @dime10 ! The reason why mps except for probs accept (obs) and (obs, shots) is that I don't want to refactor our previous analytic implementations of other mps. 😅

@multiphaseCFD multiphaseCFD merged commit fc84399 into master Dec 4, 2023
77 checks passed
@multiphaseCFD multiphaseCFD deleted the prob_shots branch December 4, 2023 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:use-multi-gpu-runner Enable usage of Multi-GPU runner for this Pull Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants