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

Support for Projectors in Expectation Calculations #357

Open
MichaelBroughton opened this issue Aug 20, 2020 · 2 comments
Open

Support for Projectors in Expectation Calculations #357

MichaelBroughton opened this issue Aug 20, 2020 · 2 comments
Assignees
Labels
kind/feature-request New feature or request

Comments

@MichaelBroughton
Copy link
Collaborator

MichaelBroughton commented Aug 20, 2020

Right now Cirq does not allow such things as:

a = cirq.Z(q0) * cirq.Z(q0) + projector(0111011001)
a.expectation_from_wavefunction(a, ...)

One must manually write out the projection operators like:

a = (1 - cirq.Z(q)) / 2 * (1 + cirq.Z(q2)) / 2 . . .

Storing such a large paulisum can quickly grow to be prohibitive despite the matrix having just one entry in the end and the post-processing step being very simple to implement on a real device. It would be nice if we could have this feature put into Cirq and then relayed up and supported in TFQ. What do people think ? @zaqqwerty .

@MichaelBroughton
Copy link
Collaborator Author

With the additions of quantumlib/Cirq#4364 in the latest release of Cirq. We are now able to work on this issue.

  1. Upgrade to the latest version of Cirq.
  2. Implement serialization logic for ProjectorSums.
  3. Gradually incroporate ProjectorSum functionality in C++ ops incl. gradients.
  4. Add Projector sums to fuzz tests for ops.

@tonybruguier
Copy link
Contributor

I am interested but I don't want to over-commit and under-deliver. Let me take a look at it and get back to you all.

For context these are the PRs:
quantumlib/Cirq#4331 (ProjectorString)
quantumlib/Cirq#4364 (ProjectorSum)

Only the first PR has made it to the current latest release:
https://github.com/quantumlib/Cirq/releases/tag/v0.12.0

jaeyoo pushed a commit to jaeyoo/quantum that referenced this issue Mar 30, 2023
@mhucka mhucka added the kind/feature-request New feature or request label Dec 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature-request New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants