-
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
Quantum Error Mitigation: Readout, Importance Clifford Sampling #1129
Conversation
@AlejandroSopena maybe this is for a different PR, but we should aim to integrate these Clifford-based methods (e.g. ICS, CDR) with the new Clifford backend from @BrunoLiegiBastonLiegi as much as it is possible / worth it. |
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 a lot @AlejandroSopena for all these modifications and for the big refactoring of the mitigation module.
My only doubt here is about the usage of the apply_readout_mitigation
. I agree with your choice, it lighten the code a lot and it is flexible enough to apply the desired readout mit technique, but I find it ambiguous when a mitigation method (e.g. CDR) is applied without applying readout mitigation, because still relying on apply_readout_mitigation
.
What about renaming the apply_readout_mitigation
function into something more generic like: apply_problem_configuration
? Alternatively, we can make the two things explicit in a longer but clearer name: apply_problem_with_readout_conf
.
A couple of minor comments follow.
|
||
Args: | ||
circuit (qibo.models.Circuit): input circuit. | ||
qubit_map (list): the qubit map. If ``None``, a list of range of circuit's qubits is used. Defaults to ``None``. |
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 am fine with keeping this qubit_map
for now. I We also close to the #1121, so I think we can then exploit that new feature to fix the circuit on a given topology.
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 agree. I have changed it to |
Yes, I agree @renatomello . I think we can implement this in a new PR because it only involves an improvement when running the training circuits but not the final result (although a very useful improvement). |
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 @AlejandroSopena, it looks good. I made some minor comments and in general I am not a huge fan of the two names of the functions _circuit_conf
and apply_problem_with_readout_conf
. I would probably prefer something like _execute_circuit
and _get_expectation_val_with_readout_mitigation
.
src/qibo/models/error_mitigation.py
Outdated
if "ncircuits" in readout: | ||
circuit_result, circuit_result_cal = apply_randomized_readout_mitigation( | ||
circuit, noise_model, nshots, readout["ncircuits"], backend | ||
) | ||
else: | ||
circuit_result = _circuit_conf( | ||
circuit, qubit_map, noise_model, nshots, backend=backend | ||
) | ||
|
||
if "response_matrix" in readout: | ||
circuit_result = apply_resp_mat_readout_mitigation( | ||
circuit_result, | ||
readout["response_matrix"], | ||
readout.get("ibu_iters", None), | ||
) |
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.
So, in principle one can consecutively apply randomized_readout
and resp_mat_readout
, right?
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.
No, one or the other. I have updated the code.
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!
A couple of comments and some minor suggestions follow.
Co-authored-by: Matteo Robbiati <[email protected]>
Co-authored-by: Matteo Robbiati <[email protected]>
Co-authored-by: Matteo Robbiati <[email protected]>
Co-authored-by: Matteo Robbiati <[email protected]>
General improvement of the code and docstrings.
This PR implements Iterative Bayesian Unfolding to avoid quasiprobabilities when using readout mitigation with the response matrix. It also implements the Importance Clifford Sampling method.
Checklist: