-
Notifications
You must be signed in to change notification settings - Fork 579
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
Add from_openfermion function for fermionic operators #5808
Conversation
[sc-62839] |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5808 +/- ##
==========================================
- Coverage 99.68% 99.67% -0.01%
==========================================
Files 420 421 +1
Lines 40170 39893 -277
==========================================
- Hits 40042 39763 -279
- Misses 128 130 +2 ☔ View full report in Codecov by Sentry. |
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.
Thanks @ddhawan11, this looks great!
One question, could we make the functionality available at the top level? qml.from_openfermion()
?
Are we waiting on this PR before we finalize #5773? |
No, these two PRs are independent, but complement each other. |
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.
Thanks @ddhawan11, looks good overall. Can we directly construct the objects as I suggested in the code?
Co-authored-by: Thomas R. Bromley <49409390+trbromley@users.noreply.github.com>
Co-authored-by: soranjh <40344468+soranjh@users.noreply.github.com>
Co-authored-by: soranjh <40344468+soranjh@users.noreply.github.com>
@soranjh I asked this because I see both PRs working on |
@trbromley The difference between two functions is that this one converts Openfermion fermionic operator to PennyLane operators whereas the other PR works on converting openfermion qubit operators to PennyLane operators. I hope this helps. |
@trbromley We should have two functions |
Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>
Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>
Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>
Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>
Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>
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.
Nice work 💯! Looks good to me, just a few comments to address
Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>
Thanks! Ok, I'll hold off on reviewing this PR until it's ready. |
@trbromley This PR (5808) is ready for your review right now. |
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.
Thanks @ddhawan11, one minor comment on using a full name for openfermion_op and then good from my side.
Co-authored-by: soranjh <40344468+soranjh@users.noreply.github.com>
Co-authored-by: soranjh <40344468+soranjh@users.noreply.github.com>
Co-authored-by: soranjh <40344468+soranjh@users.noreply.github.com>
Co-authored-by: soranjh <40344468+soranjh@users.noreply.github.com>
Co-authored-by: soranjh <40344468+soranjh@users.noreply.github.com>
Co-authored-by: soranjh <40344468+soranjh@users.noreply.github.com>
Context:
Added function to convert openfermion fermionic operator to pennylane fermionic operators
Description of the Change:
This function converts openfermion FermionOperator object to pennylane FermiWord and FermiSentence objects
Benefits:
Easier integration between pennylane and openfermion
Possible Drawbacks:
Related GitHub Issues: