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

Move AVX2 logic into Transformer class and enable SIMD on Unitary, DensityMatrix, SuperOp #961

Merged

Conversation

chriseclectic
Copy link
Member

@chriseclectic chriseclectic commented Sep 28, 2020

Summary

This moves AVX2 logic into the class where it is used and removes needing to handle checking in the controller class. This also enables AVX2 automatically for unitary, density matrix, and superoperator simulators since they inherit the applied matrix function from Qubitvector.

Details and comments

  • Removes the QubitVectorAVX2 class and moves the logic for selecting the avx2 enabled apply_matrix into the base QubitVector class.
  • SIMD will automatically be enabled in the unitary, superoperator and density matrix simulators since they call the qubitvector apply_matrix function.
  • SIMD will also be used in gate fusion and noise model conversion since it they use the unitary and superoperator state classes.

@chriseclectic chriseclectic added Changelog: New Feature Include in the Added section of the changelog performance Performance improvements labels Sep 28, 2020
@chriseclectic chriseclectic added this to the Aer 0.7 milestone Sep 28, 2020
@chriseclectic chriseclectic force-pushed the refactor/qubitvector-avx2 branch 3 times, most recently from 537556f to 03f9465 Compare September 29, 2020 22:41
@chriseclectic chriseclectic changed the title Move AVX2 logic into QubitVector class and enable SIMD on Unitary, DensityMatrix, SuperOp Move AVX2 logic into Transformer class and enable SIMD on Unitary, DensityMatrix, SuperOp Sep 29, 2020
chriseclectic and others added 7 commits September 30, 2020 15:28
This moves AVX2 logic into the class where it is used and removes needing to handle checking in the controller class. This also enables AVX2 automatically for unitary, density matrix, and superoperator simualtors since they inhert the applied matrix function from Qubitvector.
This adds back in similar structure to the previous QubitvectorAvx2 but in a separate class so it doesn't need to instantiated in other parts of the simulator code outside qubitvector.
…y_diagonal_matrix

Updates indexes to only use omp parallel if threads > 1, not > 0.
It seems we were applying the special case for 1 qubit for some cases where we have more than 1 qubit.
Copy link
Contributor

@vvilpas vvilpas left a comment

Choose a reason for hiding this comment

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

LGTM

@chriseclectic chriseclectic merged commit 77e40c8 into Qiskit:master Oct 2, 2020
@vvilpas vvilpas mentioned this pull request Nov 26, 2020
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the Added section of the changelog performance Performance improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants