Closed charlesyuan314 closed 3 weeks ago
@mpharrigan PTAL.
As far as I can tell, classical_sim.ints_to_bits
and classical_sim.bits_to_ints
are currently only used in relation to classical simulation. They also use np.uint64
for what I assume to be performance reasons. So I haven't touched those at this point.
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.