-
Notifications
You must be signed in to change notification settings - Fork 160
Add expectation value measurement error mitigation #500
Add expectation value measurement error mitigation #500
Conversation
…tigation * Allow non-Z diagonal expval operators. * Add function for returning mitigation overhead * Add function for returning std-dev upper bound of estimation * Add function for returning required shots for mitigation accuracy
Co-Authored-By: George S. Barron <[email protected]>
Base class functions that compute properties from A-matrix still need to be overloaded to be computed more efficiently using the rate and generator matrices.
Due to Numba not really working well with Numpy random I had to pregenerate a large array of random samples outside of the compiled Numba functions in advance.
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.
Can you add numba as an extra requirement here: https://github.com/Qiskit/qiskit-ignis/blob/master/setup.py#L79-L82 just add a new dict entry where the key is the name and the value is a list of the requirements. So in this case something like 'expval-measurement': ['numba']
it's also probably worth updating the readme section here: https://github.com/Qiskit/qiskit-ignis/blob/master/README.md#extra-requirements after you add it.
I'm trying to understand the functionality by reading the example notebook. Could you please update the notebook to work with this 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.
I'm still reviewing. I'm submitting, just to let you see the comments that I've made so far. As noted in the conversation, please prepare a usage example (in a notebook, or any other way that sheds a light on the process).
I'll try to use the tests as usage examples |
I see now the functions in |
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.
OK, I finished to review
self._noise_strengths[qubits] = gamma | ||
return self._noise_strengths[qubits] | ||
|
||
def seed(self, value=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.
Not sure that this is the correct location for this function
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 is how seeds are changed on persistent objects in the quantum info module, but i added an option to set fixed seed at init as well.
As far as I see, there are no usage examples (tests or notebook) for the diagonal other than the default. This is not tested. See also the comment about the diagonal being a numpy array instead of an operator. |
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.
Please see the comments.
In qiskit-community#500 type hints were added for the plotting functions using the optional matplotlib dependencies. This breaks ignis installations without matplotlib present since it's an optional dependency. Since type hints are really just for documentation and not necessary this commit just removes those problematic hints and uses the docstring to document the types. At the same time the testing job verifying ignis works without any optional dependencies that was lost in the migration from travis to github actions is restored to verify that everything works moving forward.
In qiskit-community#500 type hints were added for the plotting functions using the optional matplotlib dependencies. This breaks ignis installations without matplotlib present since it's an optional dependency. Since type hints are really just for documentation and not necessary this commit just removes those problematic hints and uses the docstring to document the types. At the same time the testing job verifying ignis works without any optional dependencies that was lost in the migration from travis to github actions is restored to verify that everything works moving forward. Fixes qiskit-community#532
In qiskit-community#500 type hints were added for the plotting functions using the optional matplotlib dependencies. This breaks ignis installations without matplotlib present since it's an optional dependency. Since type hints are really just for documentation and not necessary this commit just removes those problematic hints and uses the docstring to document the types. At the same time the testing job verifying ignis works without any optional dependencies that was lost in the migration from travis to github actions is restored to verify that everything works moving forward. Fixes qiskit-community#532
* Fix ignis without optional requirements installed In #500 type hints were added for the plotting functions using the optional matplotlib dependencies. This breaks ignis installations without matplotlib present since it's an optional dependency. Since type hints are really just for documentation and not necessary this commit just removes those problematic hints and uses the docstring to document the types. At the same time the testing job verifying ignis works without any optional dependencies that was lost in the migration from travis to github actions is restored to verify that everything works moving forward.
* Fix ignis without optional requirements installed In qiskit-community#500 type hints were added for the plotting functions using the optional matplotlib dependencies. This breaks ignis installations without matplotlib present since it's an optional dependency. Since type hints are really just for documentation and not necessary this commit just removes those problematic hints and uses the docstring to document the types. At the same time the testing job verifying ignis works without any optional dependencies that was lost in the migration from travis to github actions is restored to verify that everything works moving forward. (cherry picked from commit d9fe8f9)
Summary
This replaces #457 by adding expectation value measurement error mitigation using the current Ignis API style.
Co-authored-by: George S. Barron [email protected]
Details and comments
It includes Full A-matrix, tensored A-matrix, and CTMP mitigation methods.
For the CTMP method Numba will be used if it is installed to greatly improve performance.
TODO: