Function poly_commitment::kzg::combine_evaluations
source · pub fn combine_evaluations<G: CommitmentCurve>(
evaluations: &Vec<Evaluation<G>>,
polyscale: G::ScalarField
) -> Vec<G::ScalarField>
Expand description
Combine the (chunked) evaluations of multiple polynomials.
This function returns the accumulation of the evaluations, scaled by
polyscale
.
If no evaluation is given, the function returns an empty vector.
It does also suppose that for each evaluation, the number of evaluations is
the same. It is not constrained yet in the interface, but it should be. If
one list has not the same size, it will be shrunk to the size of the first
element of the list.
For instance, if we have 3 polynomials P1, P2, P3 evaluated at the points
ζ and ζω (like in vanilla PlonK), and for each polynomial, we have two
chunks, i.e. we have
2 chunks of P1
/---------------\
E1 = [(P1_1(ζ), P1_2(ζ)), (P1_1(ζω), P1_2(ζω))]
E2 = [(P2_1(ζ), P2_2(ζ)), (P2_1(ζω), P2_2(ζω))]
E3 = [(P3_1(ζ), P3_2(ζ)), (P3_1(ζω), P3_2(ζω))]
The output will be a list of 3 elements, equal to:
P1_1(ζ) + P1_2(ζ) * polyscale + P1_1(ζω) polyscale^2 + P1_2(ζω) * polyscale^3
P2_1(ζ) + P2_2(ζ) * polyscale + P2_1(ζω) polyscale^2 + P2_2(ζω) * polyscale^3