-
Notifications
You must be signed in to change notification settings - Fork 57
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
Use single gates.py file for all backends #372
Conversation
Codecov Report
@@ Coverage Diff @@
## tfmem #372 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 78 77 -1
Lines 12724 12426 -298
==========================================
- Hits 12724 12426 -298
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
def __init__(self): | ||
super().__init__() | ||
self.gates = tuple() | ||
# create inversion gates to rest to the original state vector |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest -> restore/reset?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stavros11 thanks for this cleanup, the code is much simpler to follow.
This simplifies our code base by removing the
cgates.py
file and using a single file to implement gates for all different backends. To do so, I moved the functions that apply gates (state_vector_call
anddensity_matrix_call
) to the backends. As discussed in #363 I also removed theprepare
andreprepare
methods from gates as they are not needed anymore.I tested the multi-GPU performance of this branch and it is the same as master so there is no fix required for that regard. The memory and performance for very deep circuits is also the same with what reported in #363.