Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased

Added

  • Specializations for complex-real fixed-point multiplication and division.

  • Complex-real fixed-point matrix multiplication.

  • Operator overloading for real APy* and Python complex.

  • ROM generators for (System)Verilog, Spade, Chisel, Amaranth, and Spinal HDL.

  • Getters for real and imaginary part of APyCFloatArray.

  • Support for logic NOT, AND, OR, and XOR in APyCFloat.

  • Convenience cast functions to APyCFloat and APyCFloatArray.

  • Parameter for seed in APyFloatAccumulatorContext.

  • Utility function from_bits.

  • Iterators for complex arrays.

  • Extract bits for APyFixed and APyFloat using “HDL-style”, inclusive, MSB-first indexing.

Fixed

  • Proper nesting using multiple levels of APyTypes contexts.

  • Utility functions fp and fx automatically detect complex-valued arrays.

  • Correct output bias for logical operations on APyFloat.

  • APyFixedArray.to_bits for 64-bit NumPy arrays on 32-bit systems.

  • prod and cumprod are using fewer bits for fixed-point arrays, see the documentation for exact expressions.

Changed

  • Complex-real fixed-point multiplications now produce results with one less. integer bit compared to earlier, i.e., the number of bits one would expect. This also holds for operations with Python integers and floats.

  • Scalar fixed-point types APyFixed and APyCFixed get their repr bit-specifiers changed to int_bits, frac_bits from bits, int_bits.

Removed

  • Support for Python 3.10.

  • Support for Numpy 1.

0.5.1 - 2026-05-06

Fixed

  • VHDL generator producing an extra in.

  • VHDL generation when providing address table.

  • Crash on division by zero for fixed-point arrays for some word lengths on some platforms.

  • Bug in mixed multi-limb array-scalar fixed-point addition and subtraction.

Changed

  • BREAKING: Division by zero for fixed-point arrays will now always raise a ZeroDivisionError.

0.5.0 - 2026-04-09

Added

  • A domain: https://apytypes.org/

  • An interactive playground on the APyTypes website.

  • Implemented .to_bits() and .from_bits() for APyCFloat.

  • LaTeX representation for APyCFixed and APyCFloat.

  • Array comparisons

  • Array slicing with boolean arrays slices (__getitem__ and __setitem__)

  • Scalars are now instances of Number and Real and/or Complex (as appropriate).

  • real and imag properties for APyFixed, APyFloat, APyFixedArray, and APyFloatArray.

  • trailing_zeros property for APyFixed, APyCFixed, and APyFixedArray.

  • leading_zeros, leading_ones, and leading_signs properties for APyCFixed and APyFixedArray

  • is_zero property for APyFixedArray

  • to_fraction() and as_integer_ratio() for APyFixed and APyFloat.

  • All scalar classes have a from_number method which aliases from_float/from_complex to match the naming in Python 3.14.

  • Support for (de-)serialization of APyTypes’ data types using the Python pickle module.

  • Complex conjugate and Hermitian transpose.

  • Convenience vector-matrix multiplication (as in Numpy, Pytorch, etc):

    • [ M ] @ [ M x N ] ==> [ 1 x M ] @ [ M x N ] ==> [ 1 x N ] ==> [ N ]

  • Mixed real-complex array arithmetic.

  • Thread pool for matrix multiplication.

  • Vector outer products (apytypes.outer).

  • SIMD fixed-point array conjugate.

  • Support for interaction with PyTorch, TensorFlow, JAX, and CuPy (in addition to NumPy).

  • Optimizations for double-limb operations, in particular fixed-point division.

  • Optimizations for conversion of fixed-point numbers with at most 64 bits to floating-point.

  • ConvolutionMode enum that can be used instead of a string.

Fixed

  • Bug in fixed-point mixed real/complex arithmetic when operands have different word lengths.

  • Bug in APyFloat.from_float when result is larger than max value and therefore should be infinity.

  • Tests can run with VUnit version 5 installed.

  • Bug resulting in wrong fixed-point numbers when multi-limb APy(C)FixedArray.from_float is applied to negative Numpy integers.

  • Segmentation violation when initializing APyTypes arrays from zero-dimensional Numpy arrays.

  • Segmentation violation in APyCFixedArray for division-by-zero.

  • Bug where array bit-constructors initialized from NumPy arrays resulted in wrong array values or downright caused a segmentation violation.

  • Issues in LaTeX rendering of special floating-point values.

Changed

  • Updated fmt from v11.2.0 to v12.0.0

  • Updated nanobind from v2.8.0 to v2.12.0.

  • The earlier private module _typing is now made public as typing. This contains the type aliases APyArray and APyScalar which correspond to all array and scalar classes, respectively.

0.4.0 - 2025-09-09

Added

  • Complex-valued floating-point types:

    • APyCFloat, a complex scalar floating-point type.

    • APyCFloatArray, a complex array floating-point type.

  • APyFloat.zero, to create floating-point objects initialized to zero.

  • ARM-Linux wheels.

  • Specialized overload typing signatures for array functions and utility functions.

  • Array creation methods: fullrange, meshgrid.

  • CSV import/export of arrays: import_csv and export_csv.

  • to_numpy and __array__ now accepts dtype and copy arguments.

Fixed

  • Rounding error with QuantizationMode.JAM using APyTypes floating-points if an arithmetic result equals zero.

  • Bug in APyFloat.__lt__ for comparison of floating-points of different formats.

  • Bug in APyCFixedArray.__init__ where all elements become real.

  • Proper string formatting for APyTypes arrays:

    • Array __repr__ methods.

    • Array __str__ methods.

  • Improved type hints for APyArray methods.

  • Bug in APyFixedArray.from_float when converting from APyFixed (issue #683).

  • Bug in multi-limb APyFixedArray.max and APyFixedArray.min (issue #721).

  • Wrong name in fixed-point division exception message (__div__ -> __truediv__)

  • Inconsistency in formatting of complex-valued numbers (e.g., (1.0+2.5j) for scalars and [1.0+2.5j] for arrays)

  • Bug in floating-point matrix multiplications when inside accumulator contexts using quantization modes TRN_INF and TRN_AWAY.

  • Bug in floating-point .to_bits() and .from_bits() for large formats on 32-bit systems.

Changed

  • Updated fmt from v11.1.1 to v11.2.0

  • Updated nanobind from v2.4.0 to v2.8.0.

  • Updated highway from v1.2.0 to v1.3.0.

  • APyFixedArray inner products now returns APyFixed, instead of returning an APyFixedArray with a single element.

  • APyFloatQuantizationContext now accepts the seed parameter for all quantization modes, although it is only used for the stochastic ones.

  • Initialize tensors with Iterable instead of Sequence.

  • BREAKING: arguments related to word length/data type are now keyword only in array utility functions.

0.3.1 - 2025-04-01

Added

  • inf and nan functions to create floating-point objects initialized to infinity or NaN.

Fixed

  • Bug in APyFloat addition/subtraction when the exponent difference was larger than 64, introduced in v0.3.0.

  • Bug in from_float when creating an APyFloat from an APyFixed.

  • ones_like and zeros_like now support APyCFixedArray input.

  • Bug in APyCFixedArray.rdiv (scalar divided by array) word-length evaluation.

  • Bug in APyFloat addition when operands are of different formats and both are exactly equal to zero.

0.3.0 - 2025-03-23

Added

  • In arange, the array type can be deduced from its arguments if no bit-specifiers are given.

  • Added optional parameter for bias in array creation functions that were missing it.

  • Added APyFloatArray.from_bits to create floating-point arrays from bit patterns.

  • It is now possible to assign parts of arrays as APyFixedArray.__setitem__ and APyFloatArray.__setitem__ has been added.

  • fx and fp functions to create fixed-point and floating-point objects of correct type (scalar or array) depending on argument.

  • fn utility function to easily evaluate functions with APy-classes and get a result with the same format.

  • New complex-valued data types:

    • APyCFixed, a scalar fixed-point complex type.

    • APyCFixedArray, an array fixed-point complex type.

  • APyFloatArray.convolve now supports accumulator contexts.

  • VHDL code generation for ROMs.

  • It is possible to perform arithmetic with Numpy arrays, automatically converting the Numpy array to an APyArray of the same size and type as the APyArray argument.

  • from_float now accepts APyTypes scalars.

  • Wheels for Python 3.13.

  • copy-method added for the array and scalar classes. This also includes support for the Python copy.copy and copy.deepcopy functions.

  • Single limb abs and negation now use SIMD instructions.

  • Integer powers of APyFixed.

  • Fixed-point multiplication, including matrix multiplication, is faster for single limb arguments resulting in a two-limb result.

  • Support for unary plus: +X, __pos__.

  • Support for logic not: ~X, __invert__.

Fixed

  • APyTypes contexts now supports multi-threading.

  • Incorrect fixed-point quantization in RND_INF and RND_MIN_INF when source has multiple of 64 bits.

  • Incorrect fixed-point rounding in APyFixedArray.from_array on Windows.

  • Incorrect LaTeX-representation of negative fixed-point scalars.

  • Incorrect casting of large integers in APyFixedArray.from_*.

  • Incorrect accumulation in APyFixedArray.cumsum() and APyCFixedArray.cumsum() when result has more limbs than source.

  • Crash in sum, cumsum, prod, and cumprod for empty arrays.

  • Fixed-point to floating-point conversion properly rounds to +-inf.

Changed

  • Updated nanobind from v2.1.0 to v2.4.0.

  • Updated fmt from v10.2.0 to v11.1.1

  • Updated highway from v1.1.0 to v1.2.0.

Removed

  • Mini-GMP is no longer used. Instead, a local multi-precision integer library written in C++ is used.

  • Support for Python 3.9.

0.2.2 - 2024-10-03

Fixed

  • Fix nanobind interaction with cocotb.

0.2.1 - 2024-09-19

Fixed

  • Memory-access bug in APyFloatArray.cumsum.

  • Bug where APyFixedArray multiplicative methods could give wrong result for multi-limb products if the right-hand side have longer word-length than the left-hand side.

  • Memory leak in nanobind wrapper library.

  • Correct subnormal conversions between APyFixed(Array) and float.

  • Improved arange. It now handles quantization accurately and does not allow infinity and NaN as inputs.

Changed

  • Updated nanobind from v2.0.0 to v2.1.0.

0.2.0 - 2024-09-13

Added

  • Added methods next_up() and next_down() for floating-point scalars.

  • Broadcasting support as NumPy.

    • APyFixedArray.broadcast_to()

    • APyFloatArray.broadcast_to()

    • Automatic broadcasting on array arithmetic

  • Support arithmetic between APyTypes classes and Python’s built-in floats and ints.

  • Support for automatic stub generation added.

  • Docstrings are made compatible with doctest, which is run in the CI.

  • Linting using ruff is added to pre-commit and CI.

  • Array manipulation and mathematical functions added:

    • squeeze()

    • reshape()

    • flatten() / ravel()

    • convolve()

    • sum()

    • cumsum()

    • nansum()

    • nancumsum()

    • prod()

    • cumprod()

    • nanprod()

    • nancumprod()

    • moveaxis()

    • swapaxis()

    • expand_dims()

    • max()

    • min()

    • nanmax()

    • nanmin()

  • Array creation functions added:

    • arange()

    • eye()

    • identity()

    • ones()

    • ones_like()

    • zeros()

    • zeros_like()

    • full()

    • full_like()

  • Added to_bits() to array types.

  • Significantly improved indexing of arrays.

  • Added support for higher dimensions (ndim > 2) in transpose().

Changed

  • Updated nanobind dependency from v1.9.2 to v2.0.0.

  • ruff is used instead of black to format the code.

Fixed

  • Smaller fixes in quantization for floating-point scalar multiplication.

  • Fix in floating-point cast-method when result became subnormal.

  • Fix bug in APyFixedArray.__truediv__() where program crashes on long-limb zero denominators.

  • Fix bug where single-dimensional tuple representations missed out on a comma.

  • Fix bug in comparison between floating-point infinity and fixed-point numbers.

  • Start uploading source distributions of APyTypes to PyPI on releases.

  • Fixed bug where APyFixedArray.from_array() initialized the wrong stored value from floating-point values that are too small for its representation. (#487)

  • No longer consider zero a subnormal number.

Removed

0.1.0 - 2024-05-15

Initial release.