-
Notifications
You must be signed in to change notification settings - Fork 54
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
Fix t_complexity
for symbolic ham. sim. by gqsp example
#944
Fix t_complexity
for symbolic ham. sim. by gqsp example
#944
Conversation
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 % I'm slightly uneasy about the util bloq inheritance.
c8d5711
to
278354c
Compare
@fdmalone @tanujkhattar ptal (notebook test failure is unrelated (#911)) |
c8479c7
to
e67c580
Compare
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.
style things
qualtran/bloqs/util_bloqs.py
Outdated
@@ -50,8 +50,31 @@ | |||
from qualtran.simulation.classical_sim import ClassicalValT | |||
|
|||
|
|||
class UtilBloq(Bloq, metaclass=abc.ABCMeta): |
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 think this is reasonable, but please
- Rename to
BookkeepingBloq
, which is more specific than "util" (a name I despise -- we can change the module later :). This also makes the properties make sense: a bookkeeping bloq is trivially controlled and does notn affect the t complexity - make private, i.e.
_BookkeepingBloq
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.
renamed to _BookkeepingBloq
qualtran/bloqs/util_bloqs.py
Outdated
"""Base class for util bloqs. | ||
|
||
1. Trivial controlled - pass through the control register. | ||
2. Do not affect T complexity. | ||
""" |
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.
grammar & style in this docstring.
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.
polished the docstring, how does it look now?
Can you update the PR description to summarize the changes present in this PR |
542e72b
to
9fac150
Compare
t_complexity
doesn't work for StatePreparationAliasSampling #935 (comment) - adds a simplified override for the call graph of a symbolic HamSimbyGQSP bloq._BookkeepingBloq
for utility bloqs that are used for book-keeping (i.e. cast, split/join, alloc/free)