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

Parallelize sampling measure #2049

Merged
merged 10 commits into from
Mar 19, 2024
Merged

Parallelize sampling measure #2049

merged 10 commits into from
Mar 19, 2024

Conversation

doichanj
Copy link
Collaborator

@doichanj doichanj commented Feb 5, 2024

Summary

This PR optimizes performance of sampling measure #2021 by

  • decreasing size of array for counts
  • parallelizing loops by OpenMP

Details and comments

This PR adds new basic class BitVector to store bit counts obtained by sampling measure.
Bits counts were stored as array of 64-bits integer previously that wastes large memory space and memory bandwidth.
BitVector has a variable length bit string that requires fewer memory.
(BitVector can be used for stabilizer method, but not included in this PR)

There were some loops not parallelized before:

  • conversion to integer index to bit count
  • saving counts in results

are now parallelized by OpenMP.

image

@doichanj doichanj added enhancement New feature or request performance Performance improvements labels Feb 5, 2024
@doichanj doichanj added this to the Aer 0.14.0 milestone Feb 5, 2024
@doichanj doichanj requested a review from hhorii February 5, 2024 05:11
hhorii
hhorii previously approved these changes Feb 20, 2024
Copy link
Collaborator

@hhorii hhorii left a comment

Choose a reason for hiding this comment

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

LGTM. BitVector looks very reasonable than reg_t, indeed.

@hhorii
Copy link
Collaborator

hhorii commented Feb 21, 2024

Just FYI. The reason why reg_t is used is Aer may support higher level than qubit, such as qutrit.

@doichanj doichanj mentioned this pull request Mar 18, 2024
Copy link
Collaborator

@hhorii hhorii left a comment

Choose a reason for hiding this comment

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

LGTM

@hhorii hhorii merged commit cb3a4ff into main Mar 19, 2024
37 checks passed
@doichanj doichanj deleted the parallelize_sampling branch April 2, 2024 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request performance Performance improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants