-
Notifications
You must be signed in to change notification settings - Fork 44
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
Remove _t_complexity_ #1377
Remove _t_complexity_ #1377
Conversation
if self.legacy_shims: | ||
legacy_val = bloq._t_complexity_() | ||
if legacy_val is not NotImplemented: | ||
warnings.warn( | ||
"Please migrate explicit cost annotations to the general " | ||
"`Bloq.my_static_costs` method override.", | ||
DeprecationWarning, | ||
) | ||
return GateCounts( | ||
t=legacy_val.t, clifford=legacy_val.clifford, rotation=legacy_val.rotations | ||
) | ||
|
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.
Please see that all tests pass without this shim; but I think I'll put this back in (using getattr(bloq, '_t_complexity_', None)
for a bit of backwards compatibility support
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.
Latest commit puts this back in
05b759e
to
7cd87f0
Compare
End of an era! ptal @tanujkhattar |
Final part of #1251
This PR removes the legacy
_t_complexity_
override from all bloqs. These were already redundant: during development of previous PRs I had removed use of these anyways. Those PRs did careful accounting of allbloq_example
and unit test t complexity values and made sure they matched theQECGatesCost
values (with some small, contained legacy shims). This PR shows that off!See my inline comments, but I left in a
getattrs
-based shim so that the_t_complexity_
override will still be used ifQECGatesCost()
is in legacy mode. The only thing left in qualtran that uses it is a specific unit test I added to test it.