Skip to content

Commit

Permalink
Add support for const sweep with None (#6729)
Browse files Browse the repository at this point in the history
* Add support for const sweep with None

* Fix the test

* Fix the test coverage

* Fix the test coverage

* Address the comment

* Use const for all single sweep

* Add more test for constant

* Fix typecheck

* Fix the lint
  • Loading branch information
BichengYing authored Sep 17, 2024
1 parent 2adc218 commit d74e0dc
Show file tree
Hide file tree
Showing 7 changed files with 192 additions and 59 deletions.
15 changes: 15 additions & 0 deletions cirq-google/cirq_google/api/v2/run_context.proto
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,16 @@ message SingleSweep {
Points points = 2;
// Uniformly-spaced sampling over a range.
Linspace linspace = 3;
// A constant value.
Const const = 5;
}

// Optional arguments for if this is a device parameter.
// (as opposed to a circuit symbol)
DeviceParameter parameter = 4;
}


// A list of explicit values.
message Points {
// The values.
Expand All @@ -207,3 +210,15 @@ message Linspace {
// the same.
int64 num_points = 3;
}

// A constant value.
message Const {
// The values.
oneof value {
// This value should always be true if set, which represent the python None object.
bool is_none = 1;
float float_value = 2;
int64 int_value = 3;
string string_value = 4;
}
}
14 changes: 8 additions & 6 deletions cirq-google/cirq_google/api/v2/run_context_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d74e0dc

Please sign in to comment.