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

Post-selection #82

Merged
merged 11 commits into from
Jul 10, 2023
Merged

Post-selection #82

merged 11 commits into from
Jul 10, 2023

Conversation

wakuwaku414
Copy link
Contributor

@wakuwaku414 wakuwaku414 commented Apr 28, 2023

Added a very basic post_selection() and functions that generate Sampler performs post-selection behind the scenes.

  • post_selection()
  • create_general_post_selection_sampler()
  • functions that create sampler with post-selection, specialized for JW and BK mappings
    • create_jw_electron_number_post_selection_sampler()
    • create_bk_electron_number_post_selection_sampler()
  • Filter functions specialized for JW and BK mappings
    • create_jw_electron_number_post_selection_filter_fn()
    • create_bk_electron_number_post_selection_filter_fn

The implementation provides necessary functionalities but I'm not sure if it follows the quri-parts's development policy. I would love to discuss with organizers what the implementation should be 😉

@kwkbtr
Copy link
Contributor

kwkbtr commented May 10, 2023

Thank you for your contribution! I think implementation itself looks good.

On the other hand, we are bit worried that created_jw/bk_electron_number_post_selection_sampler() have rather limited use cases, since they cannot be applied to cases where an operation not conserving electron number is applied before measurement (e.g. an H gate to measure X).
Considering that, I may suggest exposing filter_fns in those methods as public functions and removing created_jw/bk_electron_number_post_selection_sampler(), since a user can easily create such a sampler with the filter_fn and create_general_post_selection_sampler().

In addition, those filter_fn are related to Fermion-qubit mappings, so they may be placed in quri-parts-chem.

@wakuwaku414
Copy link
Contributor Author

Thanks!

On the other hand, we are bit worried that created_jw/bk_electron_number_post_selection_sampler() have rather limited use cases, since they cannot be applied to cases where an operation not conserving electron number is applied before measurement (e.g. an H gate to measure X).

I see. That makes sense.

Considering that, I may suggest exposing filter_fns in those methods as public functions and removing created_jw/bk_electron_number_post_selection_sampler(), since a user can easily create such a sampler with the filter_fn and create_general_post_selection_sampler().

Agree. Then I'll put the filter functions in quri-parts-chem 👍

Copy link
Contributor

@kwkbtr kwkbtr left a comment

Choose a reason for hiding this comment

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

Sorry for a belated review.
I added a few minor comments but overall it looks good to me.
After merging this, we would like to consider unifying similar implementation in #154.

@wakuwaku414 wakuwaku414 requested a review from kwkbtr July 10, 2023 01:24
Copy link
Contributor

@kwkbtr kwkbtr left a comment

Choose a reason for hiding this comment

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

Thank you!

@kwkbtr kwkbtr merged commit 245404d into QunaSys:main Jul 10, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jul 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants