Skip to main content
The equality polynomial eq(x, y) appears throughout Jolt’s sumcheck protocols. Optimized evaluation of EQ polynomials is critical for prover performance, as these operations are executed thousands of times per proof.

Equality Polynomial Definition

The equality polynomial over boolean hypercube is:
Properties:
  • eq(x, y) = 1 when x = y (over ⁿ)
  • eq(x, y) = 0 when x ≠ y
  • Multilinear in both arguments

Multilinear Extension (MLE)

The MLE of eq extends the definition to field elements:

Common Operations

1. EQ Evaluation Table

Compute eq(r, x) for all x ∈ {0,1}ⁿ:
Output: Vector of length 2^n where evals[i] = eq(r, i) (big-endian bit order). Use case: Pre-compute EQ table for sumcheck evaluations.

2. Zero Selector

Compute eq(r, 0) = ∏ᵢ (1 - rᵢ):
Use case: Select the all-zeros vertex of the hypercube.

3. Cached Evaluations

Compute EQ tables for all prefixes of r:
Output: result[j][x] = eq(r[..j], x) for all j ∈ [0, n]. Use case: Incremental sumcheck binding where intermediate EQ values are needed.

Key Optimizations

1. Serial vs. Parallel Threshold

Small EQ tables use serial computation:
Reason: Parallel overhead exceeds benefit for n ≤ 16 (table size ≤ 65,536).

2. Serial Evaluation Algorithm

Dynamic programming approach:
Complexity: O(2ⁿ) time, O(2ⁿ) space Optimization: Single pass, in-place updates, no additional allocations.

3. Parallel Evaluation Algorithm

For large tables, use rayon parallelization:
Key features:
  • Unsafe pre-allocation for zero-initialized vector
  • Parallel iteration over pairs
  • In-place updates (no intermediate allocations)

4. Aligned Block Evaluation

Compute EQ values for a power-of-two block:
Use case: When scanning a contiguous range, compute only the suffix EQ table and scale by the prefix selector. Example:
Speedup: Avoids computing full 2^20 table when only a 2^16 block is needed.

5. Endianness Handling

EQ polynomial evaluation with different bit orderings:
Reason: Jolt uses big-endian bit order by convention, but some protocols (like high-to-low binding) require little-endian.

Performance Impact

Memory Allocation Optimization

Standard approach:
Optimized approach:
Speedup: ~2-3x for large n (avoids Drop overhead).

Parallelization Impact

Caching Benefits

For protocols that need EQ values at multiple prefix lengths: Without caching:
  • Time complexity: O(2^0 + 2^1 + … + 2^n) = O(2^(n+1))
With caching:
  • Time complexity: O(2^n) — 2x speedup

Usage in Jolt

Sumcheck Round Polynomial

EQ polynomials appear in every sumcheck round:

Split EQ Evaluation

CompactPolynomial optimizes this pattern:
Benefit: Exploit structure of polynomial layout to avoid full EQ table materialization.

SharedRaPolynomials

Multiple polynomials share the same EQ table:
Memory savings: N polynomials share one EQ table instead of N separate tables.

Best Practices

1. Choose Appropriate Evaluation Method

2. Reuse EQ Tables

Avoid recomputing:

3. Use Aligned Blocks for Sparse Access

When accessing a contiguous range:

References

  • Implementation: jolt-core/src/poly/eq_poly.rs
  • Index/bit ordering: Big-endian convention (MSB = r[0], LSB = r[n-1])