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 metadata to sweeps #6099

Merged
merged 8 commits into from May 19, 2023
Merged

Conversation

dstrain115
Copy link
Collaborator

  • Adds optional metadata attribute to Linspace and Points.
  • This will be used to adjust device parameters via sweep.

See https://tinyurl.com/cirq-sweep-metadata-public for RFC.

- Adds optional metadata attribute to Linspace and Points.
- This will be used to adjust device parameters via sweep.

See https://tinyurl.com/cirq-sweep-metadata-public for RFC.
@dstrain115 dstrain115 requested review from a team, vtomole and cduck as code owners May 19, 2023 16:12
@CirqBot CirqBot added the size: M 50< lines changed <250 label May 19, 2023
Copy link
Contributor

@maffoo maffoo left a comment

Choose a reason for hiding this comment

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

Minor comments, then LGTM

cirq-core/cirq/study/sweeps.py Outdated Show resolved Hide resolved
cirq-core/cirq/study/sweeps.py Outdated Show resolved Hide resolved
cirq-core/cirq/study/sweeps.py Outdated Show resolved Hide resolved
cirq-core/cirq/study/sweeps.py Outdated Show resolved Hide resolved
cirq-core/cirq/study/sweeps.py Outdated Show resolved Hide resolved
cirq-core/cirq/study/sweeps.py Outdated Show resolved Hide resolved
@maffoo
Copy link
Contributor

maffoo commented May 19, 2023

Should probably add metadata on ListSweep as well, since that also can be serialized and sent to the API (https://github.com/quantumlib/Cirq/blob/master/cirq-google/cirq_google/api/v2/sweeps.py#L60).

dstrain115 and others added 6 commits May 19, 2023 09:32
Co-authored-by: Matthew Neeley <mneeley@gmail.com>
Co-authored-by: Matthew Neeley <mneeley@gmail.com>
Co-authored-by: Matthew Neeley <mneeley@gmail.com>
Co-authored-by: Matthew Neeley <mneeley@gmail.com>
Co-authored-by: Matthew Neeley <mneeley@gmail.com>
Co-authored-by: Matthew Neeley <mneeley@gmail.com>
@maffoo
Copy link
Contributor

maffoo commented May 19, 2023

Note that in the ListSweep case, the sweep is converted during serialization into a zip over individual Point sweeps when serializing, so we probably want the ListSweep metadata to be something like Mapping[cirq.TParamKey, Any] so that the metadata can be split up appropriately. Similarly in the "flatten expressions" transformer we will want to be able to collect metadata about the individual param keys into a map and attach it to the ListSweeps that are produced.

@dstrain115
Copy link
Collaborator Author

Ok, thanks for the corrections. I will save ListSweep for a follow-up PR. I want to give it a bit more though.

@dstrain115 dstrain115 merged commit 683286b into quantumlib:master May 19, 2023
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: M 50< lines changed <250
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants