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

Expectation value API for simulators #3492

Closed
95-martin-orion opened this issue Nov 10, 2020 · 3 comments
Closed

Expectation value API for simulators #3492

95-martin-orion opened this issue Nov 10, 2020 · 3 comments
Assignees
Labels
area/expectation-value area/simulation kind/feature-request Describes new functionality triage/accepted there is consensus amongst maintainers that this is a real bug or a reasonable feature to add

Comments

@95-martin-orion
Copy link
Collaborator

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

Currently, finding expectation values from a simulator in Cirq requires implementing the SimulatesFinalState interface and using the resulting state vector to get the expectation values. If simulators provide a more efficient way of producing expectation values, we should prefer that instead.

Describe the solution you'd like

In addition to SimulatesFinalState, SimulatesAmplitudes, etc., Cirq should offer a SimulatesExpectationValues interface for simulators that generate expectation values.

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. The current workaround is to continue using SimulatesFinalState, but as noted above this may be inefficient.

@95-martin-orion 95-martin-orion added triage/discuss Needs decision / discussion, bring these up during Cirq Cynque kind/feature-request Describes new functionality area/simulation area/expectation-value labels Nov 10, 2020
@95-martin-orion 95-martin-orion self-assigned this Dec 2, 2020
@balopat balopat added triage/accepted there is consensus amongst maintainers that this is a real bug or a reasonable feature to add needs agreed design We want to do this, but it needs an agreed upon design before implementation needs-rfc and removed triage/discuss Needs decision / discussion, bring these up during Cirq Cynque needs agreed design We want to do this, but it needs an agreed upon design before implementation labels Jan 6, 2021
@balopat
Copy link
Contributor

balopat commented Jan 6, 2021

Discussed on Cirq Cynq: this is a good idea, needed and PauliSums are the way to go.

@95-martin-orion
Copy link
Collaborator Author

Further discussion on the qsim weekly sync identified that this is a proper prerequisite for trajectory-based Monte Carlo simulations; using SimulatesFinalState and processing each result in turn would reduce performance to the point of being infeasible.

@95-martin-orion
Copy link
Collaborator Author

Moving forward with the format discussed in the RFC: https://tinyurl.com/cirq-expectation-value-api

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/expectation-value area/simulation kind/feature-request Describes new functionality triage/accepted there is consensus amongst maintainers that this is a real bug or a reasonable feature to add
Projects
None yet
Development

No branches or pull requests

2 participants