-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Allow symbolic scalars in LinearDict #7003
Conversation
@@ -423,6 +465,7 @@ def test_unequal(terms_1, terms_2): | |||
({'X': 1e-12}, {'X': 0}), | |||
({'X': 5e-10}, {'Y': 2e-11}), | |||
({'X': 1.000000001}, {'X': 1, 'Z': 0}), | |||
({'X': sym + 0.000000001}, {'X': sym}), |
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.
I was impressed that approximate equality worked out of the box. No special handling required.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7003 +/- ##
==========================================
- Coverage 97.89% 97.89% -0.01%
==========================================
Files 1085 1085
Lines 95132 95184 +52
==========================================
+ Hits 93127 93176 +49
- Misses 2005 2008 +3 ☔ 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.
LGTM with a couple of small suggestions
Allows symbolic scalars in LinearDict, plus implementations of Pauli expansions for symbolic exponents in X, Y, and Z gates.
Applies to #1617. Resolves the core issue, though there are follow up tasks to update remaining gates
_pauli_expansion_
methods, and then alsoPauliSum
andLinearCombinationOfGates/Ops
, along with the functions that create these classes, to accept or handle parameters.