Skip to content
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

Make changes to the functions in mitiq.shadows #2129

Open
6 tasks
purva-thakre opened this issue Dec 18, 2023 · 2 comments
Open
6 tasks

Make changes to the functions in mitiq.shadows #2129

purva-thakre opened this issue Dec 18, 2023 · 2 comments
Assignees
Labels
shadows classical shadows module

Comments

@purva-thakre
Copy link
Collaborator

purva-thakre commented Dec 18, 2023

This issue will be used to keep track of all the things that could be changed, removed etc. from mitiq.shadows.

  • A function to calculate fidelity is in the utilities. But a similar function also exists in cirq.fidelity. The function is mitiq also has some lines flagged by pytest as uncovered.
    def fidelity(
  • Re-word all the function docstrings to clarify what the function is supposed to do. Right now, some of the functionalities in this module are not clear for this reason.
  • Remove random strings in the middle of a function. Are these supposed to be comments?
    r"""
    Additional information:
    Shadow stage 1: Sample random unitary form
    :math:`\mathcal{g}\subset \mathrm{U}(2^n)` and perform computational
    basis measurement. In the current state, we have implemented
    local Pauli measurement, i.e. :math:`\mathcal{g} = \mathrm{Cl}_2^n`.
    """

    """
    Additional information:
    Shadow stage 2: Estimate the expectation value of the observables OR
    reconstruct the state
    """

    """
    The following functions are used in the classical post-processing
    of calibration
    """

    """
    The following functions are used in the classical post-processing of
    classical shadows.
    """
  • If some error is raised, make sure it is mentioned exactly in the docstring as Raises: SomeError instead of as a Warning.
  • Is there some kind of check to verify classical shadow size chosen by user is appropriate for the functionality in mitiq.shadows to work as expected?
  • n_measurements_tomography_bound is only used in a tutorial in the docs. it might be better to define this function there instead of having it in mitiq/shadows/shadows_utils.py

More to be added later.

@Misty-W
Copy link
Contributor

Misty-W commented Jan 26, 2024

Partially addressed in
Refactor classical postprocessing in shadows module #2152 , but more work to be done to close this issue. Remove from 0.34.0.

@natestemen natestemen added shadows classical shadows module and removed classical-shadows labels Feb 26, 2024
@purva-thakre
Copy link
Collaborator Author

Compared to other techniques, mitiq.shadows does not follow the pattern of having a function called execute_with_shadows, shadows.mitigate_executor, and shadows.decorator.

Whenever we get to the cleanup of this module, we should consider a refactor of the above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
shadows classical shadows module
Projects
None yet
Development

No branches or pull requests

4 participants