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

Improve the cost estimation to run a Calibrator #1715

Closed
andreamari opened this issue Feb 15, 2023 · 8 comments · Fixed by #1863
Closed

Improve the cost estimation to run a Calibrator #1715

andreamari opened this issue Feb 15, 2023 · 8 comments · Fixed by #1863

Comments

@andreamari
Copy link
Member

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.

@andreamari andreamari added feature-request A request for a feature, tool, or workflow in Mitiq. calibration labels Feb 15, 2023
@natestemen natestemen removed the feature-request A request for a feature, tool, or workflow in Mitiq. label Feb 21, 2023
@Gopal-Dahale
Copy link

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
Copy link
Member Author

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
Copy link

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

@andreamari
Copy link
Member Author

andreamari commented May 30, 2023

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 🥇

@pandaconstantin
Copy link

Is it possible to grab this issue ?

@Misty-W
Copy link
Contributor

Misty-W commented Jun 5, 2023

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
Copy link
Member

@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
Copy link
Contributor

YuNariai commented Jun 9, 2023

Thank you Nate!

@nathanshammah nathanshammah added this to the 0.27.0 milestone Jun 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants