Input semantics¶
Input and arithmetic¶
A ChainWindow represents one fixed degree:
A has shape m×n and D has shape n×p, using column vectors. Supply ordered,
unique nonempty basis identifiers for each space and n finite positive weights.
Empty spaces are supported. Invalid dimensions, bases, coordinates, weights, or
AD≠0 raise InvalidInput, a ValueError subclass.
from homology_operator import Matrix
matrix = Matrix.from_rows(((1, 1, 0), (0, 1, 1)))
assert matrix.kernel_basis() == ((1, 1, 1),)
assert matrix.solve((1, 0)) == (1, 0, 0)
assert Matrix.from_rows((), ncols=3) == Matrix.zero(0, 3)
Coordinates must be integer 0/1 values; booleans, floats, truncation, and implicit
reduction modulo 2 are rejected. solve(b) returns a deterministic solution with
free variables set to zero, or None when no solution exists. A valid empty
solution is ().
|
Accepted weights |
Geometry |
|---|---|---|
|
Arbitrary-precision integers |
Exact; objective ratios use |
|
Integers and |
Exact rational arithmetic |
|
Integers, floats, fractions converted to finite positive binary64 |
Numerical |
The caller declares weight_semantics and unit. Positive costs do not imply
that weights are areas or volumes. Original coordinates determine geometry.