Repository navigation
v0.3.0
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
sequenceg·h·…,S * Tis the product,S ** ka power,S / Tis
S·T⁻¹for a divisorTofS, and-Snegates every term.
S.from_terms(iterable)builds a sequence from an iterable, and
math.prod()multiplies sequences. Removed:S([...]),+,-, integer
*, andsum()support. AdditiveSequence.total()is renamed tosum().- Symmetry keywords follow one rule. Queries whose answer depends on the group
takegroup=, which defaults to the space's automorphism group: the
catalogue orbit methods,AnchoredCanonicalizer(whose group is now
optional), and the sequence orbit methods, wheregroup=replacesaction=
and also accepts anAutomorphismGroup. Queries that use symmetry only to
save work takesymmetry=True|False|AutomorphismGroup: the zero-sum
constants (defaultTrue) andFactorizationCache,
AdditiveSequenceSpace.factorization_cache()and
FactorizationCache.from_jsonl()(defaultFalse, replacinggroup=). AdditiveSequence.orbit()returns the orbit sorted, not in breadth-first
order.- Factorization queries raise
ValueErrorwhen 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.statisticsis a property returning a
FactorizationCacheStatisticsdataclass instead of a method returning a
dict.clear()now also resets the counters.AutomorphismGroupfinds the identity amongAutomorphismelements or, when
composeis given, as the idempotent element; otherwiseidentity=is
required and its absence raisesTypeError.- 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.ipynband the Binder setup are removed, and the
tutorialextra installs marimo and Matplotlib. Development tools moved
from thedevextra to adevdependency 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()acceptscanonicalize=and loads files
saved with any symmetry setting.FactorizationStatisticsandFactorizationCacheStatisticsare 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