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

Exponential of a (commuting) PauliSum #3169

Open
tanujkhattar opened this issue Jul 22, 2020 · 4 comments
Open

Exponential of a (commuting) PauliSum #3169

tanujkhattar opened this issue Jul 22, 2020 · 4 comments
Assignees
Labels
area/paulis area/qis complexity/medium introduces/modifies 3-5 concepts, takes max up to a month for an advanced contributor kind/feature-request Describes new functionality triage/accepted A consensus emerged that this bug report, feature request, or other action should be worked on

Comments

@tanujkhattar
Copy link
Collaborator

Exponentiating a PauliSum where individual terms commute is a fairly common utility function. Both TFQ and OpenFermion need/implement this functionality.

Given all the related nice functions which already exist in Cirq (to_z_basis_ops, PauliSumCollector etc.), I think we should also add a utility to achieve this.

Thoughts? I can send a PR if we have a consensus.

@balopat balopat added the triage/discuss Needs decision / discussion, bring these up during Cirq Cynque label Jul 29, 2020
@balopat
Copy link
Contributor

balopat commented Jul 29, 2020

Thank you for opening this Tanuj! I'm personally open to it, but I'd like to get the opinion of the rest of the maintainers - let's discuss on Cirq Cynq tomorrow!

@balopat
Copy link
Contributor

balopat commented Jul 29, 2020

Cirq Cynque:

  • let's do it
  • implement first only for commuting terms
  • if they don't commute what do we do?
    • first step: throw an error
    • next PRs - for a few anticommuting terms you can do a tableau based exponentiation (@dabacon to comment with link to papers)

@tanujkhattar tanujkhattar self-assigned this Jul 29, 2020
@dabacon
Copy link
Collaborator

dabacon commented Jul 29, 2020

There are sort of three cases:

  1. commuting Pauli terms.
  2. case where there are only a few anticommuting terms
  3. no real structure.

Let H=c_1P_1+c_2P_2 +... +c_k P_k

In case 1) you can write this as a series of PauliStringPhasors, i.e. exp(iH) = exp(ic_1P) exp(ic_2P_2)...exp(ic_kP_k)

In case 2) you can use a stabilizer tableau (https://pdfs.semanticscholar.org/67af/c372369240e202ec902fb11ab25832d403af.pdf). The basic idea would be to iterate over the P_i and build up a tableau. If the next P_i commutes with the everything in the current tableau, and is not in the tableau, you add it as a z stabilizer for a new logical qubit. If it anticommutes with some of the elements in the tableau, you think about it as an encoded operation on the logical qubits, or whether you can add a new logical stabilizer to make it a product of an existing x/y stabilizer and this new stabilizer. Note that it may span multiple logical qubits. Then you look at the topological sort of z stabilizers and these logical qubits. Different disjoint sets can then be exponentiated. You have to do this numerically, except probably you could be explicit about the case where these are single qubits since exp(iH) for H a single qubit is easy to write down.

Case 3) is where you just do the full exponentiation numerically.

I'm not sure how much the optimization in case 2 matters now that I think about it. Certainly for the exp(iH)s I like to think about for error correction it does, but it might not be worth doing this optimization.

@balopat balopat removed the triage/discuss Needs decision / discussion, bring these up during Cirq Cynque label Jul 30, 2020
@balopat balopat added kind/feature-request Describes new functionality triage/accepted A consensus emerged that this bug report, feature request, or other action should be worked on complexity/medium introduces/modifies 3-5 concepts, takes max up to a month for an advanced contributor area/paulis area/qis labels Aug 13, 2020
CirqBot pushed a commit that referenced this issue Mar 2, 2021
@thanacles
Copy link

@balopat @tanujkhattar It looks like the last PR for this was merged over 6 months ago. Is there more work to do here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/paulis area/qis complexity/medium introduces/modifies 3-5 concepts, takes max up to a month for an advanced contributor kind/feature-request Describes new functionality triage/accepted A consensus emerged that this bug report, feature request, or other action should be worked on
Projects
None yet
Development

No branches or pull requests

5 participants