Skip to content

Classical fixed point values for simulation  #1219

@anurudhp

Description

@anurudhp

Current Implementation

With #1204, #1215, the classical simulator uses raw integers as classical values of QFxp registers. These can be obtained from floating point values using QFxp.to_fixed_width_int, and converted back using QFxp.float_from_fixed_width_int.

Potential Alternatives

  • fxpmath: A new library for representing fixed-width floating points, with arithmetic and numpy NDArray support. For the moment this is quite unstable, e.g., see Vectorized variants of to_bits and from_bits #1142.
  • Use a lightweight wrapper (say FxpValue) around ints to make debugging and type-checking easier.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions