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 159 forks source link

Improve the cost estimation to run a Calibrator #1715

Closed andreamari closed 1 year ago

andreamari commented 1 year ago

Issue Description

The Calibrator class as a get_cost() method to estimate the number of circuit executions that are necessary to get all the required data.

At the moment, the estimate is not correct since it doesn't take into account that each Strategy requires the execution of multiple circuits for a single error-mitigated expectation value (e.g. ZNE requires k circuits where k is the number of noise scale factors, PEC requires num_samples circuits, etc.. ).

This issue is about getting a more faithful estimate of the actual cost.

Proposed Solution

Maybe each Strategy object could have a num_circuits_required() method, such that one can simply scale the result in get_cost() by that number.

Other ideas are welcome.

Gopal-Dahale commented 1 year ago

Hi @andreamari, the current model multiplies the number of circuits by the number of strategies. However, this model does not consider other factors that can affect the cost of calibration, such as the number of samples required for each error-mitigated expectation value, the number of noise scale factors etc. A more sophisticated model could consider these factors and provide a more accurate estimate of the cost.

As you suggested we can have that num_circuits_required method in each of the strategy objects or we can infer it from the existing attributes (technique, scale_noise and factory).

andreamari commented 1 year ago

Yes, indeed this issue asks for a better counting of the number of circuits, such that the get_cost() method would give a more accurate information.

Gopal-Dahale commented 1 year ago

I would like to contribute to this issue. May you assign it to me?

andreamari commented 1 year ago

This is an issue selected for unitaryhack.dev. As a temporary rule for this event, we decided not to assign the issues to contributors until the associated PRs are approved and merged. This is to avoid the risk of stale assigments and stale PRs.

You are welcome to open a PR without an assignment. In that case we suggest linking your PR to this issue. If it will be successfully merged, you'll get the unitaryhack bounty :1st_place_medal:

pandaconstantin commented 1 year ago

Is it possible to grab this issue ?

Misty-W commented 1 year ago

Is it possible to grab this issue ?

@pandaconstantin it's still possible, but there is a PR already open to solve this issue, and it will likely be approved soon. There are still plenty of open bouties for unitaryHACK though.

natestemen commented 1 year ago

@YuNariai congrats on completing this issue as part of unitaryHACK! If you comment on it, I'll be able to assign you to ensure you are awarded the bounty.

YuNariai commented 1 year ago

Thank you Nate!