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

measurement_key_shape protocol #4888

Closed
daxfohl opened this issue Jan 24, 2022 · 3 comments
Closed

measurement_key_shape protocol #4888

daxfohl opened this issue Jan 24, 2022 · 3 comments
Labels
area/measurements kind/feature-request Describes new functionality triage/duplicate This issue or pull request is addressed by another issue or pull request

Comments

@daxfohl
Copy link
Collaborator

daxfohl commented Jan 24, 2022

Is your feature request related to a use case or problem? Please describe.

Currently there are protocols for getting the set of measurement keys (and one for control keys). For subcircuits with lots of repetitions, this could produce large sets. This could get unwieldy when testing commutation and other things.

Describe the solution you'd like

It would be nice to have a protocol that just produces the shape. Instead of returning keys {0:key, 1:key,..., N:key}, we would represent this as a single "shape" structure like {slice(0, N):key}. This would be more efficient, and also allow representation of unbounded or indeterminate repetitions, such as if we allowed repetition count to be paramerterizable (#3266).

What is the urgency from your perspective for this issue? Is it blocking important work?

P2 - we should do it in the next couple of quarters

@daxfohl daxfohl added the kind/feature-request Describes new functionality label Jan 24, 2022
@MichaelBroughton MichaelBroughton added the triage/discuss Needs decision / discussion, bring these up during Cirq Cynque label Jan 25, 2022
@tanujkhattar
Copy link
Collaborator

From cirq sync:

Closely tied to reusable measurement keys concept. Will probably get addressed while implementing reusable measurement keys

cc @95-martin-orion

@tanujkhattar tanujkhattar added triage/accepted A consensus emerged that this bug report, feature request, or other action should be worked on triage/duplicate This issue or pull request is addressed by another issue or pull request and removed triage/discuss Needs decision / discussion, bring these up during Cirq Cynque triage/accepted A consensus emerged that this bug report, feature request, or other action should be worked on labels Jan 26, 2022
@daxfohl
Copy link
Collaborator Author

daxfohl commented Feb 11, 2022

Sounds like it's not going to be 100% addressed, as we'll keep flatten_repetitions as optional. I have a sample implementation of this in 8a5f71d. This allows subcircuits to repeat indefinitely, and still handles commutativity when placing circuitops.

@daxfohl
Copy link
Collaborator Author

daxfohl commented Feb 23, 2022

Small note: the only use case in which this would be useful is the case in which we want to have parameterized repetition counts in subcircuits (#3266) on non-flattened subcircuits. In flattened subcircuits, there's no need for it because the keys are repeated. And in (theoretical) repeat-until operations, those wouldn't make sense in non-flattened subcircuits anyway because you need a repeated measurement for the break condition, which requires a flattened subcircuit.

Parameterized repetition counts are currently blocked by #3619.

@daxfohl daxfohl closed this as completed Mar 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/measurements kind/feature-request Describes new functionality triage/duplicate This issue or pull request is addressed by another issue or pull request
Projects
None yet
Development

No branches or pull requests

3 participants