pub trait AbstractSumcheckEvaluator<P: PackedField>: Sync {
type VertexState;
// Required methods
fn n_round_evals(&self) -> usize;
fn process_vertex(
&self,
i: usize,
vertex_state: Self::VertexState,
evals_0: &[P],
evals_1: &[P],
evals_z: &mut [P],
round_evals: &mut [P],
);
fn round_evals_to_coeffs(
&self,
current_round_sum: P::Scalar,
round_evals: Vec<P::Scalar>,
) -> Result<Vec<P::Scalar>, PolynomialError>;
}
Expand description
Represents an object that can evaluate the composition function of a generalized sumcheck.
Generalizes handling of regular sumcheck and zerocheck protocols.
Required Associated Types§
type VertexState
Required Methods§
sourcefn n_round_evals(&self) -> usize
fn n_round_evals(&self) -> usize
The number of points to evaluate at.
sourcefn process_vertex(
&self,
i: usize,
vertex_state: Self::VertexState,
evals_0: &[P],
evals_1: &[P],
evals_z: &mut [P],
round_evals: &mut [P],
)
fn process_vertex( &self, i: usize, vertex_state: Self::VertexState, evals_0: &[P], evals_1: &[P], evals_z: &mut [P], round_evals: &mut [P], )
Process and update the round evaluations with the evaluations at a hypercube vertex.
§Arguments
i
: index of the hypercube vertex under processingvertex_state
: state of the hypercube vertex under processingevals_0
: the n multilinear polynomial evaluations at 0evals_1
: the n multilinear polynomial evaluations at 1evals_z
: a scratch buffer of size n for storing multilinear polynomial evaluations at a point zround_evals
: the accumulated evaluations for the round
FIXME: this is incorrect - process_vertex
when called on packed slices essentially processes
a subcube of size P::WIDTH while taking in a single vertex index and state. It accidentally
works on singleton fields. Not fixing due to in-progress move to sumcheck v2.
sourcefn round_evals_to_coeffs(
&self,
current_round_sum: P::Scalar,
round_evals: Vec<P::Scalar>,
) -> Result<Vec<P::Scalar>, PolynomialError>
fn round_evals_to_coeffs( &self, current_round_sum: P::Scalar, round_evals: Vec<P::Scalar>, ) -> Result<Vec<P::Scalar>, PolynomialError>
Given evaluations of the round polynomial, interpolate and return monomial coefficients
§Arguments
current_round_sum
: the claimed sum for the current roundround_evals
: the computed evaluations of the round polynomial