-
Notifications
You must be signed in to change notification settings - Fork 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
Add caching to value_equality_values
decorator for auto generated methods.
#6275
Add caching to value_equality_values
decorator for auto generated methods.
#6275
Conversation
value_equality_values
decorator for auto generated methods.
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.
Nit: _compat.cached_method(values_getter)
can be reused so that the values_getter is evaluated once. Otherwise LGTM.
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #6275 +/- ##
=======================================
Coverage 97.87% 97.88%
=======================================
Files 1106 1106
Lines 95710 95717 +7
=======================================
+ Hits 93679 93690 +11
+ Misses 2031 2027 -4
☔ View full report in Codecov by Sentry. |
…ethods. (quantumlib#6275) * Add caching to value_equality_values decorator for auto generated methods. * Fix pylint and formatting errors * Address nits, fix bugs and make PauliSum unhashable
Fixes #6272
cc #6097
Benchmarks can be seen by running
Before
After
A more real world example would be QROM in Cirq-FT, where
value_equality_values
returns all the data to be loaded by the QROM. Benchmarks as followsBefore
After