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

Add a CVaR notebook #51

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

a-matsuo
Copy link
Contributor

Summary

This PR adds a CVaR notebook.

Details and comments

@coveralls
Copy link

coveralls commented Jun 11, 2024

Pull Request Test Coverage Report for Build 9468776779

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 9466320186: 0.0%
Covered Lines: 290
Relevant Lines: 290

💛 - Coveralls

@miamico
Copy link
Contributor

miamico commented Jun 12, 2024

Few initial comments:

  1. Most important, this tutorial is meant to reproduce the results in https://arxiv.org/pdf/2312.00733 which show that twirling and over-sampling (by an amount determined by the sampling overhead of PEC) can give mitigated bitstrings and that if we calculate the cost with CVaR we're guaranteed to select the bitstrings with lowest expectation values. Right now the notebook is showcasing only CVaR but we want to include also the estimation of the PEC gamma (can be done using reported device data or code for layer fidelity in qiskit experiments), twirling of the circuit, over-sampling my an amount given by gamma and optimizing the circuit parameters by using CVaR as a cost function with alpha value related to gamma (1/sqrt(gamma)).
  2. Can we formulate CVaR as an observable? This would allow us to use the Estimator rather than the Sampler in the optimization of the circuit parameters. There are better error mitigation techniques available for the Estimator
  3. Switch to V2 of the Runtime Primitives
  4. This is intended to be a utility-scale tutorial. We need to increase the number of qubits to at least 40q (like in the paper)

@miamico
Copy link
Contributor

miamico commented Jun 20, 2024

From our discussion:

  • switch to runtime simulator for testing implementation
  • implement automatic estimation of gamma_circ (Mirko)
  • Use CVaR in the optimization with SamplerV2
  • Pass alpha=1/sqrt(gamma_circ) to CVaR
  • increase number of shots from shots to shots*sqrt(gamma_circ)
  • Set options in SamplerV2 to do DD, Twirling, (look into measurement mitigation). Also look at https://github.com/IBM-Quantum-Technical-Enablement/quantum-enablement/blob/krylov_utility/docs/notebooks/scaling-sampler/scaling-sampler.ipynb (may be outdatad)
    -See this notebook for utility scale QAOA with latest product tools
    • How does twirling work for Sampler?
    • Twirling options:
    • enable_gates = True
    • enable_measure= False
    • with these assumptions: num_randomizations = 50, shots = 10k
    • shotssqrt(gamma_circ) = num_randomizations * shots_per_randomization → shots_per_randomization = shotssqrt(gamma_circ) /num_randomizations = 200*sqrt(gamma_circ)
  • DD options:
    • enable =True
    • sequence_type = ‘XY4 (fallback to XpXm if it doesn’t work)

@coveralls
Copy link

coveralls commented Jun 21, 2024

Pull Request Test Coverage Report for Build 9610282477

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 9466320186: 0.0%
Covered Lines: 290
Relevant Lines: 290

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jun 25, 2024

Pull Request Test Coverage Report for Build 9668566649

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 9466320186: 0.0%
Covered Lines: 290
Relevant Lines: 290

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jun 25, 2024

Pull Request Test Coverage Report for Build 9668731722

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 9466320186: 0.0%
Covered Lines: 290
Relevant Lines: 290

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jun 25, 2024

Pull Request Test Coverage Report for Build 9668768136

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 9466320186: 0.0%
Covered Lines: 290
Relevant Lines: 290

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jul 2, 2024

Pull Request Test Coverage Report for Build 9758182744

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 9466320186: 0.0%
Covered Lines: 290
Relevant Lines: 290

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jul 3, 2024

Pull Request Test Coverage Report for Build 9771301016

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 9466320186: 0.0%
Covered Lines: 290
Relevant Lines: 290

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jul 3, 2024

Pull Request Test Coverage Report for Build 9777930590

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 9466320186: 0.0%
Covered Lines: 290
Relevant Lines: 290

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jul 8, 2024

Pull Request Test Coverage Report for Build 9853010357

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 9466320186: 0.0%
Covered Lines: 290
Relevant Lines: 290

💛 - Coveralls

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

Successfully merging this pull request may close these issues.

None yet

3 participants