-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Propagate rotation epsilon in gate cost #1250
Comments
Sample code snippet: import sympy
from qualtran.bloqs.basic_gates import ZPowGate
t, eps = sympy.symbols(r"t \epsilon")
bloq = ZPowGate(exponent=t, eps=eps)
print(bloq.t_complexity()) Prints One could do |
Some history: eps for rotations was introduced in the early days of Qualtran and I think is a useful parameter when constructing rotation bloqs. I agree it's probably not propagated correctly everywhere (though I remember implementing and correctly propagating Originally, the rotation bloqs had a As part of unifying / deprecating the T-complexity protocol; a temporary fix was to return rotations=1 for all rotation bloqs and add a method on the TComplexity class to convert rotations into T-gates. Eventually, the idea was to use the new costing framework to keep track of bloq counts and then use the eps to convert rotation bloqs to t-gates like we used to do originally. Here are some relevant discussions - Using a single / hardcoded eps to convert all rotation bloqs to t gates was never meant to be a permanent solution. We've just not gotten around completing the migration yet I guess. |
@mpharrigan As per our discussion offline, it'll be nice to have this as part of the v1.0 milestone. |
I would also please like to have this feature! Results such as the ones produced by this code snipet:
are pretty confusing at first. I know this can be "fixed" by passing Moreover, imagine one wants to get T gate counts for Bloqs containing rotations with different level of precision. To my understanding this is currently not possible:
This will always output Or is there a way to get correct resource estimates in such cases? |
The
t_complexity
protocol ignores theeps
parameter when counting rotations.The solution is to enhance the
QECGatesCost
cost and associated dataclassGateCounts
to count rotation/eps pairs.The text was updated successfully, but these errors were encountered: