-
Notifications
You must be signed in to change notification settings - Fork 603
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
Methods to commute terms in Fermi objects #6196
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #6196 +/- ##
=======================================
Coverage 99.58% 99.58%
=======================================
Files 444 444
Lines 42323 42367 +44
=======================================
+ Hits 42149 42193 +44
Misses 174 174 ☔ 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.
Nice work @willjmax. I left some initial comments but it looks good so far.
[sc-72571] |
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.
Looks great. Some small comments but should be good to go soon.
Co-authored-by: Austin Huang <65315367+austingmhuang@users.noreply.github.com>
Co-authored-by: Austin Huang <65315367+austingmhuang@users.noreply.github.com>
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 @willjmax, looks good, please address my final minor comments on the doc.
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>
This PR introduces the method `shift_operator` to the `FermiWord` class. Given an initial position and a final position, the method will shift the operator in the initial position to the final position, and apply the fermion anti-commutator relations. `shift_operator` returns a `FermiSentence` object since new terms and coefficients may be introduced by the anti-commutator relations. The following code ``` fw = FermiWord({(0, 0): '+', (1, 1): '-', (2, 2): '+'}) fw.shift_operator(2, 0) ``` produces `FermiSentence({FermiWord({(0, 2): '+', (1, 0): '+', (2, 1): '-'}): 1})` which is the `FermiSentence` obtained by shifting the operator in the 2nd position until it reaches the 0th position. That is `a+(0) a(1) a+(2)` becomes `a+(2) a+(0) a(1)`. --------- Co-authored-by: Austin Huang <65315367+austingmhuang@users.noreply.github.com> Co-authored-by: Utkarsh <utkarshazad98@gmail.com> Co-authored-by: soranjh <40344468+soranjh@users.noreply.github.com>
This PR introduces the method
shift_operator
to theFermiWord
class. Given an initial position and a final position, the method will shift the operator in the initial position to the final position, and apply the fermion anti-commutator relations.shift_operator
returns aFermiSentence
object since new terms and coefficients may be introduced by the anti-commutator relations.The following code
produces
FermiSentence({FermiWord({(0, 2): '+', (1, 0): '+', (2, 1): '-'}): 1})
which is theFermiSentence
obtained by shifting the operator in the 2nd position until it reaches the 0th position. That isa+(0) a(1) a+(2)
becomesa+(2) a+(0) a(1)
.