Skip to content

v0.3.0

Choose a tag to compare

@behackl behackl released this 20 Oct 20:24

Sequences now use the multiplicative notation of the literature, and the
documentation follows its terminology. Breaking changes take effect without a
deprecation period.

Breaking changes

  • Sequences are written multiplicatively. S(g, h, ...) constructs the
    sequence g·h·…, S * T is the product, S ** k a power, S / T is
    S·T⁻¹ for a divisor T of S, and -S negates every term.
    S.from_terms(iterable) builds a sequence from an iterable, and
    math.prod() multiplies sequences. Removed: S([...]), +, -, integer
    *, and sum() support.
  • AdditiveSequence.total() is renamed to sum().
  • Symmetry keywords follow one rule. Queries whose answer depends on the group
    take group=, which defaults to the space's automorphism group: the
    catalogue orbit methods, AnchoredCanonicalizer (whose group is now
    optional), and the sequence orbit methods, where group= replaces action=
    and also accepts an AutomorphismGroup. Queries that use symmetry only to
    save work take symmetry=True|False|AutomorphismGroup: the zero-sum
    constants (default True) and FactorizationCache,
    AdditiveSequenceSpace.factorization_cache() and
    FactorizationCache.from_jsonl() (default False, replacing group=).
  • AdditiveSequence.orbit() returns the orbit sorted, not in breadth-first
    order.
  • Factorization queries raise ValueError when an explicit Davenport bound or
    a supplied atom catalogue provably cannot factor a zero-sum sequence, instead
    of returning empty results. Queries for a single length are unchanged.
  • FactorizationCache.statistics is a property returning a
    FactorizationCacheStatistics dataclass instead of a method returning a
    dict. clear() now also resets the counters.
  • AutomorphismGroup finds the identity among Automorphism elements or, when
    compose is given, as the idempotent element; otherwise identity= is
    required and its absence raises TypeError.
  • Short reprs: sequences display as their product, groups and spaces by
    their construction, e.g. FiniteAdditiveGroup.cyclic_product(2, 4).
  • Length caps and exponents reject booleans and other non-integers.
  • The tutorial is a marimo notebook (notebooks/tutorial.py);
    notebooks/tutorial.ipynb and the Binder setup are removed, and the
    tutorial extra installs marimo and Matplotlib. Development tools moved
    from the dev extra to a dev dependency group
    (pip install --group dev).

Added

  • Exact zero-sum constants: zero_sum_constant (with extremal sequences),
    davenport_constant, erdos_ginzburg_ziv_constant, eta_constant, and
    exponent, with symmetry reduction.
  • The Davenport bound of a sequence space is optional. Without one, a
    certified bound is derived without an exhaustive search, using exact
    formulas where they apply; exact values are cached and shared between
    spaces over the same group.
  • FiniteAdditiveGroup.order(), element_order(), exponent(), and
    negate().
  • Groups, spaces, sequences, and catalogues can be pickled; sequences sent to
    worker processes compare equal to the caller's.
  • Orbit methods use an automorphism group supplied by the parent when it has
    no explicit generators.
  • FactorizationCache.from_jsonl() accepts canonicalize= and loads files
    saved with any symmetry setting.
  • FactorizationStatistics and FactorizationCacheStatistics are exported.
  • Documentation at https://zero-sum-sequences.readthedocs.io/, with
    definitions, an API reference, and the tutorial, runnable in the browser.
  • Python 3.15 is tested.

Changed

  • Maximum-only factorization queries use less memory.
  • NetworkX is imported only when a factorization graph is requested.
  • Sage is probed only for Sage parents, and unavailable symmetry is resolved
    once per space.

Fixed

  • Parents whose zero() returns a non-canonical label give correct sums and
    zero-sum tests.

Full changelog: https://zero-sum-sequences.readthedocs.io/en/latest/changelog.html