Repository navigation
Releases
v0.3.1
A performance release with no API changes. Results are unchanged, except
that symmetry-reduced factorization caches may return different (equally
valid) witnesses.
Changed
- Faster sequence comparisons, which no longer expand the term lists, and
faster catalogue divisor queries. - Atom catalogue enumeration extends only zero-sum free prefixes and needs no
separate atom tests; catalogues are tens to thousands of times faster, for
instance under a second instead of about half a minute for C₃³.
is_atom()checks a single set of subsequence sums instead of enumerating
subsequences. - Automorphism groups of image-table automorphisms, such as those built by
AutomorphismGroup.closure(), compute images, orbits, orbit minima,
stabilizers and transporters with integer keys instead of building image
sequences. Small orbits are traversed through the generators, larger ones
found by scanning the group. Canonical forms of generic sequences are 25
to 70 times faster, stabilizers and orbit classification 3 to 9 times.
FactorizationCachewith symmetry benefits accordingly; for such groups it
transports witnesses with the smallest automorphism realizing the
canonical form, so returned witnesses may differ from 0.3.0. - The factorization solver packs remainder multiplicities into single integers
with guard bits, so testing whether an atom fits and computing the remainder
take one subtraction. Together with the faster atom tests, length sets are
about four to five times faster. - Zero-sum constant searches with symmetry reduction find canonical forms
without scanning the whole group at every step; η(C₃³) takes under a second
instead of about four. sum()andsubsequences()no longer coerce terms that are already
canonical.
Added
benchmarks/benchmark_operations.pytimes catalogue enumeration, atom
tests, length sets, automorphism operations, and zero-sum constants over
several kinds of groups.
Full changelog: https://zero-sum-sequences.readthedocs.io/en/latest/changelog.html
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
v0.2.0
zero-sum-sequences v0.2.0
New public API: AutomorphismGroup, Automorphism, CanonicalForm, AtomOrbit, AnchoredCanonicalizer, FactorizationCache.
New features
-
Materialized automorphism groups. For a finite parent, the whole automorphism group can now be built explicitly (
space.automorphism_group()), giving orbits, stabilizers, canonical orbit representatives (smallest element + witness automorphism), transporters, and orbit classification of atom catalogues in one pass.AdditiveSequencegained a total order (length, then terms) so canonical forms are well-defined regardless of how the group was found. Cross-checked against brute force for C_42, C_2×C_4, C_2×C_6, C_4×C_4, C_3×C_9, C_2^3, C_2^4, C_3^3. -
Indexed, serializable atom catalogues.
AtomCatalogueatoms now have stable indices (catalogue.index(atom),catalogue[i],in), can be filtered/restricted (filter,restrict(max_length=..., support=...)), classified into automorphism orbits (AtomOrbit), and round-tripped throughto_jsonl/from_jsonlwith digest-based re-verification on load. Parents gainedencode_term/decode_term; spaces gaineddecode(), sequences gainedencode(). -
FactorizationCache— a memoized, optionally group-aware front end for length-set queries (length_set,minimum,maximum,has_length,witness,witnesses,factorizations) over a catalogue, with an unbounded length-set cache and LRU-bounded solvers. Supportspreload/to_jsonl/from_jsonlscoped to the catalogue digest and group order. Ships alongsideAnchoredCanonicalizer, which transports the largest atom divisor to its orbit representative and reduces under its stabilizer — useful for normalizing sequences before comparison.
Breaking change
FactorizationOracleis renamed toFactorizationCache(space.oracle()→space.factorization_cache()). The old name reflected the paper's internal terminology rather than what the object does.
v0.1.2
What's changed in v0.1.2?
- Faster exact-length and minimum/maximum factorization queries, with improved cache reuse.
- Targeted extraction of individual factorization witnesses, including profile constraints, without computing the full length set.
- Atom catalogue generation on prescribed supports via
enumerate_atom_catalogue(support=...). - Expanded documentation, tutorial examples, and regression tests.
v0.1.1
What’s new in v0.1.1
- Add fixed-length factorization queries and enumeration via
has_factorization_of_length()andfactorizations(factor_count=...). - Add immutable
FactorizationRelationobjects with canonicalization, common-factor cancellation, reduced relations, and standard factorization distance. - Expand tests and tutorial documentation for the new APIs.
- Remove runtime assertions from the factorization engine.