-
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
Backend-agnostic matrix definitions #1217
Conversation
@renatomello self.np.conj(self.CSX) Now i changed to: a = (1 - 1j) / 2
b = self.np.conj(a)
return self._cast(
[
[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, a, b],
[0, 0, b, a],
],
dtype=self.dtype,
) It should be the same thing as CSX is defined the same way but with a=(1+1j)/2 |
Which error though |
Assertion error in test_csxdg and test_dagger (the tests that failed also on github) |
It's only failing for @cached_property
def CSXDG(self):
return self.SXDG I have not tested locally but I'd imagine this would fix it. |
@renatomello do you have any idea why this is the case? I understand this PR is changing the calculations of some matrices a bit, but the returned values should remain the same. I don't see how this would break qibojit. Unless this was an existing issue that came up now for some reason. |
I didn't dig much deeper, but I checked and |
I have opened the PR in qibojit |
@renatomello @stavros11 by adding the CSXDG gate in qibojit the tests fail only on linux... |
for more information, see https://pre-commit.ci
it's because only linux is testing |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1217 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 70 70
Lines 10379 10381 +2
=========================================
+ Hits 10379 10381 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
This looks good to advance #1202, but it needs to be merged with qiboteam/qibojit#168.
It'd be also interesting to test at least locally if this is really enough for pytorch
to work.
Now that the qibojit branch "add CSXDG" has been merged this PR is ready to be merged (after one missing review) |
Store a backend agnostic matrix definition tht can be casted with a specific _cast function in the proper backend.
Necessary for PR #1202
Checklist: