-
Notifications
You must be signed in to change notification settings - Fork 118
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
feat: Add dot(), power(), and to_circuit() to PauliString #574
feat: Add dot(), power(), and to_circuit() to PauliString #574
Conversation
Pinging for feedback (perhaps @speller26 ?). PR should be independent of the clifford tableau feature. |
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.
Thank you for the contribution; this is a great improvement to existing functionality! Would you also mind implementing __imul__
and __ipow__
?
Changes applied 👍 |
Codecov Report
@@ Coverage Diff @@
## main #574 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 121 121
Lines 7828 7885 +57
Branches 1739 1754 +15
=========================================
+ Hits 7828 7885 +57
|
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.
Looking good! Just needs some tests to bring the changes to full coverage
pauli_other._nontrivial = {} | ||
else: | ||
for _ in range(n - 1): | ||
pauli_other.dot(self, inplace=True) |
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.
Try to take advantage of the fact that the Pauli matrices are involutory;
…dd full test coverage
Coverage should be clear now 🤞 Apologies, work has been a little hectic hah |
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.
Great job! This greatly expands the functionality of PauliString
What?
-iX
being treated as-X
)Further Development
to_circuit()