-
Notifications
You must be signed in to change notification settings - Fork 55
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 raw property to Unitary gate serialization #1277
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1277 +/- ##
===========================================
- Coverage 100.00% 99.92% -0.08%
===========================================
Files 71 71
Lines 10443 10453 +10
===========================================
+ Hits 10443 10445 +2
- Misses 0 8 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
It seems you need this for RB protocol(s). Wouldn't it be easier to dump the Clifford gates directly? Then this wouldn't be needed. |
Right now, they calculated the inverse gate as: circuit.add(gates.Unitary(circuit.unitary(), *range(circuit.nqubits)).dagger()) to only dump clifford gates I suppose we should sample also build the circuit with cliffords instead of U3s and calculate the inverse as a clifford as well. Then they will get to be U3s later so we can convert them to pulses but that wouldn't matter for the dumping I guess. |
You could use
If you need an |
Actually, I would agree with @renatomello concerning the RB, since it is definitely better to use the most efficient representation. But this PR could be useful in any case: if Qibo allows defining arbitrary unitary gates, we should also be able to serialize them. Is anything missing from this PR? (other than testing) @Jacfomg |
I understand the consistency argument. However, dumping a matrix to a |
Well, we can dump it as bytes with It is true in general that it is better to avoid serializing a whole matrix, but if you have no other choice, that's just your best option. |
I will take a look for coding the RB with the |
If the agreement is this one, I will not close it. Yes, it is lacking testing if we want to merge it. |
After talking with Ingo, he explained that using this function would not generate things as he wants so I will not use for RB related stuff. |
In which way the serialization is connected to what is good for the RB? I agree with @renatomello that using |
It was not about serialization but about using the |
Ok, this is perfectly acceptable :) |
To save the circuits from RB qiboteam/qibocal#735 with the inverse gate we would need to serialize the unitary gate as well.
Checklist: