-
Notifications
You must be signed in to change notification settings - Fork 383
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
Implement Bravyi-Kitaev for InteractionOperator #752 #753
Implement Bravyi-Kitaev for InteractionOperator #752 #753
Conversation
To be clear this is implementing the transform directly and leveraging hermiticity to avoid avoid having to do simplification steps that are built into the current code path...is that correct? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. ℹ️ Googlers: Go here for more info. |
@googlebot I fixed it. |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
3 similar comments
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
@googlebot I consent. |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
@googlebot I consent. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…umlib#753) * Implement Bravyi-Kitaev for InteractionOperator quantumlib#752 * cleaning up test imports and improving readability of comments * fixup for formatting and linting * formatting and linting Co-authored-by: jjgoings <[email protected]>
Fixes #752
Extends the implementation of the Bravyi-Kitaev method as described by Seeley, Richard, Love. 2012 (https://arxiv.org/pdf/1208.5986.pdf) to InteractionOperators. Table II of arXiv:1208.5986 [quant-ph] is implemented by introducing the seeley_richard_love (SRL) method which can also accept complex operators. This method is believed to reduce the overheads in simplification required when evaluating products of creation/annihilation operators as Pauli strings in the Bravyi-Kitaev qubit basis.
The previous approach to converting InteractionOperator to QubitOperator would be to:
In total this is between 1.2 - 2.2 times slower than using SRL.
For large molecules 20% is considerable runtime. When running on an HPC node, transforming trifluoroacetic acid (TFA, 70 qubits) using SRL saved 3.7 minutes.
The SRL approach will not work for general FermionOperator objects. To speedup these, convert to an InteractionOperator before running the transformation.
Here is simplified explanation of the speedup:
Consider the simpler case of a Jordan-Wigner transformation. Transforming an arbitrary one-body interaction term (eg. i = N, j = 3) requires taking the product of two fermion operators and writing it as a Pauli string:
Between any two operators, many trailing Z gates will lead to cancellations that are trivial when written in this form but must still be computed and evaluated by a general approach.
By applying each of the 5 cases arising from second-quantisation the Jordan-Wigner transformation can be written as a set of general Pauli string:
Reference: https://docs.microsoft.com/en-us/quantum/user-guide/libraries/chemistry/concepts/jordan-wigner
The simplification for Bravyi-Kitaev follows a similar logic, albeit more involved. For each of the 5 equations above, the RHS now evaluates to an expression that is determined by each of the 10 cases illustrated in Table II (p,q -> i, j) above and given here in Python as the SRL method.
This pull request also:
Applies consistency between _parity_set and _update_set definitions in arXiv:1208.5986 [quant-ph] (Note: needed to update fenwick_tree_test.py to handle minor change in parity set function imported from bravyi_kitaev.py):
Adds additional class to bravyi_kitaev_test.py to maintain full coverage over new code: