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 protos for Focused Calibration #3222

Merged
merged 7 commits into from
Aug 21, 2020

Conversation

dstrain115
Copy link
Collaborator

  • This adds protos needed for the future feature of custom calibrations.

- This adds protos needed for the future feature of custom calibrations.
@googlebot googlebot added the cla: yes Makes googlebot stop complaining. label Aug 17, 2020
@dstrain115 dstrain115 assigned balopat and unassigned balopat Aug 17, 2020
Copy link
Contributor

@balopat balopat 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 - added some nits/questions

cirq/google/api/v2/calibration.proto Outdated Show resolved Hide resolved
cirq/google/api/v2/calibration.proto Outdated Show resolved Hide resolved
// of a calibration procedure.
message CalibrationLayer {
// The type of the calibration procedure to execute.
// There will be a number of calibration types that can be run,
Copy link
Contributor

Choose a reason for hiding this comment

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

Future tense is confusing here (does this exist or not?), please rephrase to present tense. I think we should define the first set of acceptable values upfront as well - which also could be then an enum instead of string. WDYT?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I was going to put this in a cirq python enum. We can point to it once it exists.

Our convention (for instance with gate sets, gate ids, and arg functions) is to use strings rather than enums. The idea is that we then do not need to modify the public proto when we add new calibration routines (or expose them publicly for that matter). This allows for easier augmentation. We may add and subtract calibration procedures (fairly) frequently, just as we occasionally add new gates.

If you want, I can add a TODO to point to the cirq enum once it exists?

// if the calibration requires this. For many calibrations,
// this will be a single moment representing the layer to
// optimize for.
Circuit circuit = 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

Does the SchedulingStrategy influence the calibration? How about other future execution specific metada/strategies? I.e should this be Program instead of Circuit?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We definitely need a gateset at least. Changed to a Program

// Error codes
enum CalibrationLayerCode {

// For backwards compatibility.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a bit confusing - backwards compatibility with what? This didn't exist before...
IIUC this should be never used, and it is here by convention in case a client doesn't set it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

go/protodosdonts#do-include-an-unspecified-value-in-an-enum

Copy link
Contributor

Choose a reason for hiding this comment

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

Gotcha - that makes sense - I think we can expand on that a bit more in this comment and/or link a publicly available link explaining the reason.

Also from that same paragraph:

All enum values declared under a container message are in the same C++ namespace, so prefix the unspecified value with the enum’s name to avoid compilation errors.

i.e. this should be called CALIBRATION_RESULT_UNKNOWN or if we follow the other enums in our protos it might be CALIBRATION_RESULT_UNSPECIFIED.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

cirq/google/api/v2/calibration.proto Outdated Show resolved Hide resolved
dstrain115 and others added 5 commits August 18, 2020 08:55
Co-authored-by: Balint Pato <balopat@users.noreply.github.com>
Co-authored-by: Balint Pato <balopat@users.noreply.github.com>
Co-authored-by: Balint Pato <balopat@users.noreply.github.com>
Copy link
Contributor

@balopat balopat left a comment

Choose a reason for hiding this comment

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

LGTM

@balopat balopat added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Aug 21, 2020
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Aug 21, 2020
@CirqBot CirqBot merged commit 3a08c52 into quantumlib:master Aug 21, 2020
@CirqBot CirqBot removed automerge Tells CirqBot to sync and merge this PR. (If it's running.) front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. labels Aug 21, 2020
tonybruguier pushed a commit to tonybruguier/Cirq that referenced this pull request Aug 23, 2020
- This adds protos needed for the future feature of custom calibrations.
tonybruguier pushed a commit to tonybruguier/Cirq that referenced this pull request Aug 23, 2020
- This adds protos needed for the future feature of custom calibrations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes Makes googlebot stop complaining.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants