-
Notifications
You must be signed in to change notification settings - Fork 54
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
Gate set tomography #1106
base: master
Are you sure you want to change the base?
Gate set tomography #1106
Conversation
One qubit operator(s) gate set tomography Two qubits operator(s) gate set tomography One qubit basis operations gate set tomography Two qubit basis operations gate set tomography
for more information, see https://pre-commit.ci
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.
Thanks @mho291 for implementing this. I left some comments below, I'm not finished yet, but in general I have the feeling that many code repetitions can be avoided. I would try to write some general functions that can be applied to all the different cases you encounter here. This would make the code much easier to follow and clean.
Hi @BrunoLiegiBastonLiegi! Most of the issues you've raised have been resolved. Thanks so much for looking through the code and providing helpful comments. The code that I have in my local device has all the resolved issues implemented and it works. Perhaps we can discuss some of the outstanding issues before I do another push. Thanks a lot! |
Hi, thanks for addressing the comments, can you push your local changes such that I can give it a look please? |
for more information, see https://pre-commit.ci
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.
Thanks for the updates @mho291. I think that some improvements are possible for the GST_measure_*
functions. I still have to go over the rest but I would focus on those first.
for more information, see https://pre-commit.ci
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.
Thanks @mho291 for the updates. I made some further comments. In general I have the impression that this could be made a lot shorter by applying smarter design choices. Avoid hard coded definitions when possible, and try to write general helper functions that can be specialized for the different use cases. This would also make the code much easier to follow. Moreover, if there is a reference available for this implementation, please attach it to the first post in this PR.
Hi @mho291, can you push your latest changes so we can continue reviewing from there please? |
for more information, see https://pre-commit.ci
Just did. Sorry for the delay. I planned to push yesterday but I caught the covid bug. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1106 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 69 71 +2
Lines 10110 10202 +92
=========================================
+ Hits 10110 10202 +92
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.
Thanks. The implementation of the method seems correct. Just a few comments and suggestions to shorten the code and avoid redundancies.
for more information, see https://pre-commit.ci
Hi @BrunoLiegiBastonLiegi ! I've been trying to get the tests to run but they don't seem to run. Any idea how we can get the tests to run? Thanks! |
Yeah, there was a problem with some dependencies, often this is due to changes in the |
I see, thanks for the @BrunoLiegiBastonLiegi ! I see that the codecov is still not 100%, allow me to tidy it up. Cheers. |
Hi @BrunoLiegiBastonLiegi , the checks have passed. Could you kindly help to take a look and make necessary modifications so that we can merge soon? I'm hoping to start on the PEC as soon as possible. Thanks a lot! |
def test_GST_invertible_matrix(): | ||
T = np.array([[1, 1, 1, 1], [0, 0, 1, 0], [0, 0, 0, 1], [1, -1, 0, 0]]) | ||
matrices = GST(gate_set=[], Pauli_Liouville=True, T=T) | ||
assert True |
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.
@AlejandroSopena do you have any idea how to test a different gauge for the matrix T
? Worst case we could just exclude those lines from coverage.
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.
Thanks for the work @mho291.
As I understand it, the output of GST
is just the noisy gates and optionally the Gram matrix called empty_matrix
. But in general, GST should return the complete gate set, that is, the characterization of the gates T
and empty_matrix
) These elements depend on the matrix T
, but when used to calculate expected values of a certain observable, the dependence on T
disappears. To obtain the states and measurements, we should perform state tomopraphy and measurerement tomography, respectively and use eqs 47 and 48.
In PEC, this method is used to characterize (obtain a gate set: states, measurements, and gates) from a universal gate set, allowing ideal expected values to be decomposed as a combination of noisy expected values.
Following this scheme, I have doubts about how are you going treat the states and measurements. Are you going to consider noise-free states and measurements for PEC as proposed in the original paper Temme_EM or the more complete method proposed in Endo_EM_NISQ?
If the idea is to obtain the states and measurements through state and measurement tomography in #1097 I think it would be better to do it here to complete GST.
If you are going to consider noise-free states and measurements, for PEC it is enough to obtain only the gates through GST, but the method would not be complete. Even so, characterizing only the gates with the default matrix T
is sufficiently useful information from an experimental point of view. In this case, since this has been open for quite some time, I suppose we can merge it and open an issue. The gauge to use in PEC should be the default matrix T
, and it would not be possible to test other matrices T
until GST is completed.
One qubit calibration (empty circuit tomography)
Two qubit calibration (empty circuit tomography)
One qubit operator(s) gate set tomography
Two qubits operator(s) gate set tomography
Checklist: