mitiq
mitiq copied to clipboard
Make changes to the functions in `mitiq.shadows`
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 incirq.fidelity
. The function is mitiq also has some lines flagged by pytest as uncovered. https://github.com/unitaryfund/mitiq/blob/05be477d2453ce647a32a4df7170426c5ca0b83f/mitiq/shadows/shadows_utils.py#L140 - [ ] 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? https://github.com/unitaryfund/mitiq/blob/05be477d2453ce647a32a4df7170426c5ca0b83f/mitiq/shadows/shadows.py#L138-L144 https://github.com/unitaryfund/mitiq/blob/05be477d2453ce647a32a4df7170426c5ca0b83f/mitiq/shadows/shadows.py#L191-L195 https://github.com/unitaryfund/mitiq/blob/05be477d2453ce647a32a4df7170426c5ca0b83f/mitiq/shadows/classical_postprocessing.py#L45-L48 https://github.com/unitaryfund/mitiq/blob/05be477d2453ce647a32a4df7170426c5ca0b83f/mitiq/shadows/classical_postprocessing.py#L176-L179
- [ ] If some error is raised, make sure it is mentioned exactly in the docstring as
Raises: SomeError
instead of as aWarning
. - [ ] Is there some kind of check to verify
classical shadow size
chosen by user is appropriate for the functionality inmitiq.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 inmitiq/shadows/shadows_utils.py
More to be added later.
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.
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.