-
Notifications
You must be signed in to change notification settings - Fork 53
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 bit_tools
and replace with QDType
features
#1041
Conversation
This is merely a first attempt for feedback gathering purposes and to see what tests fail.
@mpharrigan PTAL. As far as I can tell, |
output_bits = QFxp(arctan_bitsize, arctan_bitsize).to_bits( | ||
np.abs(output_val), require_exact=False | ||
) |
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.
This got way slower and now this is one of the slowest unit tests
Replace references to
iter_bits
,iter_bits_twos_complement
, anditer_bits_fixed_point
fromqualtran.cirq_interop.bit_tools
as they are largely duplicated by functionality inQUInt
,QInt
, andQFxp
respectively.Move functionality of
float_as_fixed_width_int
toQFxp.to_fixed_width_int
.Modify
QFxp.to_bits
to enable the exactly-representable check to be bypassed and to enable overriding the twos-complement representation of negative binary fractions used byfxpmath
. Previous users ofiter_bits_fixed_point
instead require sign-magnitude representation.Remove
bit_tools
and move its tests todata_types
.Towards #811. Updates to users of
classical_sim.ints_to_bits
should follow in another PR.