unitaryfund / mitiq

Mitiq is an open source toolkit for implementing error mitigation techniques on most current intermediate-scale quantum computers.
https://mitiq.readthedocs.io
GNU General Public License v3.0
363 stars 160 forks source link

Skip operations without known representations by default in PEC #519

Closed rmlarose closed 3 years ago

rmlarose commented 3 years ago

If there is an operation without a known representation, the current behavior is to throw an error when sampling and PEC will not run. I think by default we should skip such operations and only sample from the pool of provided representations. Perhaps we could add a flag for the current behavior, e.g. error_on_missing_representation.

From @andreamari in https://github.com/unitaryfund/mitiq/issues/504#issuecomment-769220204

Having this feature as default or as optional would be indeed very useful. E.g if I don't want to mitigate single-qubit gates I simply don't represent them and Mitiq will just apply single-qubit gates without sampling. With the current setup, for each single-qubit gate, we would need to define a trivial OperaitonRepresentation with only one term in the basis expansion.

purva-thakre commented 3 years ago

This could be useful for Pauli twirling as well since it depends on being able to change the basis of error operators to Paul basis. I am working on a MEP document for twirling (#513). There's a proposed function which will check if the error representation is known or not, if it is known then the twirling process can proceed or end the process with an error message.

Perhaps I could define this function in general instead of being specific to twirling. Such a function could also be used for other methods dependent on known error representation.

github-actions[bot] commented 3 years ago

This issue had no activity for 2 months, and will be closed in one week unless there is new activity. Cheers!