Skip to content

v0.2.0

Choose a tag to compare

@consigcody94 consigcody94 released this 02 Jul 04:42

v0.2.0 — Installable package, vectorized batch API, input validation, property-based tests

Added

  • Installable package: pip install git+https://github.com/consigcody94/quaternion-monoid-algebra now works. Proper quaternion_monoid_algebra package with pyproject.toml and optional extras (test, topology, gpu).
  • Vectorized batch API: PacketArray (struct-of-arrays), packet_product_batch, and reduce_packets — an O(log N)-depth tree reduction of packet chains, legal because ⊗ is associative. Roughly 90× scalar throughput on CPU (benchmarks/bench.py).
  • validate_monoid_table: vets custom Cayley tables (closure, identity laws, full associativity) with a counterexample on failure.
  • pytest + Hypothesis property suite (54 tests) alongside the original property runner and stress tests.
  • Throughput benchmarks and a ruff lint gate in CI.

Changed

  • packet_power is now O(log n) via exponentiation by squaring.
  • make_xor_table vectorized.
  • CI installs the package, runs the pytest suite, and no longer masks stress-test failures.

Fixed

  • Packet/PacketArray validate inputs: zero/non-finite quaternions and non-positive/non-finite scales are rejected at construction.
  • Quaternion normalization is overflow/underflow-safe (max-component pre-scaling): components above ~1e154 no longer silently store a zero quaternion; components below ~1e-162 are no longer falsely rejected.
  • Packet.__eq__ tolerances tightened and documented: quaternion absolute 1e-9, scale relative 1e-9 (numpy's default rtol=1e-5 previously dominated).

Full details in CHANGELOG.md.