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

v0.3 API + debiasing #6077

Merged
merged 30 commits into from
Aug 30, 2023

Conversation

splch
Copy link
Contributor

@splch splch commented Apr 24, 2023

This new version of the API separates job status and metadata from actual results into two different endpoints.

v0.3 also includes support for error_mitigation settings like symmetrization as described in https://arxiv.org/pdf/2301.07233.pdf

This includes:

  • add a new error_mitigation parameter on job submission so users can configure it
  • add a new aggregation parameter on results that would allow getting results aggregated under the two different methods described in the paper. Averaging and Plurality voting

continues #6007

gmauricio and others added 4 commits February 16, 2023 20:33
This new version of the API separates job status and metadata from actual results into two different endpoints.

v0.3 also includes support for error_mitigation settings like symmetrization as described in https://arxiv.org/pdf/2301.07233.pdf

Because of that:
- added a new error_mitigation parameter on job submission so users can configure it
- added a new aggregation parameter on results that would allow getting results aggregated under the two different methods described in the paper. Averaging and Plurality voting
@splch splch force-pushed the mm/feat/v0.3-and-symmetrization branch from e017a25 to 11853ab Compare April 24, 2023 15:56
Copy link
Collaborator

@dstrain115 dstrain115 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does anything need to change in the documentation? Such as here:

https://quantumai.google/cirq/hardware/ionq/service

@@ -65,6 +65,8 @@ class Job:
'data associated with it beyond an id and a status.',
)

SUPPORTED_AGGREGATIONS = {'average', 'plurality'}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we document these somewhere? Maybe lower down on line 186?

@@ -100,12 +101,15 @@ def run(
seed: If the target is `simulation` the seed for generating results. If None, this
will be `np.random`, if an int, will be `np.random.RandomState(int)`, otherwise
must be a modulate similar to `np.random`.
error_mitigation: error mitigation settings
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires more explanation. What are the keys and the values of this dictionary?

@@ -141,14 +146,15 @@ def create_job(
repetitions: The number of times to repeat the circuit. Defaults to 100.
name: An optional name for the created job. Different from the `job_id`.
target: Where to run the job. Can be 'qpu' or 'simulator'.
error_mitigation: Error mitigation settings
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here, or reference the other setting.

@CirqBot CirqBot added the size: M 50< lines changed <250 label Apr 25, 2023
@splch splch changed the title v0.3 API + symmetrization v0.3 API + debiasing May 8, 2023
@splch
Copy link
Contributor Author

splch commented May 9, 2023

Does anything need to change in the documentation? Such as here:

https://quantumai.google/cirq/hardware/ionq/service

I included some details about the new parameters run accepts - defining error_mitigation debias and sharpen. How do these updates look to you?

@senecameeks senecameeks added the triage/accepted A consensus emerged that this bug report, feature request, or other action should be worked on label May 17, 2023
@splch
Copy link
Contributor Author

splch commented May 17, 2023

thanks for the help @dstrain115

Copy link
Collaborator

@dstrain115 dstrain115 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Just a few comments about the doc strings.

cirq-ionq/cirq_ionq/ionq_client.py Outdated Show resolved Hide resolved
cirq-ionq/cirq_ionq/job.py Outdated Show resolved Hide resolved
@pavoljuhas pavoljuhas mentioned this pull request Jun 7, 2023
@splch
Copy link
Contributor Author

splch commented Jun 7, 2023

Looks good to me. Just a few comments about the doc strings.

Great updated those and ensured tests are accurate :)

@tanujkhattar tanujkhattar enabled auto-merge (squash) August 2, 2023 17:49
auto-merge was automatically disabled August 2, 2023 17:54

Head branch was pushed to by a user without write access

@splch splch force-pushed the mm/feat/v0.3-and-symmetrization branch from 993a6d0 to f7907fe Compare August 2, 2023 17:59
@codecov
Copy link

codecov bot commented Aug 2, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (c7048f5) 97.87% compared to head (37b38ff) 97.88%.
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #6077    +/-   ##
========================================
  Coverage   97.87%   97.88%            
========================================
  Files        1106     1106            
  Lines       95589    95710   +121     
========================================
+ Hits        93561    93683   +122     
+ Misses       2028     2027     -1     
Files Changed Coverage Δ
cirq-google/cirq_google/engine/engine_client.py 100.00% <ø> (ø)
cirq-google/cirq_google/engine/engine_test.py 100.00% <ø> (ø)
cirq-core/cirq/value/duration.py 98.80% <100.00%> (+0.15%) ⬆️
cirq-core/cirq/value/duration_test.py 100.00% <100.00%> (ø)
...rq-google/cirq_google/engine/abstract_processor.py 93.54% <100.00%> (ø)
cirq-google/cirq_google/engine/engine.py 98.15% <100.00%> (ø)
cirq-google/cirq_google/engine/engine_processor.py 98.05% <100.00%> (ø)
cirq-google/cirq_google/engine/engine_program.py 99.29% <100.00%> (ø)
...irq-google/cirq_google/engine/processor_sampler.py 96.15% <100.00%> (+0.69%) ⬆️
...oogle/cirq_google/engine/processor_sampler_test.py 100.00% <100.00%> (ø)
... and 10 more

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@splch
Copy link
Contributor Author

splch commented Aug 2, 2023

@tanujkhattar i made an additional pr to update tests and it disabled auto-merge, can that be resolved?

@tanujkhattar tanujkhattar enabled auto-merge (squash) August 30, 2023 17:57
@tanujkhattar tanujkhattar merged commit 0e80fa5 into quantumlib:master Aug 30, 2023
@splch splch deleted the mm/feat/v0.3-and-symmetrization branch January 16, 2024 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interface/cirq-ionq size: M 50< lines changed <250 triage/accepted A consensus emerged that this bug report, feature request, or other action should be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants