Skip to content

Add metadata to sweeps#6099

Merged
dstrain115 merged 8 commits intoquantumlib:masterfrom
dstrain115:cirq_sweep_metadata
May 19, 2023
Merged

Add metadata to sweeps#6099
dstrain115 merged 8 commits intoquantumlib:masterfrom
dstrain115:cirq_sweep_metadata

Conversation

@dstrain115
Copy link
Copy Markdown
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, cduck and vtomole as code owners May 19, 2023 16:12
@CirqBot CirqBot added the size: M 50< lines changed <250 label May 19, 2023
Copy link
Copy Markdown
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

Comment thread cirq-core/cirq/study/sweeps.py Outdated
Comment thread cirq-core/cirq/study/sweeps.py Outdated
Comment thread cirq-core/cirq/study/sweeps.py Outdated
Comment thread cirq-core/cirq/study/sweeps.py Outdated
Comment thread cirq-core/cirq/study/sweeps.py Outdated
Comment thread cirq-core/cirq/study/sweeps.py Outdated
@maffoo
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
harry-phasecraft pushed a commit to PhaseCraft/Cirq that referenced this pull request Oct 31, 2024
* Add metadata to sweeps

- 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.

Co-authored-by: Matthew Neeley <mneeley@gmail.com>
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.

3 participants