Skip to content

zorch.spartan.summand

The zerocheck relation â◦b̂ − ĉ (â,b̂,ĉ = Az,Bz,Cz, Hadamard).

The equality-polynomial engine supplies eq(τ,·) as a factored linear weight, so it is deliberately absent here. The combine is mixed-degree (â◦b̂ has degree 2 and ĉ degree 1), which requires a finite sampling domain rather than an infinity-leading homogeneous-product domain.

ZerocheckSummand dataclass

The three-factor zerocheck relation â◦b̂ − ĉ (degree 2).

Source code in zorch/spartan/summand.py
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
@dataclass(frozen=True)
class ZerocheckSummand:
    """The three-factor zerocheck relation `â◦b̂ − ĉ` (degree 2)."""

    @property
    def degree(self) -> int:
        return 2

    def combine_scalars(self) -> tuple[Array, ...]:
        """No loop-invariant scalars: the summand reads only its three factors."""
        return ()

    def combine(self, scalars: Sequence[Array], *factors: Array) -> Array:
        """`â◦b̂ − ĉ` — the scalar-explicit seam form (no scalars here)."""
        del scalars
        a, b, c = factors
        return a * b - c

    def _combine(self, *factors: Array) -> Array:
        """Bound to its (empty) scalars; the round-poly builder reads only this."""
        return self.combine(self.combine_scalars(), *factors)

combine_scalars

combine_scalars() -> tuple[Array, ...]

No loop-invariant scalars: the summand reads only its three factors.

Source code in zorch/spartan/summand.py
26
27
28
def combine_scalars(self) -> tuple[Array, ...]:
    """No loop-invariant scalars: the summand reads only its three factors."""
    return ()

combine

combine(scalars: Sequence[Array], *factors: Array) -> Array

â◦b̂ − ĉ — the scalar-explicit seam form (no scalars here).

Source code in zorch/spartan/summand.py
30
31
32
33
34
def combine(self, scalars: Sequence[Array], *factors: Array) -> Array:
    """`â◦b̂ − ĉ` — the scalar-explicit seam form (no scalars here)."""
    del scalars
    a, b, c = factors
    return a * b - c