-
Notifications
You must be signed in to change notification settings - Fork 61
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
Add qibojit backend #427
Add qibojit backend #427
Conversation
Codecov Report
@@ Coverage Diff @@
## master #427 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 83 83
Lines 11827 11866 +39
=========================================
+ Hits 11827 11866 +39
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
def _result_tensor(self, result): | ||
n = len(result) | ||
result = sum(2 ** (n - i - 1) * r for i, r in enumerate(result)) | ||
return self.cast(result, dtype="DTYPEINT") |
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.
Does this operation is strictly necessary?
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.
I think yes, because the custom operators for collapse expect the result to be integer (in decimal form) while the other backends use the array form which represents the same number in binary. Note that this is a new addition here, we already do exactly the same conversion inside core.gates.M
(see here in master). I just moved the conversion at the backend level in this PR because it is slightly different for qibojit and qibotf so it is easier to implement this way.
There may be a way to avoid this conversion by using decimal as the default representation for result
and convert to binary when using the numpy/tensorflow backends.
disabling parallel evaluation on darwin
adding qibojit to CI
Make qibojit default backend and update warnings
Adds new backend that loads custom operators from the qibojit library. The new backend is not tested in CI until the qibojit library is released.