Skip to main content

eval_rs_eq

Function eval_rs_eq 

Source
pub fn eval_rs_eq<F>(
    n_pack: usize,
    z_vals: &[F],
    query: &[F],
    expanded_row_batch_query: &[F],
) -> F
where F: FieldOps<Scalar: BinaryField>,
Expand description

Evaluate the ring switching equality indicator at a given point.

The ring switching equality indicator is the multilinear function $A$ from DP24, Construction 3.1, generalized to an oracle of n_pack entries rather than a power of two (binius.xyz#128, §Ring-Switching): its cell factor is the prefix indicator $\mathrm{eq}_{<n}(z, y)$, so $A$ vanishes above the oracle. It is evaluated succinctly by computing that indicator over the tensor algebra, where the first components live in the vertical subring and the later components live in the horizontal subring. Then we apply row-batching to the tensor algebra element.

z_vals may have more coordinates than query, when the claim spans a wider word-index space than the oracle. The oracle is zero there, so those surplus coordinates contribute $c = \prod_j (1 - z_j)$. The row-batching map is only $\mathbb{F}_2$-linear, so $c$ enters through the vertical subring rather than as a scalar on the result.

§Arguments

  • n_pack - the oracle’s length
  • z_vals - the vertical evaluation point
  • query - the horizontal evaluation point, over the oracle’s variables
  • expanded_row_batch_query - the scaling elements for row-batching

§Pre-conditions

  • z_vals has at least as many components as query
  • n_pack is at most 2^query.len()
  • the length of expanded_row_batch_query must equal FE::DEGREE